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
b8a28bf4
Commit
b8a28bf4
authored
Mar 04, 2013
by
antirez
Browse files
Cluster: actually setup replication in CLUSTER REPLICATE.
parent
7bead003
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
b8a28bf4
...
@@ -1513,7 +1513,7 @@ void clusterSetMaster(clusterNode *n) {
...
@@ -1513,7 +1513,7 @@ void clusterSetMaster(clusterNode *n) {
myself
->
flags
|=
REDIS_NODE_SLAVE
;
myself
->
flags
|=
REDIS_NODE_SLAVE
;
}
}
myself
->
slaveof
=
n
;
myself
->
slaveof
=
n
;
/* TODO: actually handle replication to point to the new slave. */
replicationSetMaster
(
n
->
ip
,
n
->
port
);
}
}
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
...
@@ -1900,6 +1900,8 @@ void clusterCommand(redisClient *c) {
...
@@ -1900,6 +1900,8 @@ void clusterCommand(redisClient *c) {
/* Set the master. */
/* Set the master. */
clusterSetMaster
(
n
);
clusterSetMaster
(
n
);
clusterUpdateState
();
clusterSaveConfigOrDie
();
addReply
(
c
,
shared
.
ok
);
addReply
(
c
,
shared
.
ok
);
}
else
{
}
else
{
addReplyError
(
c
,
"Wrong CLUSTER subcommand or number of arguments"
);
addReplyError
(
c
,
"Wrong CLUSTER subcommand or number of arguments"
);
...
...
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