Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
fda4cba9
Commit
fda4cba9
authored
Dec 20, 2013
by
antirez
Browse files
Redis Cluster: reconfigure replication when master changes address.
parent
d7374032
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
fda4cba9
...
@@ -986,6 +986,14 @@ int nodeUpdateAddressIfNeeded(clusterNode *node, clusterLink *link, int port) {
...
@@ -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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment