Redis - Promoting a slave to master manually

2019-04-30 10:58发布

问题:

Suppose I have [Slave IP Address] which is the slave of [Master IP Address].

Now my master server has been shut down, and I need to set this slave to be master MANUALLY (WITHOUT using sentinel automatic failover, WITH redis command).

Is it possible doing this without restarting the redis service ? (and losing all the cached data)

回答1:

use SLAVEOF NO ONE to promote a slave to master

http://redis.io/commands/slaveof



回答2:

it depends, if you are in a cluster you will be better using the fail over. You will need to use the force option in the command

http://redis.io/commands/cluster-failover



标签: redis