Introduction to keepalived


Introduction to keepalived

1. Keepalived is a service software that ensures high availability of the cluster in cluster management. Its function is similar to heartbeat, which is used to prevent single point of failure.
2. Keepalived is based on the VRRP protocol. The full name of VRRP is Virtual Router Redundancy Protocol, that is, virtual routing redundancy protocol.
3. Work on the basis of VRRP.


Working principle (Take Mysql dual master as an example)
1. When there are two Mysql servers, install keepalived software on each, and the configuration file monitors the status of Mysql.
2. Each keepalived (keepalived group) works on the basis of VRRP and is divided into master and slave.
3. When the status of keepalived monitoring Mysql changes, keepalived is turned off. When the master in the keepalived group goes down (keepalived is turned off), it will find one in the slave as the host to communicate with the client.
4. The client communicates with the Mysql group with a virtual IP and MAC, not the real IP and MAC of each in the Mysql group.
5. When the host goes down, the virtual IP and MAC are taken over by the slave. The new host, so the client still communicates with virtual IP and MAC, and does not feel that he is already accessing Mysql on the slave.




Reference (how keepalived works): http://outofmemory.cn/wiki/keepalived-configuration
Reference (LVS+Keepalived to achieve high availability cluster): https://my.oschina.net/sansom/blog/121445
Reference (Mysql dual master + keepalived implements HA): http://blog.sina.com.cn/s/blog_4f9fc6e10102w6xy.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326847936&siteId=291194637