Closed guotaisu closed 4 years ago
Hi @guotaisu, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.
We encourage you to describe your issue in English which is more friendly to other users.
java -version
): 1.8-OS version (eg uname -a
): mac last version-Maven version: 3.5.9-IDE version: 2020.2@guotaisu You could refer to articles of SOFAJRaft in sofastack.tech. This would give you some examples to follow.
1.状态机、Raft节点、Metric是否都需要根据自己都业务需求进行重写,对这里对“状态机”是什么、怎么用 文档看起来说得不够清楚
如果你只是用 jraft-core, 那么你需要实现自己的 stateMachine,可参考代码里所有 StateMachineAdapter
的子类,包括 RheaKV
的 KVStoreStateMachine
均可作为参考,其他不用考虑
单组和多组(Multi-Raft-Group)怎么配置、怎么部署和启动
如果你基于 jraft-core 实现 multi group 的话,需要你自己实现分片策略,不是简单配置就搞的定,可参考 jraft-test
模块的配置和代码(该模块用于 jraft 的 jepsen 验证,是一个 multi group 实现),基于 rheakv 的话天然就是 multi group,配置可参考 jraft-example
中的 com.alipay.sofa.jraft.benchmark 部分的配置
3.RheaKV使用原生接口直接存储即可吗?因为上述2中集群启动后,啥也不用管了,日志一致性、Raft通信底层都实现了
是的
1.使用JRaft支持选举功能
可参考 example com.alipay.sofa.jraft.example.election
2.使用JRaft支持配置单组和多组(Multi-Raft-Group)
上面回答了不再重复
3.使用JRaft-RheaKV支持数据持久和数据快照配置功能
支持,精装修拎包住
没其他问题先关闭了
Your question
本人现就生产代码引入JRaft存在以下问题,望官方协助答疑解惑: 1.状态机、Raft节点、Metric是否都需要根据自己都业务需求进行重写,对这里对“状态机”是什么、怎么用 文档看起来说得不够清楚 2.单组和多组(Multi-Raft-Group)怎么配置、怎么部署和启动 3.RheaKV使用原生接口直接存储即可吗?因为上述2中集群启动后,啥也不用管了,日志一致性、Raft通信底层都实现了
Your scenes
项目需求: 1.使用JRaft支持选举功能 2.使用JRaft支持配置单组和多组(Multi-Raft-Group) 3.使用JRaft-RheaKV支持数据持久和数据快照配置功能
目的: 1.抽象接口,提供其它开发人员开箱即用的能力 2.支持集群单组或多组配置、支持数据持久化配置(Memory、RocksDB)、支持快照配置(是否开启、周期等)
Your advice
官网文档在功能模块原理方面描述的比较清楚,但是作为刚刚接触和使用JRaft的人来说,我觉得应该先懂得如何在自己的项目中使用起来,文档应该重这个角度首先写好入门使用,使用过程中再就具体模块和原理参照文档进行分析。
Environment
java -version
): 1.8uname -a
): mac last version