search

Home  >  Q&A  >  body text

node.js - nodejs ioredis All sentinels are unreachable

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);
})
漂亮男人漂亮男人2704 days ago1983

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-07-03 11:44:50

    qqqqqqqqq

    reply
    0
  • Cancelreply