提交 fda4cba9 编写于 作者: A antirez

Redis Cluster: reconfigure replication when master changes address.

上级 d7374032
......@@ -986,6 +986,14 @@ int nodeUpdateAddressIfNeeded(clusterNode *node, clusterLink *link, int port) {
if (node->link) freeClusterLink(node->link);
redisLog(REDIS_WARNING,"Address updated for node %.40s, now %s:%d",
node->name, node->ip, node->port);
/* Check if this is our master and we have to change the
* replication target as well. */
if (server.cluster->myself->flags & REDIS_NODE_SLAVE &&
server.cluster->myself->slaveof == node)
{
replicationSetMaster(node->ip, node->port);
}
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册