使用Keepalived进行Memcached双机热备
1.节点A
mkdir -p /etc/keepalived/
vi /etc/keepalived/keepalived.conf
# a higher priority machine comes back online.
# NOTE: For this to work, the initial state of this
# entry must be BACKUP.
nopreempt
2.在虚拟机中的问题
在虚拟机中不能使用ifdown eth0这种方式来测试,因为我在测试的过程中遇到过ifdown之后,Backup中还是能收到Master的广播包。虚拟机中可以通过kill keepalived进程来测试。
在物理机中也同时不能使用ifdown eth0这种方式来测试。
参考:
http://blog.sina.com.cn/s/blog_5f190fff0101e9ht.html