Cluster node is automatically disconnected when it has no slots
See original GitHub issueI tried this code and I only see any logs in the then
or catch
logger.debug('%s MEET Sending: %s', id, cmd);
// Tried also redis.cluster('meet', ip, port).then ...
redis.cluster(['meet', ip, port]).then((response) => {
logger.info('%s MEET %s', id, response);
return response;
}).catch((err) => {
logger.error(err, '%s Cannot MEET', id);
return {error: true};
});
It would be nice to have some examples too.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Redis cluster node with status DISCONNECTED - FatDBA
Cluster check command is showing details only for three healthy masters and throwing error at the end of the check '[ERR] Not all...
Read more >Installing Redis Cluster (cluster mode enabled) with auto failover
The cluster-replicas 1 means one slave node for each master. The output of this command will look something like this: >>> Performing hash...
Read more >postgresql - Patroni : How to handle a replica which has been ...
In this case I think the size of WAL on the primary will keep on growing as it is not being consumed by...
Read more >Known issues with Storage Replica | Microsoft Learn
This issue occurs when you create a VSS snapshot of the log volume. The underlying cause is a legacy design aspect of VSS,...
Read more >Scaling with Redis Cluster
Moving hash slots from a node to another does not require stopping any ... a Redis Cluster node automatically persists the cluster configuration...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, the behavior is expected. When there’s no slots (or no cluster nodes), ioredis will reconnect to cluster in order to connect to the new nodes once the cluster has been set up.
ioredis is able to discover new node automatically, so you can just provide some of the nodes in the cluster instead of providing all of them.
The root reason of that is because ioredis doesn’t know where the commands should be sent to when
CLUSTER SLOTS
returns[]
since it relies onCLUSTER SLOTS
command to know which nodes are in the cluster.That’s a good question. This issue happens basically because
Cluster
class is designed to work with a cluster that already set. You can useRedis
class to send theMEET
or any commands to setup the cluster (and since you already know the IPs of the target node, so this way should be pretty straightforward).The problem seems to be here: https://github.com/luin/ioredis/blob/master/lib/cluster/ConnectionPool.ts#L126 Any reason why if there are no slots,
ioredis
automatically disconnect? Can this behavior at least be optional ?