node.js - nodejs ioredis All sentinels are unreachable
漂亮男人
漂亮男人 2017-07-03 11:42:50
0
1
2090

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

reply all(1)
刘奇

qqqqqqqqq

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template