mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 23:31:03 +00:00
Redis Cluster: reconfigure replication when master changes address.
This commit is contained in:
parent
d7374032c0
commit
fda4cba912
@ -986,6 +986,14 @@ int nodeUpdateAddressIfNeeded(clusterNode *node, clusterLink *link, int port) {
|
|||||||
if (node->link) freeClusterLink(node->link);
|
if (node->link) freeClusterLink(node->link);
|
||||||
redisLog(REDIS_WARNING,"Address updated for node %.40s, now %s:%d",
|
redisLog(REDIS_WARNING,"Address updated for node %.40s, now %s:%d",
|
||||||
node->name, node->ip, node->port);
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user