node-redis
node-redis copied to clipboard
createCluster, port 6279 messing up hostname !!???
Given the code
const cluster = createCluster({
rootNodes: [
{
url: 'redis://redis-1:6379'
},
]
});
I get the following error:
Error: connect ECONNREFUSED 127.0.0.1:6379
The ip refers to localhost
the correct ip for redis-1
should be 10.0.1.34
.
If I change the default port in the code
const cluster = createCluster({
rootNodes: [
{
url: 'redis://redis-1:1000'
},
]
});
i get the error:
Error: connect ECONNREFUSED 10.0.1.34:1000
By changing the port from the default of 6379
to something else the hostname is resolved to the correct ip!?
I'm using client redis version 4.0.0
on node version 16.7
and redis server version 6.2.4
. Everything is build in docker containers.
Same issue here.
See https://github.com/redis/node-redis/issues/2213#issuecomment-1194420312
If it's still an issue feel free to reopen
If it's still an issue feel free to reopen
I met the same error in createClient
. Is there any solution?