redis-failsafe-client
A redis client for redis clusters, which recovers in case of cluster failover or rehashing.
Install
npm install redis-failsafe-client
Basic usage
var redis = ; var client = host: 'localhost' port: 7001 host: 'localhost' port: 7002 host: 'localhost' port: 7003 host: 'localhost' port: 7004; { client; client;} client;
RedisCluster constructor parameters expect a list of initial endpoints, which is used only to meet with cluster. It will uses the first host it can connect to, to bootstrap the cluster, the initial endpoints will no longer be used during the lifetime of the client. It is not tested by the bootstrap, whether the hosts in the parameter array belong to the same cluster. All redis command
Short term improvements
- Error handling:
- implementing ASK asking in case of migration between cluster nodes
- implementing MOVED handling by refreshing the cluster information
- CLUSTERDOWN is sometimes reported by only a specific server node, which has a broken migration on importing side (i.e. the node has started an importing on slot(s), but the owner node has went through a failover), It can be recovered, by this client, but I think it will just report it, and leave to the administrator to heal the migration.
- Fixes:
- commands, which are not slot affine, gets no connection yet. After the fix they will get a connection in round robin manner, from the opened cluster node connections.
- making command queue throttling configurable