Hello Team ,
We are in the process of migrating from Redis 5.0.5 version to Redis 7.0.6 version in production.
We had an observation while qualifying Redis new version that our Sentinel docker container was not coming up with our original configuration unless we introduced the following setting in sentinel.conf
sentinel resolve-hostnames yes
After going through Redis documentation we got to know initially the nodes were resolved using ip address which is now replaced by hostnames (which is an optional feature)
- Wanted to know if this is an optional feature , why the container is not coming up with the pre existing configuration ?
- Why the default ip address resolution is not working with the new version of Redis?
- Do we have to explicitly use sentinel resolve-hostnames yes with the new version of Redis?
- Do we also need to use sentinel announce-hostnames yes also with this ?
- Is there any side impact of using the above configurations on the sentinel health ?
Please address the above questions.
Best Regards, Apoorv
Comment From: moticless
We had an observation while qualifying Redis new version that our Sentinel docker container was not coming up with our original configuration unless we introduced the following setting in sentinel.conf
Default configuration is not to resolve-hostnames. I expect that your last configuration should work.
Wanted to know if this is an optional feature , why the container is not coming up with the pre existing configuration ?
I am sorry but this is out of the scope question.
Why the default ip address resolution is not working with the new version of Redis?
It should work. If you find otherwise, please supply full details to try reproduce the issue.
Do we have to explicitly use sentinel resolve-hostnames yes with the new version of Redis?
No
Do we also need to use sentinel announce-hostnames yes also with this ?
Quote from file redis.conf: "When resolve-hostnames is enabled, Sentinel still uses IP addresses when exposing instances to users, configuration files, etc. If you want to retain the hostnames when announced, enable announce-hostnames."
Please see the following examples of different sentinel network layout support. It might make more sense to you.
Moti
Comment From: iav20
Hi @moticless
I am attaching the sentinel and redis files from our old Redis deployment and new Redis Deployment
And have found in older version IP address is replaced in the monitor command while in new version hostname is replaced
Older version : sentinel monitor keng03-dev01-ins01-dmc77-app-1.int.dev.mykronos.com 10.3.35.125 6379 2 New Version : sentinel monitor keng03-dev01-ins01-dmc53-app-1.int.dev.mykronos.com keng03-dev01-ins01-dmc53-app-1672309483-1.int.dev.mykronos.com 6379 2
Our automation scripts/deployment scripts are by default always using the hostname but in older version some how it is replaced with IP address.
Please advise.
Best Regards, [Apoorv] old_version_files.zip New_version_files.zip
Comment From: moticless
@iav20 ,
you have few issues with your configuration:
- Redundant repitition of configuration (lookup: announce-ip & announce-port)
- Your base configuration shouldn't include data which is generated and maintained by sentinel during runtime and is appended to the configuration file for persistency (lookup : sentinel config-epoch mymaster 0 or sentinel myid). It is not part of user configuration.
- You need to decide first whether you are working with static IP, port forwarding (useannounce-ip) or hostnames based (announce-ip & announce-hostnames). I see a mixture. Please assist following examples.