2
votes

To manage the master-slave failover, redis has sentinel in hand. Two servers I am using. One for the Master server and the other for the slave. Both master and slave are remote server and running as a daemon. How to configure the sentinel with master and slave IP. Where the Sentinel needs to be run. How to run sentinel as a daemon.

For detail:

My master running in

Port: 6379

IP: 192.168.56.101

My slave running in

Port: 6379

IP: 192.168.56.102

My node is running in

IP: 192.168.0.140

Note : Redis servers are run in a virtual machine in windows. Where the node is also running locally on the same machine.

Update The documentation specifies the command to run Sentinel. My question is sentinel need to be run in my local machine or in the virtual machine where the master is running or as separate sentinel server. Like one redis-server for master and one for slave and another one for sentinel.?

3

3 Answers

2
votes

"My question is sentinel need to be run in my local machine or in virtual machine where master is running or as separate sentinel server. Like one redis-server for master and one for slave and another one for sentinel"

I also started to investigate redis-sentinel configurations.

So far we had sentinel instance running on each virtual machine where redis-server running (master and slave), but in order to have properly configured quorum for sentinel instances, you should have at least 3 sentinels and quorum of 2 configured. That's why in my case I've added 3rd Virtual Machine runnung redis-server as slave for master (so we have 1 master and 2 slaves related) - in case if master is going to fail, you still going to have 1 master and 1 slave available.

I don't see the value in running standalone machine with only sentinel instance - it seems to be just waste of available resources.

1
votes

Note that here you have a setup that is actually running in a single host, so with Sentinel you are only adding HA that can improve availability if the Redis server crashes and/or when other software errors will happen, you are not adding any real HA from the point of view of hardware failures. But probably this is already obvious.

In your setup the best thing is IMHO to spawn an additional Linux VM, and run Sentinel in three nodes: the two Linux VMs you already have, and an additional VM, setting the quorum to 2, so you'll be able to failover if the Redis processes will fail but also if an entire VM running the Redis master will fail.

0
votes

This redis documentation on sentinel http://redis.io/topics/sentinel might help.