From 60f346889baddb5a89c9a9b9d0f0bce76c5add83 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 22 Jan 2016 16:53:15 +0100 Subject: [PATCH] Cluster announce port: set port/bport for myself at startup. --- src/cluster.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index bc0233f3c..20cca743b 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -474,9 +474,14 @@ void clusterInit(void) { /* The slots -> keys map is a sorted set. Init it. */ server.cluster->slots_to_keys = zslCreate(); - /* Set myself->port to my listening port, we'll just need to discover - * the IP address via MEET messages. */ + /* Set myself->port / cport to my listening ports, we'll just need to + * discover the IP address via MEET messages. */ myself->port = server.port; + myself->cport = server.port+CLUSTER_PORT_INCR; + if (server.cluster_announce_port) + myself->port = server.cluster_announce_port; + if (server.cluster_announce_bus_port) + myself->cport = server.cluster_announce_bus_port; server.cluster->mf_end = 0; resetManualFailover();