因为ssh端口修改了,在漂移的时候默认是22端口,所有无法漂移。错误日志:
IN SCRIPT TEST====/sbin/ifconfig eth0:1 down==/sbin/ifconfig eth0:1 10.0.0.65/24===
Enabling the VIP - 10.0.0.65/24 on the new master - 10.0.0.51
ssh: connect to host 10.0.0.51 port 22: Connection refused^M
此时需要修改漂移脚本master_ip_failover
sub start_vip() {
`ssh -p33 $ssh_user\@$new_master_host \" $ssh_start_vip \"`;
}
sub stop_vip() {
return 0 unless ($ssh_user);
`ssh -p33 $ssh_user\@$orig_master_host \" $ssh_stop_vip \"`;
}
将manager节点的ssh端口添加到这两段函数中。
再重新测试,漂移成功
IN SCRIPT TEST====/sbin/ifconfig eth0:1 down==/sbin/ifconfig eth0:1 10.0.0.65/24===
Enabling the VIP - 10.0.0.65/24 on the new master - 10.0.0.52
Wed Dec 12 21:07:40 2018 - [info] OK.