I have 3 VPS using for making HA Redis cluster.
I use my Redis cluster in my web server (in another server, and a lot of server with CLI application) and I need to have constant availability of my Redis server.
That's why I took 3 VPS that are dedicated to running a Redis server and Sentinel server. A master and two slaves as here:
Here is the configuration of my first VPS (for the master) :
redis.conf :
daemonize yes
port 6379
bind 127.0.0.1 167.114.224.11
timeout 0
tcp-keepalive 0
loglevel notice
logfile /var/log/redis/redis-server.log
databases 16
sentinel.conf :
daemonize yes
logfile /var/log/redis/redis-sentinel.log
port 26379
bind 167.114.224.11
sentinel monitor mymaster 127.0.0.1 6379 1
sentinel down-after-milliseconds mymaster 30000
sentinel parallel-syncs mymaster 2
And here is the configuration for the 2 slaves (I just show you for the first slave because it's same except the bind public IP) :
redis.conf :
daemonize yes
port 6379
bind 127.0.0.1 167.114.224.12
timeout 0
tcp-keepalive 0
loglevel notice
logfile /var/log/redis/redis-server.log
databases 16
slaveof 167.114.224.11 6379
slave-serve-stale-data yes
slave-read-only yes
repl-disable-tcp-nodelay no
slave-priority 100
sentinel.conf :
daemonize yes
logfile /var/log/redis/redis-sentinel.log
port 26379
bind 167.114.224.12
sentinel monitor mymaster 127.0.0.1 6379 1
sentinel down-after-milliseconds mymaster 30000
sentinel parallel-syncs mymaster 2
When I try to launch the redis server and sentinel to the first and second VPS it's go wrong :
[2881] 10 Apr 21:20:27.640 * Max number of open files set to 10032
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 2.8.4 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in sentinel mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 26379
| `-._ `._ / _.-' | PID: 2881
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[2881] 10 Apr 21:20:27.643 # Sentinel runid is 254235256f60ed479e1991e21e52b36e4ee77ad6
[2881] 10 Apr 21:20:35.324 * -dup-sentinel master mymaster 127.0.0.1 6379 #duplicate of 127.0.0.1:26379 or f051b1d998a63bd0fc8de9ac46129aae05962025
[2881] 10 Apr 21:20:35.325 * +sentinel sentinel 127.0.0.1:26379 127.0.0.1 26379 @ mymaster 127.0.0.1 6379
And in my second VPS (with the slave redis server) I got that:
[31017] 10 Apr 21:20:33.275 * Max number of open files set to 10032
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 2.8.4 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in sentinel mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 26379
| `-._ `._ / _.-' | PID: 31017
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[31017] 10 Apr 21:20:33.277 # Sentinel runid is f051b1d998a63bd0fc8de9ac46129aae05962025
[31017] 10 Apr 21:20:34.321 * +sentinel sentinel 167.114.224.11:26379 167.114.224.11 26379 @ mymaster 127.0.0.1 6379
[31017] 10 Apr 21:20:36.054 * -dup-sentinel master mymaster 127.0.0.1 6379 #duplicate of 127.0.0.1:26379 or 254235256f60ed479e1991e21e52b36e4ee77ad6
[31017] 10 Apr 21:20:36.054 * +sentinel sentinel 127.0.0.1:26379 127.0.0.1 26379 @ mymaster 127.0.0.1 6379
[31017] 10 Apr 21:20:36.453 * -dup-sentinel master mymaster 127.0.0.1 6379 #duplicate of 167.114.224.11:26379 or 254235256f60ed479e1991e21e52b36e4ee77ad6
[31017] 10 Apr 21:20:36.454 * +sentinel sentinel 167.114.224.11:26379 167.114.224.11 26379 @ mymaster 127.0.0.1 6379
[31017] 10 Apr 21:20:38.125 * -dup-sentinel master mymaster 127.0.0.1 6379 #duplicate of 127.0.0.1:26379 or 254235256f60ed479e1991e21e52b36e4ee77ad6
[31017] 10 Apr 21:20:38.125 * +sentinel sentinel 127.0.0.1:26379 127.0.0.1 26379 @ mymaster 127.0.0.1 6379
And this continues to the infinite and flood me.
Any idea ? Thank's you in advance !