How to Solve ipvsadm startup Error: Failed to start Initialise the Linux Virtual Server.

Centos7 Yum – y install ipvadm. After installing, start ipvsadm with an error

Redirecting to /bin/systemctl start  ipvsadm.service
Job for ipvsadm.service failed because the control process exited with error code. See "systemctl status ipvsadm.service" and "journalctl -xe" for details.

Look at the prompt, you want me to check the service status

# systemctl status ipvsadm.service
● ipvsadm.service - Initialise the Linux Virtual Server
   Loaded: loaded (/usr/lib/systemd/system/ipvsadm.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 三 2017-06-28 18:15:15 CST; 12s ago
  Process: 2505 ExecStart=/bin/bash -c exec /sbin/ipvsadm-restore < /etc/sysconfig/ipvsadm (code=exited, status=1/FAILURE)
 Main PID: 2505 (code=exited, status=1/FAILURE)

6月 28 18:15:15 localhost.localdomain systemd[1]: Starting Initialise the Linux Virtual Server...
6月 28 18:15:15 localhost.localdomain bash[2505]: /bin/bash: /etc/sysconfig/ipvsadm: No Such File or Dirctory
6月 28 18:15:15 localhost.localdomain systemd[1]: ipvsadm.service: main process exited, code=exited, status=1/FAILURE
6月 28 18:15:15 localhost.localdomain systemd[1]: Failed to start Initialise the Linux Virtual Server.
6月 28 18:15:15 localhost.localdomain systemd[1]: Unit ipvsadm.service entered failed state.
6月 28 18:15:15 localhost.localdomain systemd[1]: ipvsadm.service failed.

 

Prompt no

/etc/sysconfig/ipvsadm

I looked up a lot of information on the Internet and said save first, but I didn’t do this

# service ipvsadm save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

Finally, I see a reliable solution. Manually generate this file:

ipvsadm --save > /etc/sysconfig/ipvsadm

service ipvsadm start   , Start OK

Appendix (source): explanation of ipvsadm command options:

-A –add-service      Add a new virtual server record to the virtual server table of the kernel. That is to add a new virtual server.

-E –edit-service        Edit a virtual server record in the kernel virtual server table.

-D –delete-service    Delete a virtual server record in the kernel virtual server table.

 

-C –clear                  Clear all records in the kernel virtual server table.

-R –restore              Restore virtual server rules

-S –save                  Save the virtual server rule and output it in a format readable by the – R option

-a –add-server        Add a new real server record to a record in the kernel virtual server table. That is to add a new real server to a virtual server

-e –edit-server        Edit a record on a virtual server

-d –delete-server      Delete a real server record in a virtual server record

-L|-l –list                    Displays the kernel virtual server table

-Z –zero                    Clear the virtual service table counter (clear the current number of connections, etc.)

–set tcp tcpfin udp    Set connection timeout value

 

–start-daemon          Start the synchronization daemon. It can be followed by master or backup to indicate whether the LVS router is master or backup. The kept VRRP function can also be used in this function.

–stop-daemon          Stop synchronization daemon

-h –help                    display help information

Other options

:

-t –tcp-service service-address          Description the virtual server provides TCP services [VIP: Port] or [real server IP: Port]

-u –udp-service service-address        Description the virtual server provides UDP services [VIP: Port] or [real server IP: Port]

-f –fwmark-service fwmark                Description is a service type marked with iptables.

-s –scheduler scheduler                    The scheduling algorithm used has the following options: rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq. The default scheduling algorithm is WLC

-p –persistent [timeout]                    Long lasting service. This option means that multiple requests from the same client will be processed by the same real server. The default value for timeout is 300 seconds.

 

-M –netmask                                      netmask persistent granularity mask

-r –real-server server-address          Real server [real server: Port]

-g –gatewaying                                  Specify the working mode of LVS as direct routing mode (also the default mode of LVS)

-i –ipip                                                Specifies that the working mode of LVS is tunnel mode

-m –masquerading                            Specifies that the working mode of LVS is NAT mode

-w –weight weight                            Weight of real server

–mcast-interface interface                Specify the synchronization interface of multicast

-c –connection                                    Displays the current connection of LVS, such as ipvsadm – L – C

–timeout                                          Displays the timeout value of TCP tcpfin UDP, such as ipvsadm – L — timeout

–daemon                                            Displays the status of the synchronization daemon

–stats                                                Display statistics

–rate                                                  Display rate information

–sort                                                  Sort output for virtual and real servers

–numeric -n                                        Digital form of output IP address and port

Similar Posts: