mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
Sentinel: bind source address
Some deployments need traffic sent from a specific address. This change uses the same policy as Cluster where the first listed bindaddr becomes the source address for outgoing Sentinel communication. Fixes #1667
This commit is contained in:
parent
d830dcb12d
commit
5cd83ef539
@ -1676,7 +1676,7 @@ void sentinelReconnectInstance(sentinelRedisInstance *ri) {
|
||||
|
||||
/* Commands connection. */
|
||||
if (ri->cc == NULL) {
|
||||
ri->cc = redisAsyncConnect(ri->addr->ip,ri->addr->port);
|
||||
ri->cc = redisAsyncConnectBind(ri->addr->ip,ri->addr->port,REDIS_BIND_ADDR);
|
||||
if (ri->cc->err) {
|
||||
sentinelEvent(REDIS_DEBUG,"-cmd-link-reconnection",ri,"%@ #%s",
|
||||
ri->cc->errstr);
|
||||
@ -1698,7 +1698,7 @@ void sentinelReconnectInstance(sentinelRedisInstance *ri) {
|
||||
}
|
||||
/* Pub / Sub */
|
||||
if ((ri->flags & (SRI_MASTER|SRI_SLAVE)) && ri->pc == NULL) {
|
||||
ri->pc = redisAsyncConnect(ri->addr->ip,ri->addr->port);
|
||||
ri->pc = redisAsyncConnectBind(ri->addr->ip,ri->addr->port,REDIS_BIND_ADDR);
|
||||
if (ri->pc->err) {
|
||||
sentinelEvent(REDIS_DEBUG,"-pubsub-link-reconnection",ri,"%@ #%s",
|
||||
ri->pc->errstr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user