【文件属性】:
文件名称:raft-go:raft的实现
文件大小:22KB
文件格式:ZIP
更新时间:2021-02-13 16:18:44
Go
漂流
木筏的实现
生成gprc代码
$ protoc --go_out=. --go-grpc_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative raft_rpc/raft.proto
建造
构建守护程序
cd raft-deamon
go build
建立客户
cd raft-client
go build
用法
启动木筏守护进程
raft-daemon.exe --I=localhost:5050 --Peers=localhost:5051,localhost:5052
raft-daemon.exe --I=localhost:5051 --Peers=localhost:5052,localhost:5050
raft-daemon.exe --I=localhost:5052 --P
【文件预览】:
raft-go-master
----raft_rpc()
--------raft_grpc.pb.go(6KB)
--------raft.proto(1KB)
--------raft.pb.go(22KB)
----LICENSE(11KB)
----common()
--------commandMode.go(327B)
--------address.go(477B)
----raft-client()
--------client.go(1KB)
--------command.go(474B)
--------main.go(702B)
----.gitignore(289B)
----go.sum(7KB)
----raft-daemon()
--------peer.go(789B)
--------logentry.go(64B)
--------StateMachine.go(1KB)
--------main.go(568B)
--------node.go(10KB)
--------role.go(362B)
----README.md(718B)
----go.mod(140B)