网站首页
Java
站长
开源
框架
理论
JS
Linux
DB
服务器
网络编程
生活
软件
PHP
其他
回复Java小强

This command, that can only be sent to a Redis Cluster replica node, forces the replica to start a manual failover of its master instance. A manual failover is a special kind of failover that is usually executed when there are no actual failures, but we wish to swap the current master with one of its replicas (which is the node we send the command to), in a safe way, without any window for data loss. It works in the following way: The replica tells the master to stop processing queries from clients. The master replies to the replica with the current replication offset. The replica waits for the replication offset to match on its side, to make sure it processed all the data from the master before it continues. The replica starts a failover, obtains a new configuration epoch from the majority of the masters, and broadcasts the new configuration. The old master receives the configuration update: unblocks its clients and starts replying with redirection messages so that they'll continue the chat with the new master. This way clients are moved away from the old master to the new master atomically and only when the replica that is turning into the new master has processed all of the replication stream from the old master.

您的网名:
个人主页:
编辑内容: