0

I had done an automation of deploying redis-sentinel cluster via ansible but there is one catch that I am struggling to fix.

We use our internal data center in which there is a high chance of getting the same IP address after destroying the existing machine and recreating a new one.

So let's say I had a redis machine with IP 10.0.0.1 monitored by sentinel X. It was destroyed later for some reason for not being used and when a machine was recreated for let's say some other application x it has a high chance of getting that old IP address so the sentinel will add it as a monitoring machine which is causing problems. I don't want to use SENTINEL RESET because if the master was really down at that time then it will be removed from its monitoring.

Is there some way I can apply to achieve not attaching the wrong application to the redis sentinel cluster?

redis sentinel starts monitoring machine which gets recreated with the same IP address used earlier as part of redis sentinel cluster

Shubham Saroj
  • 290
  • 2
  • 12

1 Answers1

0

It was destroyed later for some reason for not being used

In this case, you should call SENTINEL REMOVE master-name to remove the master from the monitor list.

for_stack
  • 21,012
  • 4
  • 35
  • 48
  • In my case we have 100s of clusters which consists of 3 nodes redis slave and 3 nodes for sentinel each per cluster. How will I be able to identify that the IP which we will get back will belong to which sentinel? – Shubham Saroj Feb 28 '23 at 06:16