Keepalived+MySQL双主搭建(3)

May 15 15:24:58 mxqmongodb2 Keepalived_healthcheckers[3093]: IPVS : Virtual service [172.16.16.20]:3306 illegal timeout. May 15 15:24:58 mxqmongodb2 Keepalived_healthcheckers[3093]: Using LinkWatch kernel netlink reflector... May 15 15:24:58 mxqmongodb2 Keepalived_healthcheckers[3093]: Activating healthchecker for service [172.16.16.35]:3306 May 15 15:24:58 mxqmongodb2 Keepalived_vrrp[3094]: VRRP_Script(checkmysql) succeeded May 15 15:36:04 mxqmongodb2 Keepalived_vrrp[3094]: VRRP_Instance(VI_20) Transition to MASTER STATE May 15 15:36:09 mxqmongodb2 Keepalived_vrrp[3094]: VRRP_Instance(VI_20) Entering MASTER STATE May 15 15:36:09 mxqmongodb2 Keepalived_vrrp[3094]: VRRP_Instance(VI_20) setting protocol VIPs. May 15 15:36:09 mxqmongodb2 Keepalived_vrrp[3094]: VRRP_Instance(VI_20) Sending gratuitous ARPs on eth0 for 172.16.16.20 May 15 15:36:09 mxqmongodb2 Keepalived_healthcheckers[3093]: Netlink reflector reports IP 172.16.16.20 added May 15 15:36:14 mxqmongodb2 Keepalived_vrrp[3094]: VRRP_Instance(VI_20) Sending gratuitous ARPs on eth0 for 172.16.16.20

我们可以看到虚IP链接已经切换了,我们从客户端两个时间点执行MySQL的操作也可以很明显看到切换:

mysql> select @@server_id; +-------------+ | @@server_id | +-------------+ | 343306 | +-------------+ 1 row in set mysql> select @@server_id; +-------------+ | @@server_id | +-------------+ | 353306 | +-------------+ 1 row in set

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/f085b3701005e7f1dbf13211d0ba6f64.html