2

On the documentation, they advice the monitor command. But it has a 50% performance penalty for the whole system, and how should I do that ? Whatching the ouput using SSH until I don't see anything ?

Let's say I have 3 servers: 1 with a redis master, 1 with a redis slave, and one with my website querying the redis master.

How can I, from my website server, make cleany the decision to fallback to the slave by sending the SLAVEOF NO ONE command ?

My first step would be to put some kind of timeout check with a simple ping, just to be sure the server is online. But for redis specifically, I have no clue.

2
  • Are you using the production builds, or would a release candidate be acceptable? Sentinel addresses these problems very well, but won't be stable for a while.
    – Tim Post
    Oct 3, 2012 at 23:53
  • I'll try with the stable realease for now please.
    – Bite code
    Oct 4, 2012 at 6:51

1 Answer 1

0

You could connect from the checking node using the redis API and send the redis command called "ping".

That would tell you if it is responding. However you would also want to be sure you are talking to a master, so I would recommend runnig the info command to get that information. If they both fail then the node is offline.

However, I would also advise you don't always assume the same node is master on every connection attempt. By using info from both you can be more sure of talking to the master when you want to.

Part of this means being prepared for a see-saw of who is up and who is not.

Or, depending on your usage you could consider twemproxy by the fine folks at twitter. Or a software load balancer such as balance.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .