-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature request for supporting connecting to individual nodes with hostname in cluster mode #2791
Comments
Ultimately we're always going to be connecting by IP, but if the point here is that we should use the announced IP or the IP we get after a DNS check, rather than the IP address reported by |
^ yes. I feel the rules should be, if hostname is present in cluster nodes output then use the hostname. Perform the DNS check and connect via IP. This is the behavior I'm seeing with other Redis clients (lettuce, jedis etc.,) |
Context:
Starting from redis 7.x. two new properties cluster-preferred-endpoint-type and cluster-announce-hostname properties have been added. When cluster-preferred-endpoint-type is set to hostname, Moved and Ask responses contain the hostnames.
When cluster-announce-hostname is set, cluster nodes outputs the hostname along with the Ip. https://redis.io/docs/latest/commands/cluster-nodes/
cluster nodes output:
07c37dfeb235213a872192d90877d0cd55635b91 127.0.0.1:30004@31004,hostname4 slave e7d1eecce10fd6bb5eb35b9f99a514335d9ba9ca 0 1426238317239 4 connected
Problem:
When the nodes in the cluster have announced hostnames. StackExchange.Redis should parse the hostnames instead of IPs from cluster nodes output and connect to the nodes via hostnames.
By default, StackExchange.Redis runs cluster nodes and uses the IPs to make connections to the individual nodes. This integration will not work when the nodes are behind a proxy/NAT gateway, thus, we are expecting that when cluster-preferred-endpoint-type is set to hostname, on moving and connecting to a different node StackExchange.Redis will use hostname instead of IP.
Solution:
Suggesting StackExchange.Redis to make connections via hostnames if available and default to IPs if not present
The text was updated successfully, but these errors were encountered: