a store by hashicorp/raft for demonstrate
To start using depot, install Go and run go get -u
:
$ go get -u github.com/forjoin92/depot
This will retrieve the library and install the depot
command line utility into
your $GOBIN
path.
./depot -cluster 127.0.0.1:30401 -id 127.0.0.1:30401 -testAddr 127.0.0.1 -testPort 9001
Store a value ("value1") to a key ("key1"):
curl -L http://127.0.0.1:9001/setKV -XPUT -d {"key1":"value1"}
Retrieve the stored key:
curl -L http://127.0.0.1:9001/getKV/key1
Delete the stored key:
curl -L http://127.0.0.1:9001/deleteKV/key1 -XDELETE
Add one member of depot:
curl -L http://127.0.0.1:9001/addNode -XPOST -d 127.0.0.1:30402
./depot -cluster 127.0.0.1:30402 -id 127.0.0.1:30402 -testAddr 127.0.0.1 -testPort 9002
./depot -cluster 127.0.0.1:30401,127.0.0.1:30402 -id 127.0.0.1:30401 -testAddr 127.0.0.1 -testPort 9001
./depot -cluster 127.0.0.1:30401,127.0.0.1:30402 -id 127.0.0.1:30402 -testAddr 127.0.0.1 -testPort 9002
Delete one member of depot's cluster:
curl -L http://127.0.0.1:9001/removeNode -XDELETE 127.0.0.1:30402