Giter VIP home page Giter VIP logo

redisraft's Introduction

RedisRaft

โš ๏ธ RedisRaft is still being developed and is not yet ready for any real production use. Please do not use it for any mission critical purpose at this time.

Strongly-Consistent Redis Deployments

RedisRaft is a Redis module that implements the Raft Consensus Algorithm, making it possible to create strongly-consistent clusters of Redis servers.

The Raft algorithm is provided by a standalone Raft library by Willem-Hendrik Thiart.

Main Features

  • Strong consistency (in the language of CAP, this system prioritizes consistency and partition-tolerance).
  • Support for most Redis data types and commands
  • Dynamic cluster configuration (adding / removing nodes)
  • Snapshots for log compaction
  • Configurable quorum or fast reads

Getting Started

Building

To compile the module, you will need:

  • Build essentials (a compiler, GNU make, etc.)
  • CMake
  • GNU autotools (autoconf, automake, libtool).

To build:

git clone https://github.com/RedisLabs/redisraft.git
cd redisraft
mkdir build && cd build
cmake ..
make

redisraft.so will be created under the project directory.

Creating a RedisRaft Cluster

RedisRaft requires the latest Redis build from 'unstable' branch. Build Redis first:

git clone https://github.com/redis/redis  
cd redis
make 
make install

To create a three-node cluster, start the first node:

redis-server \
    --port 5001 --dbfilename raft1.rdb \
    --loadmodule <path-to>/redisraft.so \
        raft-log-filename raftlog1.db addr localhost:5001

Then initialize the cluster:

redis-cli -p 5001 raft.cluster init

Now start the second node, and run the RAFT.CLUSTER JOIN command to join it to the existing cluster:

redis-server \
    --port 5002 --dbfilename raft2.rdb \
    --loadmodule <path-to>/redisraft.so \
        raft-log-filename raftlog2.db addr localhost:5002

redis-cli -p 5002 RAFT.CLUSTER JOIN localhost:5001

Now add the third node in the same way:

redis-server \
    --port 5003 --dbfilename raft3.rdb \
    --loadmodule <path-to>/redisraft.so \
        raft-log-filename raftlog3.db addr localhost:5003

redis-cli -p 5003 RAFT.CLUSTER JOIN localhost:5001

To query the cluster state, run the INFO raft command:

redis-cli -p 5001 INFO raft

Now you can start using this RedisRaft cluster. All supported Redis commands will be executed in a strongly-consistent manner using the Raft protocol.

Documentation

Please consult the documentation for more information.

License

RedisRaft is licensed under the Redis Source Available License (RSAL).

redisraft's People

Contributors

amiramm avatar danni-m avatar dipach avatar gavrie avatar jhershberg avatar maguec avatar natoscott avatar sjpotter avatar tezc avatar yaeltzirulnikov avatar yossigo avatar zouyonghao avatar

Stargazers

 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.