I started to work on redis with master slave set up. Master and slave is set in same machine with different port. For handling Master/slave fail over, seems redis had sentinel. I am trying to implement the sentinel.
My redis.conf for Master:
bind 127.0.0.1(local Machine)
Port 6379
My redis1.conf for Slave:
bind 127.0.0.1
port 6380
slaveof 127.0.0.1 6379
My sentinel.conf has:
sentinel monitor mymaster 127.0.0.1 6379 1
sentinel down-after-milliseconds mymaster 30000
sentinel failover-timeout mymaster 180000
sentinel parallel-syncs mymaster 1
sentinel monitor resque 127.0.0.1 6380 1
sentinel down-after-milliseconds resque 10000
sentinel failover-timeout resque 180000
sentinel parallel-syncs resque 5
I am using https://www.npmjs.org/package/redis-sentinel-client for sentinel client.
Only one sentinel.conf file I am using for both master and slave. I ran both servers and checked by kill the master server. Slave become master as expected. From http://redis.io/topics/sentinel-old, under Resurrecting master section it is mentioned that the master which goes down will be added as slave of new elected master. But when I bring my master down, slave become master. But old master is still not slave of the new one. Is it the right way of using sentinel..?
Any suggestions to find how sentinel can be used to handle failover.? Or any other sentinel-client package for node..?