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
Is it possible doing this without restarting the redis service? (and losing all the cached data)
yes that's possible, you can use
SLAVEOF NO ONE
(without sentinel)
But it is recommended to use sentinel to avoid data loss.
sentinel failover master-name
(with sentinel)
This will force the sentinel to switch master.
The new master will have all the data that was synchronized before the old-master shutdown.
Redis will automatically choose the best slave with max. data, that will reduce the amount of data we lose when switching master.