【文件属性】:
文件名称:raft:Package Raft实现了基于hslamrpc的Raft分布式共识协议
文件大小:53KB
文件格式:ZIP
更新时间:2021-03-21 18:02:43
go golang raft protocol consensus
筏
软件包实现了基于的分布式共识协议。
特征
*选举
日志复制
会员变更
日志压缩(快照)
传输
和
阅读索引/租赁阅读
非投票成员(领导者仅将日志条目复制到他们)
快照策略(从不/每秒钟/ CustomSync)
开始吧
安装
go get github.com/hslam/raft
进口
import "github.com/hslam/raft"
例子
package main
import (
"flag"
"github.com/hslam/raft"
"io"
"io/ioutil"
"log"
"strings"
"time"
)
var host , path , members string
var port int
var join bool
func init () {
flag . StringVar ( & host , "h" , "loc
【文件预览】:
raft-master
----state_leader.go(3KB)
----go.mod(289B)
----vote_test.go(526B)
----pipe.go(6KB)
----snapshot_sync.go(1KB)
----configuration.go(4KB)
----raft_pb_test.go(19KB)
----util_test.go(607B)
----persistent_uint64.go(2KB)
----raft.go(7KB)
----node.go(21KB)
----wal.go(9KB)
----LICENSE(1KB)
----state.go(414B)
----raft_test.go(18KB)
----go.sum(3KB)
----cache.go(2KB)
----storage_test.go(1KB)
----.github()
--------workflows()
----election.go(1KB)
----codec.go(4KB)
----raft.proto(2KB)
----raft.pb.go(40KB)
----state_machine.go(8KB)
----README.md(6KB)
----util.go(1KB)
----codec_test.go(4KB)
----peer.go(5KB)
----snapshot.go(6KB)
----state_follower.go(2KB)
----rpcs.go(5KB)
----command_test.go(797B)
----storage.go(4KB)
----const.go(3KB)
----logger.go(1KB)
----invoker.go(973B)
----cluster.go(5KB)
----vote.go(1KB)
----read_index.go(3KB)
----cache_test.go(1KB)
----command.go(3KB)
----errors.go(2KB)
----state_candidate.go(2KB)
----service.go(2KB)