Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis - Promoting a slave to master manually

Tags:

redis

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)

like image 807
ohadinho Avatar asked Dec 08 '15 12:12

ohadinho


People also ask

How does Redis master slave work?

The Redis replication uses an asynchronous method to transfer data from master to slave. The slave periodically acknowledges the received data sent by the master node, and also the master node can have many slaves. Redis can support cascading replication, so the slave can be connected to another slave.

How do I run Redis in sentinel mode?

Launch Sentinel To restart the Redis service, run this command: sudo service redis restart . To start Redis in Sentinel mode, run redis-server /etc/redis/sentinel. conf –sentinel .

How does Redis failover work?

Automatic Failover A Redis Enterprise cluster provides fault tolerance and resilience. In the case of a primary server or node outage, Redis Enterprise's self-healing process automatically detects the hardware failure, elects a replica as a replacement, and promotes that replica to become the new primary server.


Video Answer


1 Answers

use SLAVEOF NO ONE to promote a slave to master

http://redis.io/commands/slaveof

like image 50
nnog Avatar answered Sep 24 '22 08:09

nnog