Clint Carpenter Clint Carpenter - 1 month ago 11
Linux Question

Cannot create redis cluster (Sorry, can't connect to node)

I'm trying to follow the redis cluster tutorial but whenever I try to run:

./redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 \
127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005`


I get the error:


[ERR] Sorry, can't connect to node 127.0.0.1:7000


The server is running and I can connect to port
7000
using

redis-cli -p 7000


What am I missing?

Answer

Turns out I had REDIS_URL set in .bashrc from a previous project. Apparently the redis gem was setting the password from that url for ALL redis connections (even though I was not using the url for my cluster).

Thanks to soveran for pointing out this posibility in this question

Comments