Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slaveClient not able to resolve to an end point #22

Open
vivekkrbajpai opened this issue Nov 6, 2014 · 2 comments
Open

slaveClient not able to resolve to an end point #22

vivekkrbajpai opened this issue Nov 6, 2014 · 2 comments

Comments

@vivekkrbajpai
Copy link

Hi ,
I am using redis-sentinel with three sentinel server and 8 slave with one master.

Setup

8 machine each has redis 2.8.14 , out of these 3 machine having sentinel. They are monitoring a single master at machine 1.

Here is the piece of code i am using to get connected to a slaveClient

var endpoints = [
{host: 'host1', port: 26739},
{host:'host2',port:26739},
{host:'host3',port:26739}
];

 var opts = {}; // Standard node_redis client options
 var masterName = 'mymaster';
 var redisClient = sentinel.createClient(endpoints, masterName, opts);
 var slaveClient = sentinel.createClient(endpoints, masterName, {role: 'slave'});
 slaveClient.on("connect", function () {
 console.log("hey")

 console.log(redisClient.server_info)
});
slaveClient.on("error", function (err) {
console.log("err",err )
});

Most of the time it prints the "hey" and server_info but few times it neither print the "hey" nor server_info infact the entire node process hangs without printing any error.

Is there any thing i am doing wrong ?

@jamessharp
Copy link
Member

All looks fine to me. Are you sure the master and sentinels are responsive when it hangs etc?

@vivekkrbajpai
Copy link
Author

Yups master and all three sentinels are responsive. Just a quick question what will happen if a slave is down or unreachable ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants