Giter Site home page Giter Site logo

mengleijin / rocksraft Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coderigenius/rocksraft

0.0 0.0 0.0 4.22 MB

基于Raft一致性协议的分布式存储系统,参考阿里巴巴SOFAJRaft并使用Java从零实现。Distributed storage system based on Raft consistency protocol, referencing Alibaba SOFAJRaft and implemented from scratch using Java

License: Apache License 2.0

Java 99.99% Batchfile 0.01%

rocksraft's Introduction

RocksRaft

LICENSE

  • 基于Raft一致性协议的分布式存储系统,参考阿里巴巴SOFAJRaft并使用Java从零实现。
  • Distributed storage system based on Raft consistency protocol, referencing Alibaba SOFAJRaft and implemented from scratch using Java

Reference

Related papers

Quick start

  • Basic requirement
    • JDK 1.8+
    • IntelliJ idea
    • maven
  • Clone project
git clone https://github.com/CoderiGenius/RocksRaft.git
  • Import in to idea as maven project
  • Config and start the example of 3 nodes scenario.
    • Config the three yml files in src/main/resources
    • Start the main function with files listed below
      • src/main/java/Start.java
      • src/main/java/Start2.java
      • src/main/java/Start3.java
  • Wait until the nodes come up.
  • Run the src/main/java/ClientExample.java
  • You should be able to see the log of appendEnties and the procedures of applying to statemachine.
  • Log example:
WARN:appendEntriesRequest CHECK:index 0 dataIsEmpty:false 
WARN:checkBallotBoxToApply applied:Voting currentIndex:0 length:1 stableLogIndex:0 
INFO:Ballot box invokes apply at index 0 length 1 with grant list [PeerId{endpoint=localhost:12220, checksum=0}, PeerId{endpoint=localhost:12230, checksum=0}]
INFO:doCommitted at 1 iterImpl:IteratorImpl [fsm=core.CustomStateMachine@22d116d, logManager=core.LogManagerImplNew@61295f0, currentIndex=1, committedIndex=1, currEntry=entity.LogEntry@ceafe80, applyingIndex=1, error=null,isGood=true] isGood:true
INFO:Apply to fsm at 1
INFO:Log 1 has been applied to stateMachine
INFO:Receive follower raft-3 applied  firstIndex :0 lastIndex:0
INFO:Receive follower raft-1 applied  firstIndex :0 lastIndex:0

rocksraft's People

Contributors

coderigenius 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.