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
1c038379
Commit
1c038379
authored
Jan 22, 2016
by
antirez
Browse files
Cluster: persist bus port in nodes.conf.
parent
dc98907e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
1c038379
...
...
@@ -168,7 +168,12 @@ int clusterLoadConfig(char *filename) {
if
((
p
=
strrchr
(
argv
[
1
],
':'
))
==
NULL
)
goto
fmterr
;
*
p
=
'\0'
;
memcpy
(
n
->
ip
,
argv
[
1
],
strlen
(
argv
[
1
])
+
1
);
char
*
busp
=
strchr
(
p
+
1
,
':'
);
if
(
busp
)
*
busp
=
'\0'
;
n
->
port
=
atoi
(
p
+
1
);
/* In older versions of nodes.conf the bus port is missing. In this case
* we set it to the default offset of 10000 from the base port. */
n
->
cport
=
busp
?
atoi
(
busp
+
1
)
:
n
->
port
+
CLUSTER_PORT_INCR
;
/* Parse flags */
p
=
s
=
argv
[
2
];
...
...
@@ -3731,10 +3736,11 @@ sds clusterGenNodeDescription(clusterNode *node) {
sds
ci
;
/* Node coordinates */
ci
=
sdscatprintf
(
sdsempty
(),
"%.40s %s:%d "
,
ci
=
sdscatprintf
(
sdsempty
(),
"%.40s %s:%d
:%d
"
,
node
->
name
,
node
->
ip
,
node
->
port
);
node
->
port
,
node
->
cport
);
/* Flags */
ci
=
representClusterNodeFlags
(
ci
,
node
->
flags
);
...
...
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