LVS Automatically Switching to the Primary Node After the Node Is Recovered
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
- After the standby takes over services, the VIP is on the standby node by default. Run the following command on the standby node:
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 inet6 fe80::5054:ff:fe68:dcb6/64 scope link valid_lft forever preferred_lft forever
- Run the following command on the primary node to enable the keepalived service:
- The VIP is assigned to the primary node. Run the following command on 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 on the standby node to verify that the VIP information does not exist:
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 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