Agent for twemproxy to work with a redis sentinel to provide support for failover
Switch branches/tags
Nothing to show
Clone or download
Serekh Redirected the output when the service is started to /dev/null becaus…
…e in the other way block SaltStack service start command.
Latest commit af0a094 Mar 26, 2015


Beholder is an agent written in Python for twemproxy to work with a redis sentinel to provide support for failover.

Beholder's purpose is to extend the HA capabilities of twemproxy even after a redis node has failed.

In order to accomplish this, beholder is continuously monitoring the +switch-master event, then it will update twemproxy configuration files and restart the resource.


Beholder use redis-py and pyyaml, so the first step is install the dependencies:

$ pip install redis
$ pip install pyyaml

If you want to install python yaml system-wide in linux, you can also use a package manager, like:

$ sudo apt-get install python-yaml
$ sudo yum install python-yaml


The follow installation steps are the default ones, feel free to change any path.

$ sudo cp src/ /usr/local/bin/
$ sudo cp conf/beholder.yml /etc/nutcracker/beholder.yml
$ sudo cp scripts/beholder.init /etc/init.d/beholder
$ sudo chmod 775 /etc/init.d/beholder
$ sudo chkconfig --add /etc/init.d/beholder
$ sudo chkconfig beholder on
$ sudo service beholder start


Beholder can be configured through a YAML file beholder.yml.

  log_file: "/var/log/beholder.log"
  connect_retry_count: -1 # -1 to unlimited
  connect_retry_interval: 1000 # Milliseconds

  sentinel_ip: ""
  sentinel_port: 26379

  config_file: "/etc/nutcracker/nutcracker.yml"
  restart_command: "/etc/init.d/nutcracker restart"


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


Licensed under the Apache License, Version 2.0: