LVS Automatically Switching to the Standby Node When the Primary Node Is Faulty
Objectives
When the keepalived service on the primary LVS node is faulty (for example, the keepalived service is disabled), the standby LVS node takes over services.
Prerequisites
The LVS primary and standby cluster have been correctly configured.
Test Methods
- The VIP is on the primary node by default. Run the following command to check the network configuration of the primary node:
The following information is displayed:
[root@lvs-master ~]# ip addr eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:68:dc:b6 brd ff:ff:ff:ff:ff:ff inet 192.168.0.157/27 brd 182.148.15.255 scope global eth0 inet 192.168.0.27/32 scope global eth0 inet6 fe80::5054:ff:fe68:dcb6/64 scope link valid_lft forever preferred_lft forever
- Run the following command to stop the keepalived service on the primary node.
- After the VIP is assigned to the standby node, run the following command on the primary node to verify that the VIP information does not exist.
The following information is displayed:
root@lvs-master ~]# ip addr eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:68:dc:b6 brd ff:ff:ff:ff:ff:ff inet 192.168.0.157/27 brd 182.148.15.255 scope global eth0 inet 192.168.0.184/27 brd 182.148.15.255 scope global secondary eth0:0 inet6 fe80::5054:ff:fe68:dcb6/64 scope link valid_lft forever preferred_lft forever
Run the following command on the standby node to check whether the VIP information exists:
ip addr
The following information is displayed:
[root@lvs-slave ~]# ip addr eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:68:dc:b6 brd ff:ff:ff:ff:ff:ff inet 192.168.0.234/27 brd 182.148.15.255 scope global eth0 inet 192.168.0.27/32 scope global eth0 inet 192.168.0.184/27 brd 182.148.15.255 scope global secondary eth0:0 inet6 fe80::5054:ff:fe68:dcb6/64 scope link valid_lft forever preferred_lft forever
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot