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