a go package to enable any service utilize the distributed power of Raft & Gossip
inspired from ysf/raftsample
mkdir -p temp
go build -o temp/cmd-client cmd/client/cmd_client.go
go build -o temp/cmd-server cmd/server/cmd_server.go
- run a server A with raft id
alpha
atlocalhost:6660
and tcp server atlocalhost:6661
RAFTER_NODE_PORT=6660 RAFTER_SERVER_PORT=6661 RAFTER_NODE_ID=alpha RAFTER_VOLUME_DIR=/tmp/raft-badger-alpha $(dirname $0)/cmd-server
- run a server B with raft id
beta
atlocalhost:6670
and tcp server atlocalhost:6671
RAFTER_NODE_PORT=6670 RAFTER_SERVER_PORT=6671 RAFTER_NODE_ID=beta RAFTER_VOLUME_DIR=/tmp/raft-badger-beta $(dirname $0)/cmd-server
- run the client to talk to
alpha
node
RAFTER_NODE_ID=alpha RAFTER_TARGET_PORT=6661 temp/cmd-client -action /stats
RAFTER_NODE_ID=alpha RAFTER_TARGET_PORT=6661 temp/cmd-client -action /join -id beta -address 127.0.0.1:6670
RAFTER_NODE_ID=alpha RAFTER_TARGET_PORT=6661 temp/cmd-client -action /leave -id beta -address 127.0.0.1:6670
RAFTER_NODE_ID=alpha RAFTER_TARGET_PORT=6661 temp/cmd-client -action /stats
RAFTER_NODE_ID=alpha RAFTER_TARGET_PORT=6661 temp/cmd-client -action /payload -payload-file ./go.mod
RAFTER_NODE_ID=alpha RAFTER_TARGET_PORT=6661 temp/cmd-client -action /stats