https://github.com/adjust/redis_failover
redis failover scripts
https://github.com/adjust/redis_failover
Last synced: 8 months ago
JSON representation
redis failover scripts
- Host: GitHub
- URL: https://github.com/adjust/redis_failover
- Owner: adjust
- License: mit
- Created: 2014-01-02T15:50:34.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2021-03-23T15:43:42.000Z (about 5 years ago)
- Last Synced: 2025-04-16T02:06:19.482Z (about 1 year ago)
- Language: Perl
- Size: 16.6 KB
- Stars: 3
- Watchers: 73
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
redis failover
==============
redis failover scripts
## Scope
This lib is supposed to be the glue between [Redis Sentinel](http://redis.io/topics/sentinel) and [Nutcracker/Twemproxy](https://github.com/twitter/twemproxy).
## Build
```
$ perl Build.PL
$ ./Build installdeps
$ ./Build test
$ ./Build install
```
## Usage
Install the lib on the same server as Nutcracker.
```
usage:
failover.pl --out --help
--sentinel | -s define sentinel server
default: 'localhost:26379'
--command define the command to restart nutcracker
default: 'sudo /etc/init.d/nutcracker restart'
--out | -o output to specified file
default: '/etc/nutcracker/nutcracker.yml'
--pretend | -p write config, but don't issue restart
print nutcracker start command
default: false
--check | -c quick check if redis can rewrite nutcracker config
default: false
--help | -h display this help and exit
```
After successful installation add it to your sentinel config:
```
sentinel monitor my_master redis.example.com 6379 1
sentinel down-after-milliseconds my_master 3000
sentinel parallel-syncs my_master 1
sentinel failover-timeout my_master 180000
sentinel client-reconfig-script my_master /usr/bin/failover.pl
```
If a failover get triggered, sentinel will rewrite the nutcracker config.