-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Will hostnames be supported ? #2186
Comments
Here the feature request is not clear since there is something that may be supported, and something that may be never supported:
However about |
What's the feature's state ? Thx |
@antirez Could you explain more about 'However about 2 note that Redis Cluster is able to detect addresses switches of nodes and auto-reconfigure' and how if all nodes in the cluster have new addresses, how this would be communicated to the other nodes. The problem I see is that while any particular node can examine its nodes.conf file and detect the change, the ip addresses of the other nodes in the nodes.conf file are invalid and communicating with them will fail. Is there some other underlying mechanism for walking the network to detect other cluster nodes on it and check to see if any of them (based upon their id) have changed? |
@allanwax It won't work if all of them change their address, exactly because then no node knows how to reach another node. But it works if one node changes its address and connects to an existing node. |
@antirez time is going forward and world is changing so I just wanted to check that is this still the case or would it be possible finally get hostnames support to Redis?
I'm trying to make Redis Cluster working on Docker Swarm. Initial connection actually works already using hostnames (or Docker service names actually) but then Redis will update IP addresses to config files. I really would like to avoid setting up static IPs for these containers. |
@olljanat You can use the announce-ip option and supply the Virtual IP of the service |
Use a bash script to perform a lookup on the hostname and then once it resovles, launch redis. Beware though that sometimes the hostname will not resolve right away you should do this in a sleep loop. Example:
|
@drnybble Thanks for your answer. And i have another question. I have tried to run redis cluster (3 masters and 3 slaves ,as 6 service ) on docker swarm using the VIP of service and everything goes well. When i stop one node of the redis cluster , swarm will start a new instance of service automaticlly. But i still have to use the command |
@martin-wong This seems like odd behavior but I'm not an docker guy, I run on bar metal. What is supposed to happen is that you set up a cluster using You shouldn't have to add-node since its already there. Possibly the cluster was not set up properly. Easy check |
That is good tip and actually I noticed that it actually works now with service names too. Redis Sentinel updates service IPs to configs but as they are static as long they exists you don't need fill them manually. |
/cc @artix75 |
need this feature for cluster in docker swarm (without it only dirty haks allow to make cluster) |
same for Kubernetes cluster. Doing manual step for retrieving IP's for pods is no-go in cloud automated setup. It is 2020 , resolving hostname shouldn't be functionality that need 6 years to develop... |
any updates on this? adding cluster nodes by hostnames would enable so that clients can connect via the same hostname. |
Cc'ing @yossigo as he's fond of hostnames :) |
@dmitrypol Are people asking for hostnames in cluster mode, or specifically for redis-trib? |
@madolson - the use case I am thinking of is when users want to connect to nodes via FQDN / hostnames. It would be nice if redis-cluster replied with the hostnames in node map so that client can make connection that way. |
Related to this: #8134 Which is that we want to expose the hostnames in cluster slots for TLS, for hostname validation, but I don't see a reason why we couldn't do that. @dmitrypol Do you actually use the cluster nodes command, or the recommend cluster slots? We were originally not going to update cluster nodes. I intend to follow up with this in the next 1-2 weeks, after I finish my current thing. |
Ideally it would be nice to have full class support for hostnames in all aspects of Redis Cluster. |
It is still not supported... 😹 @liuchong |
It is still not supported... 😹 |
This a draft PR up now with a proposal, anyone waiting on that feature, would appreciate you taking a look to provide input. |
It work with the redis 7 rc3 -> redis:7.0-rc3-bullseye
|
I see "Hostnames are not supported. IPs only." in Redis-trib by using hostnames fails to join cluster #2071, I want to know if hostnames will be supported?
Sometime the IPs are not the best way.
The text was updated successfully, but these errors were encountered: