mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Update README.md
This commit is contained in:
parent
e2f90020ae
commit
4b6431d3b8
33
README.md
33
README.md
@ -241,6 +241,29 @@ Let the join two more nodes to this cluster using the -C argument:
|
|||||||
./etcd -c 4003 -s 7003 -C 127.0.0.1:7001 -d nod/node3
|
./etcd -c 4003 -s 7003 -C 127.0.0.1:7001 -d nod/node3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Get the machines in the cluster
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl http://127.0.0.1:4001/machines
|
||||||
|
```
|
||||||
|
|
||||||
|
We should see there are three nodes in the cluster
|
||||||
|
|
||||||
|
```
|
||||||
|
0.0.0.0:7001,0.0.0.0:7002,0.0.0.0:7003
|
||||||
|
```
|
||||||
|
|
||||||
|
Also try to get the current leader in the cluster
|
||||||
|
|
||||||
|
```
|
||||||
|
curl http://127.0.0.1:4001/leader
|
||||||
|
```
|
||||||
|
The first server we set up should be the leader, if it has not dead during these commands.
|
||||||
|
|
||||||
|
```
|
||||||
|
0.0.0.0:7001
|
||||||
|
```
|
||||||
|
|
||||||
Now we can do normal SET and GET operations on keys as we explored earlier.
|
Now we can do normal SET and GET operations on keys as we explored earlier.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@ -259,6 +282,16 @@ Let's kill the leader of the cluster and get the value from the other machine:
|
|||||||
curl http://127.0.0.1:4002/v1/keys/foo
|
curl http://127.0.0.1:4002/v1/keys/foo
|
||||||
```
|
```
|
||||||
|
|
||||||
|
A new leader should have been elected.
|
||||||
|
|
||||||
|
```
|
||||||
|
curl http://127.0.0.1:4001/leader
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
0.0.0.0:7002 or 0.0.0.0:7003
|
||||||
|
```
|
||||||
|
|
||||||
You should be able to see this:
|
You should be able to see this:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
Loading…
x
Reference in New Issue
Block a user