Merge pull request #1567 from mattsta/fix-cluster-join

Bind source address for cluster communication
This commit is contained in:
Salvatore Sanfilippo
2014-03-10 10:28:32 +01:00
3 changed files with 37 additions and 7 deletions

View File

@ -2407,9 +2407,14 @@ void clusterCron(void) {
mstime_t old_ping_sent;
clusterLink *link;
fd = anetTcpNonBlockConnect(server.neterr, node->ip,
node->port+REDIS_CLUSTER_PORT_INCR);
if (fd == -1) continue;
fd = anetTcpNonBlockBindConnect(server.neterr, node->ip,
node->port+REDIS_CLUSTER_PORT_INCR, server.bindaddr[0]);
if (fd == -1) {
redisLog(REDIS_DEBUG, "Unable to connect to "
"Cluster Client [%s]:%d", node->ip,
node->port+REDIS_CLUSTER_PORT_INCR);
continue;
}
link = createClusterLink(node);
link->fd = fd;
node->link = link;