From e4a5605c9a7e5b8c425e46b6f12dddefbaff3e73 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 20 Jan 2014 11:10:42 +0100 Subject: [PATCH] Cluster: don't rewrite slaveof config directive in cluster mode. --- src/config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index f344f2d78..d858de690 100644 --- a/src/config.c +++ b/src/config.c @@ -1466,8 +1466,9 @@ void rewriteConfigSlaveofOption(struct rewriteConfigState *state) { sds line; /* If this is a master, we want all the slaveof config options - * in the file to be removed. */ - if (server.masterhost == NULL) { + * in the file to be removed. Note that if this is a cluster instance + * we don't want a slaveof directive inside redis.conf. */ + if (server.cluster_enabled || server.masterhost == NULL) { rewriteConfigMarkAsProcessed(state,"slaveof"); return; }