The Keepalived node VIP address is a dual-vip address at two nodes.

Source: Internet
Author: User

The Keepalived node VIP address is a dual-vip address at two nodes.

I. symptom

Install the keepalived two-node server 10.11.4.186/187, which is mainly used for high availability and sets VIP10.11.4.185.

Ii. Cause 1. View logs

Check the log of 10.11.4.187 and find that the keepalived service on it enters master mode shortly after it is started to obtain the VIP. Also, check the log of 10.11.4.186 without any exception.

It is preliminarily determined that there is a problem with the negotiation mechanism (vrrp) on both sides. The negotiation between the 10.11.4.187 backup node and the 10.11.4.186 master node fails, and the master node is considered to be faulty and switched to the master node.

2. verify the analysis
# Use tcpdump to locate the problem. The following is the packet capture result on the 10.11.4.186 master node [root @ psql_master ~] # Tcpdump-I eth0 vrrp-n

# The following is the packet capture result of the 10.11.4.187 slave node [root @ psql_standby ~] # Tcpdump-I eth0 vrrp-n

Analysis 3. solution 1. Configure iptables
# Configure iptables to allow vrrp traffic or multicast traffic [root @ psql_standby ~] # Vim/etc/sysconfig/iptables-a input-p vrrp-j ACCEPT # Or:-a input-m pkttype -- pkt-type multicast-j ACCEPT # restart iptables: [root @ psql_standby ~] # Service iptables restart

After the iptables policy is released, tcpdump captures packets and finds that the slave node 10.11.4.187 receives more advanced notifications, and no longer sends vrrp notifications.

2. Set vrrp unicast announcement (not verified)
# If multicast is disabled on the uplink switch of two nodes, you can only use the vrrp unicast notification method [root @ psql_master ~] # Vim/etc/keepalived. conf priority 100 unicast_src_ip 10.11.4.186 # source ip unicast_peer {10.11.4.187 # dest ip} [root @ psql_standby ~] # Vim/etc/keepalived. conf priority 90 unicast_src_ip 10.11.4.187 # source ip unicast_peer {10.11.4.186 # dest ip}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.