DeNA/redis — pull request #6 by hirose31 (2013-07-02 06:38:51+00:00)
Title: Call bind(2) before connect(2) if exists bind ADDR in redis.conf

@Sylvain-Royer I will merge this pull request tomorrow so if any, could you give me any comments?

---

Redis master recognizes slave's IP address by getpeername(2) so that address becomes an address assigned slave's eth0 even if IP aliased (eth0:1) in slave linux box and ```bind ``` in redis.conf and that address is not local address (127.0.0.0/8).

Could you give me any advice?

```
Redis master:
IP address:
eth0: 10.0.0.100

Redis slave:
IP address:
eth0: 10.0.0.200
eth0:1: 10.0.0.201
redis.conf:
bind 10.0.0.201

Redis sentinel:
IP address:
eth0: 10.0.0.50
sentinel.conf:
sentinel monitor mymaster 10.0.0.100 6379 1

$ redis-cli -h 10.0.0.201 slaveof 10.0.0.100 6379

$ redis-cli -h 10.0.0.100 info | grep slave
slave0:10.0.0.200,6379,online # not 10.0.0.201

$ redis-cli -h 10.0.0.50 sentinel slaves mymaster | grep -A1 ip
ip
10.0.0.200 # not 10.0.0.201

```