Open source Java implementation for Raft consensus protocol.

Getting started

Ratis is a Raft protocol library in Java. It’s not a standalone server application like Zookeeper or Consul.

Examples

To demonstrate how to use Ratis from the code, Please look at the following examples.

The source code of the examples could be found in the ratis-examples sub-project.

Maven usage

To use in our project you can access the latest binaries from maven central:

<dependency>
   <artifactId>ratis-server</artifactId>
   <groupId>org.apache.ratis</groupId>
</dependency>

You also need to include one of the transports:

<dependency>
   <artifactId>ratis-grpc</artifactId>
   <groupId>org.apache.ratis</groupId>
</dependency>
 <dependency>
   <artifactId>ratis-netty</artifactId>
   <groupId>org.apache.ratis</groupId>
</dependency>
<dependency>
   <artifactId>ratis-hadoop</artifactId>
   <groupId>org.apache.ratis</groupId>
</dependency>

Please note that Apache Hadoop dependencies are shaded, so it’s safe to use hadoop transport with different versions of Hadoop.