Skip to content
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

Redis-trib by using hostnames fails to join cluster #2071

Closed
andrepintorj opened this issue Oct 15, 2014 · 3 comments
Closed

Redis-trib by using hostnames fails to join cluster #2071

andrepintorj opened this issue Oct 15, 2014 · 3 comments

Comments

@andrepintorj
Copy link

I was trying to setup a redis cluster by using hostnames instead of ip addresses as follows:

[root@poll-a bin]# ./redis-trib.rb create poll-a.mycompany.com:7000 poll-b.mycompany.com:7000 poll-c.mycompany.com:7000

Creating cluster
Connecting to node poll-a.mycompany.com:7000: OK
Connecting to node poll-b.mycompany.com:7000: OK
Connecting to node poll-c.mycompany.com:7000: OK
Performing hash slots allocation on 3 nodes...
Using 3 masters:
poll-a.mycompany.com:7000
poll-b.mycompany.com:7000
poll-c.mycompany.com:7000
M: 095321f50fd225c1834bc9b319f6dc8ea92583fd poll-a.mycompany.com:7000
slots:0-5460 (5461 slots) master
M: 0e694d3eff8c70d2076f00f11d8b6bef4aeb94f0 poll-b.mycompany.com:7000
slots:5461-10922 (5462 slots) master
M: 2758cf90c9141cb647fdff20aabf829e63504700 poll-c.mycompany.com:7000
slots:10923-16383 (5461 slots) master
Can I set the above configuration? (type 'yes' to accept): yes
Nodes configuration updated
Assign a different config epoch to each node
Sending CLUSTER MEET messages to join the cluster
/usr/local/rvm/gems/ruby-2.1.0/gems/redis-3.1.0/lib/redis/client.rb:103:in call': ERR Invalid node address specified: poll-a.mycompany.com:7000 (Redis::CommandError) from /usr/local/rvm/gems/ruby-2.1.0/gems/redis-3.1.0/lib/redis.rb:2486:inblock in method_missing'
from /usr/local/rvm/gems/ruby-2.1.0/gems/redis-3.1.0/lib/redis.rb:37:in block in synchronize' from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:inmon_synchronize'
from /usr/local/rvm/gems/ruby-2.1.0/gems/redis-3.1.0/lib/redis.rb:37:in synchronize' from /usr/local/rvm/gems/ruby-2.1.0/gems/redis-3.1.0/lib/redis.rb:2485:inmethod_missing'
from ./redis-trib.rb:664:in block in join_cluster' from ./redis-trib.rb:662:ineach'
from ./redis-trib.rb:662:in join_cluster' from ./redis-trib.rb:974:increate_cluster_cmd'
from ./redis-trib.rb:1345:in `

'

Interesting to see is that it performs the node configuration and finds/connects to the hosts, but then while sending cluster MEET messages, it throws an error as shown above.

If I do exactly the same commands by using IP addresses it works flawlessly:

[root@poll-a bin]# ./redis-trib.rb create 10.0.2.101:7000 10.0.2.104:7000 10.0.2.224:7000

Creating cluster
Connecting to node 10.0.2.101:7000: OK
Connecting to node 10.0.2.104:7000: OK
Connecting to node 10.0.2.224:7000: OK
Performing hash slots allocation on 3 nodes...
Using 3 masters:
10.0.2.101:7000
10.0.2.104:7000
10.0.2.224:7000
M: 5bd2e31fef497f019ba440509ba34b264b233b7b 10.0.2.101:7000
slots:0-5460 (5461 slots) master
M: db67c6ed7b58a251b7ca6a6699d3ddfde9178182 10.0.2.104:7000
slots:5461-10922 (5462 slots) master
M: 50e3ce57a9b211c44df9aba561810b60e6e2e833 10.0.2.224:7000
slots:10923-16383 (5461 slots) master
Can I set the above configuration? (type 'yes' to accept): yes
Nodes configuration updated
Assign a different config epoch to each node
Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join....
Performing Cluster Check (using node 10.0.2.101:7000)
M: 5bd2e31fef497f019ba440509ba34b264b233b7b 10.0.2.101:7000
slots:0-5460 (5461 slots) master
M: db67c6ed7b58a251b7ca6a6699d3ddfde9178182 10.0.2.104:7000
slots:5461-10922 (5462 slots) master
M: 50e3ce57a9b211c44df9aba561810b60e6e2e833 10.0.2.224:7000
slots:10923-16383 (5461 slots) master
[OK] All nodes agree about slots configuration.
Check for open slots...
Check slots coverage...
[OK] All 16384 slots covered.

@mattsta
Copy link
Contributor

mattsta commented Oct 15, 2014

Correct! Hostnames are not supported. IPs only.

@mcpherson
Copy link

I stumbled across this too. Easy enough to fix, but why no host names?

@badboy
Copy link
Contributor

badboy commented Jun 9, 2015

Well, #2323 is there...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants