Keepalive
Keepalived是HA cluster的一种实现方案,其以vrrp协议(Virtual Router Redundancy Protocol,即虚拟路由冗余协议)为实现基础,在N台具有相同功能的路由器或服务器中选出一个master或多个backup,这些路由器或服务器会共用一个对外提供服务的VIP。在此HA cluster集群中,master主机会发送组播来跟backup主机进行通信确认双方是否存活。当backup主机在指定的时间内没有收到vrrp组播报文则认为master主机宕机了,此时就会在所有的backup主机中根据vrrp协议来选举出新的master主机来保证服务的高可用性。
keepalived主要有三个模块,分别是ipvs wrapper、checkers和vrrp stack。
ipvs wrapper模块为keepalived的核心,负责主进程的启动、维护以及全局配置文件的加载和解析。
checkers负责健康检查,包括常见的各种检查方式。
vrrp stack模块是来实现VRRP协议的。
IPVS wrapper 用来发送设定的规则到内核IPVS代码。
Netlink Reflector 用来设定 vrrp 的vip地址等。
1、安装
安装环境
# yum install -y openssl-devel popt-devel curl gcc libnl3-devel net-snmp-devel libnfnetlink-devel
下载安装包,主机备机都要安装
wget https://www.keepalived.org/software/keepalived-2.0.0.tar.gz
解压缩、编译、安装,过程中提示缺什么库就安装什么库,然后再重新编译安装。
# tar -zxf keepalived-2.0.0.tar.gz
# cd keepalived-2.0.0# ./configure --prefix=/usr/local/keepalived
# make&&make install
# echo $?
0#
# cp /usr/local/keepalived/sbin/keepalived /usr/sbin/# cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/# cp ./keepalived/etc/init.d/keepalived /etc/init.d/
# mkdir /etc/keepalived
# cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
2、配置
keepalived 只有一个配置文件 keepalived.conf,其中包含了三类配置区域。
全局配置 Global Configuration,包含了 global_defs(全局配置标识)、static_ipaddress(静态地址)、static_routes(静态路由) 区域配置项。
VRRP 配置,包含了 vrrp_instance(VRRP 实例)、vrrp_sync_group(VRRP 同步组)、vrrp_script(VRRP 脚本) 、virtual_server 区域配置项。
vrrp_instance 用来定义对外提供服务的 VIP 区域及其相关属性。
vrrp_rsync_group 用来定义 vrrp_intance 组,使得这个组内成员动作一致。例如两个 vrrp_instance 同属于一个 vrrp_rsync_group,那么其中一个vrrp_instance 发生故障切换时,另一个 vrrp_instance 也会跟着切换(即使这个 instance 没有发生故障)
vrrp_script 区域
用来做健康检查,当时检查失败时会将 vrrp_instance 的 priority 减少相应的值。
首先在 vrrp_script 区域定义脚本名字和脚本执行的间隔和脚本执行的优先级变更。然后在实例 vrrp_instance 里面引用,有点类似脚本里面的函数引用一样:先定义,后引用函数名。
master
[root@nginx ~]# cat /etc/keepalived/keepalived.conf
global_defs {
notification_email { #故障发生时给谁发邮件通知。
root@localhost
root@192.168.10.18}
notification_email_from keepalived@localhost #通知邮件的发出地址。
smtp_server127.0.0.1 #发现Email的smtp地址smtp_connect_timeout30 #超时时间router_id node1 #运行keepalived的机器标识号,主从机必须不同
}
vrrp_instance VI_1 {
state MASTER #可以是 MASTER 或 BACKUP,不过当其他节点 keepalived 启动时
#会将 Priority(优先级)比较大的节点选举为 MASTER,因此该项其实没有实质用途。interfaceeth1 #本机物理网卡,节点固有 IP(非 VIP)的网卡,用来发 VRRP 包。
lvs_sync_daemon_inteface eth1 #绑定 lvs syncd 的网卡。
virtual_router_id151 #虚拟路由,主从机必需一致。设置 VRID,取值在 0-255 之间,用来区分多个 instance 的 VRRP 组播
#(同一网段中 virtual_router_id 的值不能重复,否则会出错)。
#将决定多播的 MAC 地址priority100 #用来选举 master,要成为 master,这个选项的值最好高于其他机器 50 个点,
#该项取值范围是 1-255(在此范围之外会被识别成默认值 100)。advert_int5 #发 VRRP 包的时间间隔,即多久进行一次 master 选举(可以认为是健康查检时间间隔,默认为 1 秒)。authentication { #认证区域,保持master和backup一致
auth_type PASS
auth_pass123456}
virtual_ipaddress { #VIP(虚拟 IP 地址),随着 state 的变化而增加删除,
#当 state 为 master 的时候就添加,当 state 为 backup 的时候删除,
#主要由优先级来决定的,和 state 设置的值没有多大关系,可以设置多个 IP 地址。192.168.100.100dev eth1
}
}
virtual_server192.168.100.100 3306{ #LVS配置,VIP
delay_loop6 #服务轮询的时间间隔lb_algo wrr #LVS 调度算法
lb_kind DR #LVS 集群算法
persistence_timeout60 #同一IP的链接50秒内被分配到同一台realserverprotocol TCP #用TCP协议检查realserver状态
real_server192.168.10.18 3306{ #实际服务器的IP和端口
weight100notify_down/data/sh/mysql.sh
TCP_CHECK {
connect_timeout10nb_get_retry3delay_before_retry3connect_port3306}
}
}
[root@nginx~]#
backup
[root@mysql ~]#
[root@mysql~]# cat /etc/keepalived/keepalived.conf
global_defs {
notification_email {
root@localhost
root@192.168.10.18}
notification_email_from keepalived@localhost
smtp_server127.0.0.1smtp_connect_timeout30router_id node2
}
vrrp_instance VI_1 {
state BACKUPinterfaceeth1
lvs_sync_daemon_inteface eth1
virtual_router_id151priority90advert_int5authentication {
auth_type PASS
auth_pass123456}
virtual_ipaddress {192.168.100.100dev eth1
}
}
virtual_server192.168.100.100 3306{
delay_loop6lb_algo wrr
lb_kind DR
persistence_timeout60protocol TCP
real_server192.168.10.23 3306{
weight100notify_down/data/sh/mysql.sh
TCP_CHECK {
connect_timeout10nb_get_retry3delay_before_retry3connect_port3306}
}
}
[root@mysql~]#
在两端/data/sh/mysql.sh建立关闭keepalived的脚本
[root@mysql ~]# cat /data/sh/mysql.sh
pkill keepalived
[root@mysql~]#
3、启动
master和backup都启动keepalived服务
[root@nginx ~]# service keepalived start
Starting keepalived: [ OK ]
[root@nginx~]#
[root@nginx~]# ps -ef |grep keep
root127942 1 0 12:27 ? 00:00:00 keepalived -D
root127944 127942 0 12:27 ? 00:00:00 keepalived -D
root127945 127942 0 12:27 ? 00:00:00 keepalived -D
root130062 130014 0 14:27 pts/0 00:00:00grep keep
[root@nginx~]#
[root@nginx~]#
[root@nginx~]# netstat -lantup |grep keep
[root@nginx~]#
[root@mysql ~]# /etc/init.d/keepalived restart
Stopping keepalived: [ OK ]
Starting keepalived: [ OK ]
[root@mysql~]# ps -ef |grep keep
root49218 1 0 12:01 ? 00:00:00 keepalived -D
root49220 49218 0 12:01 ? 00:00:00 keepalived -D
root49221 49218 0 12:01 ? 00:00:00 keepalived -D
root49223 48581 0 12:01 pts/3 00:00:00grep keep
[root@mysql~]#
[root@mysql~]# netstat -lantup |grep keep
tcp0 1 192.168.10.23:58138 192.168.33.23:3306 SYN_SENT 49220/keepalived
[root@mysql~]#
查看两端的虚拟IP启动情况,系统日志
Master端
[root@nginx ~]# ip addr1: lo: mtu 65536qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet127.0.0.1/8scope host lo
inet6 ::1/128scope host
valid_lft forever preferred_lft forever2: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:69:6e:c1 brd ff:ff:ff:ff:ff:ff
inet192.168.10.18/24 brd 192.168.10.255 scope globaleth1
inet192.168.100.100/32 scope globaleth1
inet6 fe80::20c:29ff:fe69:6ec1/64scope link
valid_lft forever preferred_lft forever
[root@nginx~]#
虚拟IP:192.168.100.100已经成功启动
[root@nginx ~]# tail -fn 10 /var/log/messages6
Sep20 15:13:22 nginx Keepalived_healthcheckers[419]: TCP connection to [192.168.10.18]:tcp:3306success.
Sep20 15:13:32 nginx Keepalived_vrrp[420]:(VI_1) Entering MASTER STATE
Sep20 15:13:32 nginx Keepalived_vrrp[420]: (VI_1) setting protocol VIPs.
Sep20 15:13:32 nginx Keepalived_vrrp[420]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:13:32 nginx Keepalived_vrrp[420]: (VI_1) Sending/queueing gratuitous ARPs on eth1 for 192.168.100.100Sep20 15:13:32 nginx Keepalived_vrrp[420]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:13:32 nginx Keepalived_vrrp[420]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:13:32 nginx Keepalived_vrrp[420]: Sending gratuitous ARP on eth1 for 192.168.100.100
说明已经成功作为MASTER启动,且发送ARP包传输
backup端
[root@mysql ~]# tail -fn 10 /var/log/messages
Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: WARNING - default user 'keepalived_script' for script execution does not exist -please create.
Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: Unknown keyword 'nb_get_retry'Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: Please add a #! shebang to script /data/sh/mysql.sh
Sep20 15:25:37 mysql Keepalived_vrrp[52340]: (VI_1) removing protocol VIPs.
Sep20 15:25:37 mysql Keepalived_vrrp[52340]: (VI_1) Entering BACKUP STATE (init)
Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: SECURITY VIOLATION -check scripts are being executed but script_security not enabled.
Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: Gained quorum 1+0=1 <= 100 for VS [192.168.100.100]:tcp:3306Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: Activating healthchecker for service [192.168.10.23]:tcp:3306 for VS [192.168.100.100]:tcp:3306Sep20 15:25:37 mysql Keepalived_vrrp[52340]: VRRP sockpool: [ifindex(2), proto(112), unicast(0), fd(8,9)]
Sep20 15:25:43 mysql Keepalived_healthcheckers[52339]: TCP connection to [192.168.10.23]:tcp:3306 success.
(VI_1) Entering BACKUP STATE (init)已作为backup机启用
[root@mysql ~]# ip addr1: lo: mtu 65536qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet127.0.0.1/8scope host lo
inet6 ::1/128scope host
valid_lft forever preferred_lft forever2: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:ad:ad:54brd ff:ff:ff:ff:ff:ff
inet192.168.10.23/24 brd 192.168.10.255 scope globaleth1
inet6 fe80::20c:29ff:fead:ad54/64scope link
valid_lft forever preferred_lft forever
[root@mysql~]#
backup的IP情况
4、测试
当Master的MySQL服务意外挂掉后,会自动启用backup的Mysql继续为系统提供支持。
[root@nginx ~]# service mysqld stop
Stopping mysqld: [ OK ]
[root@nginx~]#
[root@nginx~]#
[root@nginx~]# ip addr1: lo: mtu 65536qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet127.0.0.1/8scope host lo
inet6 ::1/128scope host
valid_lft forever preferred_lft forever2: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:69:6e:c1 brd ff:ff:ff:ff:ff:ff
inet192.168.10.18/24 brd 192.168.10.255 scope globaleth1
inet6 fe80::20c:29ff:fe69:6ec1/64scope link
valid_lft forever preferred_lft forever
[root@nginx~]#
[root@nginx~]#
[root@nginx~]#
[root@nginx~]# tail -fn 10 /var/log/messages
Sep20 15:36:44 nginx Keepalived_healthcheckers[419]: Error processing RCPT cmd on SMTP server [127.0.0.1]:25. SMTP status code = 501Sep20 15:36:44 nginx Keepalived_healthcheckers[419]: Can not read data from remote SMTP server [127.0.0.1]:25.
Sep20 15:36:44 nginx Keepalived[417]: Stopping
Sep20 15:36:44nginx kernel: IPVS: __ip_vs_del_service: enter
Sep20 15:36:44 nginx Keepalived_vrrp[420]: (VI_1) sent 0priority
Sep20 15:36:44 nginx Keepalived_vrrp[420]: (VI_1) removing protocol VIPs.
Sep20 15:36:44 nginx Keepalived_healthcheckers[419]: Shutting down service [192.168.10.18]:tcp:3306 from VS [192.168.100.100]:tcp:3306Sep20 15:36:44 nginx Keepalived_healthcheckers[419]: Stopped
Sep20 15:36:45 nginx Keepalived_vrrp[420]: Stopped
Sep20 15:36:45 nginx Keepalived[417]: Stopped Keepalived v2.0.0 (05/27,2018)^C
[root@nginx~]# ps -ef |grep keep
root1127 130014 0 15:40 pts/0 00:00:00grep keep
[root@nginx~]#
Master 测试关闭mysql服务,虚拟IP停止发送ARP包,keepalived服务终止
[root@mysql ~]# ip addr1: lo: mtu 65536qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet127.0.0.1/8scope host lo
inet6 ::1/128scope host
valid_lft forever preferred_lft forever2: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:ad:ad:54brd ff:ff:ff:ff:ff:ff
inet192.168.10.23/24 brd 192.168.10.255 scope globaleth1
inet192.168.100.100/32 scope globaleth1
inet6 fe80::20c:29ff:fead:ad54/64scope link
valid_lft forever preferred_lft forever
[root@mysql~]#
[root@mysql~]# tail -fn 20 /var/log/messages
Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: SECURITY VIOLATION -check scripts are being executed but script_security not enabled.
Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: Gained quorum 1+0=1 <= 100 for VS [192.168.100.100]:tcp:3306Sep20 15:25:37 mysql Keepalived_healthcheckers[52339]: Activating healthchecker for service [192.168.10.23]:tcp:3306 for VS [192.168.100.100]:tcp:3306Sep20 15:25:37 mysql Keepalived_vrrp[52340]: VRRP sockpool: [ifindex(2), proto(112), unicast(0), fd(8,9)]
Sep20 15:25:43 mysql Keepalived_healthcheckers[52339]: TCP connection to [192.168.10.23]:tcp:3306success.
Sep20 15:36:44 mysql Keepalived_vrrp[52340]: (VI_1) Backup received priority 0advertisement
Sep20 15:36:45 mysql Keepalived_vrrp[52340]: (VI_1) Entering MASTER STATE
Sep20 15:36:45 mysql Keepalived_vrrp[52340]: (VI_1) setting protocol VIPs.
Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: (VI_1) Sending/queueing gratuitous ARPs on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: (VI_1) Sending/queueing gratuitous ARPs on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100ps^C
[root@mysql~]#
[root@mysql~]# ps -ef |grep keepalived
root52337 1 0 15:25 ? 00:00:00 keepalived -D
root52339 52337 0 15:25 ? 00:00:00 keepalived -D
root52340 52337 0 15:25 ? 00:00:00 keepalived -D
root52760 51101 0 15:42 pts/0 00:00:00grep keepalived
[root@mysql~]#
(VI_1) Entering MASTER STATE,backup机成为Master,继续为系统提供mysql服务,测试成功。
重启Master主机的mysql服务后,Master主机重新成为master,备机重新成为备机
[root@nginx ~]#
[root@nginx~]# service keepalived restasrt
Usage:/etc/init.d/keepalived {start|stop|reload|restart|condrestart|status}
[root@nginx~]# service keepalived restart
Stopping keepalived: [FAILED]
Starting keepalived: [ OK ]
[root@nginx~]#
[root@nginx~]#
[root@nginx~]#
[root@nginx~]# tail -fn 10 /var/log/messages
Sep20 15:44:35 nginx Keepalived_healthcheckers[1409]: Gained quorum 1+0=1 <= 100 for VS [192.168.100.100]:tcp:3306Sep20 15:44:35 nginx Keepalived_vrrp[1410]: Unknown keyword 'lvs_sync_daemon_inteface'Sep20 15:44:35 nginx Keepalived_vrrp[1410]: Assigned address 192.168.10.18 for interfaceeth1
Sep20 15:44:35 nginx Keepalived_healthcheckers[1409]: Activating healthchecker for service [192.168.10.18]:tcp:3306 for VS [192.168.100.100]:tcp:3306Sep20 15:44:35 nginx Keepalived_vrrp[1410]: Assigned address fe80::20c:29ff:fe69:6ec1 for interfaceeth1
Sep20 15:44:35 nginx Keepalived_vrrp[1410]: Registering gratuitous ARP shared channel
Sep20 15:44:35 nginx Keepalived_vrrp[1410]: (VI_1) removing protocol VIPs.
Sep20 15:44:35 nginx Keepalived_vrrp[1410]: (VI_1) Entering BACKUP STATE (init)
Sep20 15:44:35 nginx Keepalived_vrrp[1410]: VRRP sockpool: [ifindex(2), proto(112), unicast(0), fd(8,9)]
Sep20 15:44:36 nginx Keepalived_vrrp[1410]: (VI_1) received lower priority (90) advert from 192.168.10.23 -discarding
Sep20 15:44:41 nginx Keepalived_vrrp[1410]: (VI_1) received lower priority (90) advert from 192.168.10.23 -discarding
Sep20 15:44:41 nginx Keepalived_healthcheckers[1409]: TCP connection to [192.168.10.18]:tcp:3306success.
Sep20 15:44:46 nginx Keepalived_vrrp[1410]: (VI_1) received lower priority (90) advert from 192.168.10.23 -discarding
Sep20 15:44:50 nginx Keepalived_vrrp[1410]: (VI_1) Entering MASTER STATE
Sep20 15:44:50 nginx Keepalived_vrrp[1410]: (VI_1) setting protocol VIPs.
Sep20 15:44:50 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:50 nginx Keepalived_vrrp[1410]: (VI_1) Sending/queueing gratuitous ARPs on eth1 for 192.168.100.100Sep20 15:44:50 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:50 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:50 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:50 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:55 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:55 nginx Keepalived_vrrp[1410]: (VI_1) Sending/queueing gratuitous ARPs on eth1 for 192.168.100.100Sep20 15:44:55 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:55 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:55 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:55 nginx Keepalived_vrrp[1410]: Sending gratuitous ARP on eth1 for 192.168.100.100
^C
[root@nginx~]# ip addr1: lo: mtu 65536qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet127.0.0.1/8scope host lo
inet6 ::1/128scope host
valid_lft forever preferred_lft forever2: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:69:6e:c1 brd ff:ff:ff:ff:ff:ff
inet192.168.10.18/24 brd 192.168.10.255 scope globaleth1
inet192.168.100.100/32 scope globaleth1
inet6 fe80::20c:29ff:fe69:6ec1/64scope link
valid_lft forever preferred_lft forever
[root@nginx~]#
[root@mysql ~]#
[root@mysql~]# tail -fn 20 /var/log/messages
Sep20 15:25:37 mysql Keepalived_vrrp[52340]: VRRP sockpool: [ifindex(2), proto(112), unicast(0), fd(8,9)]
Sep20 15:25:43 mysql Keepalived_healthcheckers[52339]: TCP connection to [192.168.10.23]:tcp:3306success.
Sep20 15:36:44 mysql Keepalived_vrrp[52340]: (VI_1) Backup received priority 0advertisement
Sep20 15:36:45 mysql Keepalived_vrrp[52340]: (VI_1) Entering MASTER STATE
Sep20 15:36:45 mysql Keepalived_vrrp[52340]: (VI_1) setting protocol VIPs.
Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: (VI_1) Sending/queueing gratuitous ARPs on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:45 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: (VI_1) Sending/queueing gratuitous ARPs on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:36:50 mysql Keepalived_vrrp[52340]: Sending gratuitous ARP on eth1 for 192.168.100.100Sep20 15:44:50 mysql Keepalived_vrrp[52340]: (VI_1) Master received advert from 192.168.10.18 with higher priority 100, ours 90Sep20 15:44:50 mysql Keepalived_vrrp[52340]: (VI_1) Entering BACKUP STATE
Sep20 15:44:50 mysql Keepalived_vrrp[52340]: (VI_1) removing protocol VIPs.^C
[root@mysql~]# ip addr1: lo: mtu 65536qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet127.0.0.1/8scope host lo
inet6 ::1/128scope host
valid_lft forever preferred_lft forever2: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:ad:ad:54brd ff:ff:ff:ff:ff:ff
inet192.168.10.23/24 brd 192.168.10.255 scope globaleth1
inet6 fe80::20c:29ff:fead:ad54/64scope link
valid_lft forever preferred_lft forever
[root@mysql~]#