Giter VIP home page Giter VIP logo

beholder's Introduction

Beholder

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.

Dependencies

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

Installation

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

$ sudo cp src/beholder.py /usr/local/bin/beholder.py
$ 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

Configuration

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

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

redis:
  sentinel_ip: "127.0.0.1"
  sentinel_port: 26379

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

Contributing

  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

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

See LICENSE.md

beholder's People

Contributors

serekh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

beholder's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.