Sample code/scripts for the sentinel tutorial on redis.com
The tutorial gives a very simple script to be called on failvoer actions. THis script simply logs events to /tmp/failovers.log. To use it, edit the sentinel config files to have the full path to it and fire up the sentinels.
If you have Tmux installed, running the tmux-redis.sh script in this directory will:
-
Fire up three redis servers. They will be on port 6500, 6501, and 6502. These will be in the first window, named 'servers'
-
Fire up three redis-sentinel servers using the "sentinel-N.conf" config files. These will be in the second window, names 'sentinel'
-
Open a third window, named 'console', split it and open a redis-cli connection to the first sentinel, a console in the second pane.
Note: The scripts assume a base-index of 1 in tmux.conf. If you use the default base 0 index of Tmux you'll want to decrement the window number in the scripts (ie. 1.2 -> 0.2).