I have the following Redis/Sentinel configuration:
- Redis master
A
+N
slaves M
sentinels watchingA
, namedmasterA
- the client application query the sentinels for
masterA
, then query and modifyA
Now say A
is outdated and I want to replace it by a new Redis master called B
(with minimum down time / data loss.). In the end of the operation, I want this:
- Redis master
B
+N
slaves - the client application querying and modifying
B
I could proceed as follows:
- Have the sentinels start watching
B
, namedmasterB
- Have each slave of
A
become a slave ofB
From there, I am stuck because the client application still asks for masterA
when talking to the sentinels. I have two questions:
- Is there a way to switch masters names, such that
B
becomes known asmasterA
for the sentinels, and therefore for the client application as well? - Is it better to modify the client application code to handle the switch from an old master to a new master?