GithubHelp home page GithubHelp logo

redis-replica's Introduction

Introduction

People! We are all waiting for production version of Redis Cluster.
But we want to use Redis in production now and we need some failover in it.

A year ago Redis Sentinel was not able to return falled master into cluster as slave.
Then I decided to write a small and dumb Redis failover to use in production.

Redis-replica

So, here it is. Redis-replica is a failover and master election manager for Redis.
It continuously checks availability of specified Redis nodes.
Each redis-replica daemon is connected to other redis-replica daemons and exchanges information about pings.

All redis-replica nodes act equally. So if multiple redis-replica nodes detect a problem all of them try to solve it.
Redis can handle multiple similar SLAVE OF-commands, so in our case above strategy is normal.

Redis nodes that are visible from majority of redis-replica nodes are called Quorum-Nodes.
The counterpart is called Nonquorum-Nodes.

Several conditions are checked:

  1. No master at all.
  2. Multiple masters.
  3. Slaves are connected to different masters.
  4. Split-brain condition - all nonquorum master turned into slaves.

In the cases 2 and 3 master with more used_memory is elected. It's our production case but can be easily changed.

Usage

./redis-replica.py < config >

Third-party

Redis first of all.

redis-replica depends on two cool python libraries:

redis-replica's People

Contributors

eugenebolotin avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.