I'm running replicated Redis that includes a master and just one slave. My goal is to implement a replication (using Redis sentinels) in which the slave becomes master when the master goes down, but additionally the old master is promoted back when it recovers.
The initial setup is easy. I'm using one sentinel on the same server as master and two sentinels on the server with slave. With quorum of two, the two sentinels on slave server promote the slave to master when the master is unavailable. When the old master comes back, it reconnects to old slave (which has been promoted master) and becomes its slave.
After that, business as usual. Except I would like to promote the slave (old master) to master the way it was in the original layout. This can be done manually with redis-cli (and consequently with cron, I think), but are there any means to do it with sentinel configuration or some other method other than brute cronjob? My intention is basically to have a static master that's backed up by slave, which returns master status once the original master is available again.