As the title states, when using the ioredis
link redis
’s sentinel is reporting an error All sentinels are unreachable
, the code example is as follows:
const Redis = require('ioredis');
let redis = new Redis({
sentinels: [
{ host: 'XXX', port: XX },
{ host: 'XXX', port: XX },
{ host: 'XX', port: XX },
],
name: 'mymaster',
connectTimeout: 1000,
});
redis.select(1);
// console.log(redis);
redis.set('foo', 'hello world');
redis.get('foo', (err, result) => {
console.log(result);
})