You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Connecting to a cluster is a bit different. Create the client by specifying some (or all) of the nodes in your cluster and then use it like a regular client instance:
import { createCluster } from 'redis';
const cluster = createCluster({
rootNodes: [
{
url: 'redis://10.0.0.1:30001'
},
{
url: 'redis://10.0.0.2:30002'
}
]
});
cluster.on('error', (err) => console.log('Redis Cluster Error', err));
await cluster.connect();
await cluster.set('key', 'value');
const value = await cluster.get('key');
Is it possible to do that ? If not, is it possible to add support for this in the lib?
The text was updated successfully, but these errors were encountered:
Since this package is a wraper for node-redis is it possible to config a module in cluster mode?
The node-redis docs have this example:
Is it possible to do that ? If not, is it possible to add support for this in the lib?
The text was updated successfully, but these errors were encountered: