-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Hi,
Im using ioredis to connect to a sentinel server, and Im able to run all redis commands successfully. But when I try to run commands on sentinel, I get an error (see below). I also ran wireshark on my computer while running the code, and I saw that the sentinel command is sent to the redis master ip. Is there something wrong that I did?
code:
const Redis = require('ioredis');
const redis = new Redis({
sentinels: [{ host: 'localhost', port: 26379 }],
name: 'myMaster', // The name of your master (as configured in Sentinel)
});
redis.on('connect', () => {
console.log('Connected to Redis Sentinel');
});
// Get master address and print it
redis.sentinel('masters', (err, masters) => {
if (err) {
console.error('Error getting masters:', err);
} else {
console.log('Masters:', masters);
}
});
error:
Connected to Redis Sentinel
Error getting masters: ReplyError: ERR unknown command 'sentinel', with args beginning with: 'masters'
at parseError (/Users/michael/Documents/Widebridge/synch-common/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/Users/michael/Documents/Widebridge/synch-common/node_modules/redis-parser/lib/parser.js:302:14) {
command: { name: 'sentinel', args: [ 'masters' ] }
Metadata
Metadata
Assignees
Labels
No labels