# RocksRaft
[![LICENSE](https://img.shields.io/hexpm/l/plug)](https://github.com/CoderiGenius/RocksRaft/blob/master/LICENSE)
- 基于Raft一致性协议的分布式存储系统,参考阿里巴巴SOFAJRaft并使用Java从零实现。
- Distributed storage system based on Raft consistency protocol, referencing Alibaba SOFAJRaft and implemented from scratch using Java
## Reference
- Alibaba [SOFAJRaft](https://github.com/sofastack/sofa-jraft)
## Related papers
- [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)
## 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
```
没有合适的资源?快使用搜索试试~ 我知道了~
基于Raft一致性协议的分布式存储系统,参考阿里巴巴SOFAJRaft并使用Java从零实现。Distributed.zip
共154个文件
java:136个
proto:4个
yml:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 146 浏览量
2024-03-24
10:52:36
上传
评论
收藏 3.42MB ZIP 举报
温馨提示
基于Raft一致性协议的分布式存储系统,参考阿里巴巴SOFAJRaft并使用Java从零实现。Distributed
资源推荐
资源详情
资源评论
收起资源包目录
基于Raft一致性协议的分布式存储系统,参考阿里巴巴SOFAJRaft并使用Java从零实现。Distributed.zip (154个子文件)
log4j.xml.bak 8KB
log4j.xml.bak 8KB
rpc.bat 32B
RocksRaft.iml 80B
RpcRequests.java 516KB
NodeImpl.java 46KB
RaftOutter.java 39KB
LogOuter.java 25KB
Replicator.java 21KB
LogManagerImpl.java 18KB
LogManagerImplNew.java 18KB
RpcServicesImpl.java 15KB
Recyclers.java 14KB
SegmentList.java 13KB
FSMCallerImpl.java 10KB
ReplicatorGroupImpl.java 10KB
EnClosureRpcRequest.java 9KB
EnumOutter.java 9KB
NodeOptions.java 8KB
CRC64.java 8KB
ElectionServiceImpl.java 7KB
BallotBox.java 7KB
RaftGroupService.java 6KB
LogStorageImpl.java 6KB
IteratorImpl.java 6KB
ZeroByteStringHelper.java 6KB
ReplicatorGroup.java 6KB
ClientExample.java 6KB
EnClosureClientRpcRequest.java 5KB
Status.java 5KB
ThreadPoolUtil.java 5KB
RaftOptionsLoader.java 4KB
ThreadId.java 4KB
CustomStateMachine.java 4KB
RaftError.java 4KB
Utils.java 4KB
CurrentNodeOptions.java 4KB
PeerId.java 4KB
BallotBoxForApply.java 4KB
RocksDBStorageImpl.java 4KB
RpcResponseClosure.java 4KB
TimeOutChecker.java 4KB
ZeroByteStringHelper.java 3KB
LogEntry.java 3KB
StateMachine.java 3KB
StateMachine.java 3KB
ReplicatorOptions.java 3KB
Requires.java 3KB
LogManager.java 3KB
LogEntryEncoder.java 2KB
LeaderChangeContext.java 2KB
LogEntryEncoderV2.java 2KB
DisruptorBuilder.java 2KB
ArrayDeque.java 2KB
LogId.java 2KB
ReplicatorGroupOptions.java 2KB
Client.java 2KB
Iterator.java 2KB
Heartbeat.java 2KB
BytesCarrier.java 2KB
Bits.java 2KB
RpcOptions.java 2KB
NodeId.java 2KB
TimerManager.java 2KB
NonReentrantLock.java 2KB
Endpoint.java 2KB
TaskServicesImpl.java 2KB
CrcUtil.java 2KB
RpcResponseFactory.java 2KB
RaftServerService.java 2KB
BootYaml.java 2KB
IteratorWrapper.java 2KB
LogStorage.java 2KB
NodeManagerImpl.java 1KB
FSMCallerOptions.java 1KB
Ballot.java 1KB
ReadIteratorImpl.java 1KB
TestTimeManager.java 1KB
ClientRpcServiceImpl.java 1KB
LogExceptionHandler.java 1KB
ElectionService.java 1KB
TestHeartbeatChecker.java 1KB
RpcRequestClosure.java 1KB
CatchUpClosure.java 1KB
OtherNodes.java 1KB
StateMachineAdapter.java 1KB
RpcServices.java 1KB
Task.java 1KB
FSMCaller.java 1KB
LogEntryV2CodecFactory.java 1KB
RaftRpcServerFactory.java 1KB
AsciiStringUtil.java 1KB
LogStorageOptions.java 1KB
NodeManager.java 1017B
TaskRpcResponseClosure.java 1009B
LogManagerOptions.java 1000B
Start.java 948B
Start2.java 932B
Start3.java 931B
RaftException.java 920B
共 154 条
- 1
- 2
资源评论
Kwan的解忧杂货铺
- 粉丝: 1w+
- 资源: 3640
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功