{"id":49339821,"url":"https://github.com/coderigenius/rocksraft","last_synced_at":"2026-04-27T03:04:37.256Z","repository":{"id":45107243,"uuid":"250197203","full_name":"CoderiGenius/RocksRaft","owner":"CoderiGenius","description":"基于Raft一致性协议的分布式存储系统，参考阿里巴巴SOFAJRaft并使用Java从零实现。Distributed storage system based on Raft consistency protocol, referencing Alibaba SOFAJRaft and implemented from scratch using Java","archived":false,"fork":false,"pushed_at":"2022-12-14T20:30:53.000Z","size":4324,"stargazers_count":15,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-03T14:26:52.338Z","etag":null,"topics":["raft","raft-algorithm","raft-consensus","raft-consensus-algorithm","raft-java","raft-protocol"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoderiGenius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-26T08:07:44.000Z","updated_at":"2023-01-05T14:52:36.000Z","dependencies_parsed_at":"2023-01-29T00:46:04.496Z","dependency_job_id":null,"html_url":"https://github.com/CoderiGenius/RocksRaft","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/CoderiGenius/RocksRaft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderiGenius%2FRocksRaft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderiGenius%2FRocksRaft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderiGenius%2FRocksRaft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderiGenius%2FRocksRaft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoderiGenius","download_url":"https://codeload.github.com/CoderiGenius/RocksRaft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderiGenius%2FRocksRaft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32320688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["raft","raft-algorithm","raft-consensus","raft-consensus-algorithm","raft-java","raft-protocol"],"created_at":"2026-04-27T03:04:28.561Z","updated_at":"2026-04-27T03:04:37.242Z","avatar_url":"https://github.com/CoderiGenius.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RocksRaft\n\n[![LICENSE](https://img.shields.io/hexpm/l/plug)](https://github.com/CoderiGenius/RocksRaft/blob/master/LICENSE)\n\n- 基于Raft一致性协议的分布式存储系统，参考阿里巴巴SOFAJRaft并使用Java从零实现。\n- Distributed storage system based on Raft consistency protocol, referencing Alibaba SOFAJRaft and implemented from scratch using Java\n## Reference\n- Alibaba [SOFAJRaft](https://github.com/sofastack/sofa-jraft)\n## Related papers\n- [Graduation thesis of QUST in 2020 for bachelor's degree ](https://github.com/CoderiGenius/RocksRaft/blob/master/%E8%AE%BA%E6%96%87github%E5%BC%80%E6%BA%90%E7%89%88.pdf)\n## Quick start\n- Basic requirement\n  - JDK 1.8+\n  - IntelliJ idea\n  - maven\n- Clone project\n````\ngit clone https://github.com/CoderiGenius/RocksRaft.git\n````\n- Import in to idea as maven project\n- Config and start the example of 3 nodes scenario. \n    - Config the three yml files in **src/main/resources**\n    - Start the main function with files listed below\n        - src/main/java/Start.java\n        - src/main/java/Start2.java\n        - src/main/java/Start3.java\n- Wait until the nodes come up.\n- Run the src/main/java/ClientExample.java\n- You should be able to see the log of appendEnties and the procedures of applying to statemachine.\n- Log example:\n```\nWARN:appendEntriesRequest CHECK:index 0 dataIsEmpty:false \nWARN:checkBallotBoxToApply applied:Voting currentIndex:0 length:1 stableLogIndex:0 \nINFO:Ballot box invokes apply at index 0 length 1 with grant list [PeerId{endpoint=localhost:12220, checksum=0}, PeerId{endpoint=localhost:12230, checksum=0}]\nINFO: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\nINFO:Apply to fsm at 1\nINFO:Log 1 has been applied to stateMachine\nINFO:Receive follower raft-3 applied  firstIndex :0 lastIndex:0\nINFO:Receive follower raft-1 applied  firstIndex :0 lastIndex:0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderigenius%2Frocksraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderigenius%2Frocksraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderigenius%2Frocksraft/lists"}