
redis-a 是slave
root@redis-a keepalived# redis-cli info replication
role:slave
master_host:redis-b
master_port:6379
master_link_status:up
master_last_io_seconds_ago:4
master_sync_in_progress:0
slave_repl_offset:8093
slave_priority:100
slave_read_only:1
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
root@redis-a keepalived#
模拟故障发生
root@redis-b keepalived# redis-cli shutdown
root@redis-b keepalived# redis-cli info replication
Could not connect to Redis at 127.0.0.1:6379: Connection refused
root@redis-b keepalived#
发生自动切换
redis-a 的日志中产生了数据
2015-09-25:00:53:36|25366|state:master read change to master
2015-09-25:00:53:36|25366|state:master wait 10 sec for data sync from old master
2015-09-25:00:53:46|25366|state:master data rsync from old mater ok...
2015-09-25:00:53:46|25366|state:master Run slaveof no one,close master/slave
OK
2015-09-25:00:53:46|25366|state:master wait other slave connect....
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。