李度、马也驰 25spring数据库系统 p1仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
augurier 1181f6d796 raft日志同步部分 6 months ago
cmd 持久化与恢复测试 删除 6 months ago
internal raft日志同步部分 删除 6 months ago
scripts 提供了客户端向leader发送的功能 删除 6 months ago
test raft日志同步部分 删除 6 months ago
.gitignore 封装了发送状态的模拟 6 months ago
README.md 增加logId 6 months ago
go.mod 持久化与恢复测试 6 months ago
go.sum 持久化与恢复测试 6 months ago

README.md

go-raft-kv


基于go语言实现分布式kv数据库

环境与运行

使用环境是wsl+ubuntu
go mod download安装依赖
./scripts/build.sh 会在根目录下编译出main ./scripts/run.sh 运行三个节点,目前能在终端进行读入,leader(n1)节点输出send log,其余节点输出receive log。终端输入后如果超时就退出(脚本运行时间可以在其中调整)。

注意

脚本第一次运行需要权限获取 chmod +x <脚本>
如果出现tcp listen error可能是因为之前的进程没用正常退出,占用了端口
lsof -i :9091查看pid
kill -9 杀死进程

关于测试

通过新开进程的方式创建节点,如果通过线程创建,会出现重复注册rpc问题

todo list

消息通讯异常的处理
kv本地持久化
崩溃与恢复(以及对应的测试)