You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cd client_1
$ go run ../main.go --config config.json
2.open a terminal and type:
$ cd client_2
$ go run ../main.go --config config.json
3.open a terminal and type:
$ cd client_3
$ go run ../main.go --config config.json
4.open a terminal and type:
$ cd client_4
$ go run ../main.go --config config.json
now you got 4 nodes running in you machine.
choose master node:
1.choose one of the nodes to be master, such as client_1:
$ curl -X POST http://127.0.0.1:11001/bemaster
OK
2.let other nodes to join the cluster:
$ curl -X POST -d "addr=127.0.0.1:11002" http://127.0.0.1:11001/join
OK
$ curl -X POST -d "addr=127.0.0.1:11003" http://127.0.0.1:11001/join
OK
$ curl -X POST -d "addr=127.0.0.1:11004" http://127.0.0.1:11001/join
OK