0

I'm testing redis failover with this simple setup:

3 Ubuntu server 16.04
redis and redis-sentinel are configured on each box.

Master ip : 192.168.0.18
Resque ip : 192.168.0.16
Resque2 ip : 192.168.0.13

Data replication works well but I can't get failover to work. When I start redis-sentinel I always get a +sdown message after 60 seconds:

14913:X 17 Jul 10:40:03.505 # +monitor master mymaster 192.168.0.18 6379 quorum 2
14913:X 17 Jul 10:41:03.525 # +sdown master mymaster 192.168.0.18 6379

this is the configuration file for redis-sentinel:

bind 192.168.0.18
port 16379
sentinel monitor mymaster 192.168.0.18 6379 2
sentinel down-after-milliseconds mymaster 60000
sentinel failover-timeout mymaster 6000
loglevel verbose
logfile "/var/log/redis/sentinel.log"
repl-ping-slave-period 5
slave-serve-stale-data no
repl-backlog-size 8mb
min-slaves-to-write 1
min-slaves-max-lag 10

the bind directive uses the proper IP for each box.

I followed the redis tutorial here: https://redis.io/topics/sentinel but I can't get the failover to work.

Redis server version : 3.2.9

Shubham
  • 2,847
  • 4
  • 24
  • 37
Valentino
  • 59
  • 1
  • 11

1 Answers1

1

The issue is all about how redis-sentinel works because sentinel can not handle password protected redis-server.

In your redis-server configuration file (/etc/redis/redis.conf) do not use "requirepass" directive if you want to use redis-sentinel.

Valentino
  • 59
  • 1
  • 11
  • I am not using requirepass, and having the same issue. Data replication works wells, but not failover. redis_version: 4.0.10 on 3 FreeBSD 11.1-RELEASE with redis and redis-sentinel are configured on each box. Any thoughts? – mjm Jul 25 '18 at 10:08
  • `redis-sentinel` can work with password protected `redis-server`. We can use `sentinel auth-pass ` – Shubham Nov 20 '18 at 11:25