by the way
配置文件内容在运行期间会发生改变,被sentinel动态更改了。
Master-Slave切换后,master_redis.conf、slave_redis.conf和sentinel.conf的内容都会发生改变,即master_redis.conf中会多一行slaveof的配置,sentinel.conf的监控目标会随之调换。
备注
群臣俯首:一朝天子一朝臣,换个码头重新拜
执行slaveof no one命令让选出来的从节点成为新的主节点,并通过slaveof命令让其他节点成为其从节点。
sentinel leader会对选举出的新Master执行slaveof no one操作,将其提升为Master节点。
sentinel leader向其他slave发送命令,让剩余的slave成为新的Master节点的slave。