|
@@ -339,8 +339,8 @@ We use -s to specify server port and -c to specify client port and -d to specify
|
|
|
Let the join two more nodes to this cluster using the -C argument:
|
|
Let the join two more nodes to this cluster using the -C argument:
|
|
|
|
|
|
|
|
```sh
|
|
```sh
|
|
|
-./etcd -c 4002 -s 7002 -C 127.0.0.1:7001 -d nod/node2
|
|
|
|
|
-./etcd -c 4003 -s 7003 -C 127.0.0.1:7001 -d nod/node3
|
|
|
|
|
|
|
+./etcd -c 4002 -s 7002 -C 127.0.0.1:7001 -d nodes/node2
|
|
|
|
|
+./etcd -c 4003 -s 7003 -C 127.0.0.1:7001 -d nodes/node3
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Get the machines in the cluster
|
|
Get the machines in the cluster
|
|
@@ -355,6 +355,18 @@ We should see there are three nodes in the cluster
|
|
|
0.0.0.0:4001,0.0.0.0:4002,0.0.0.0:4003
|
|
0.0.0.0:4001,0.0.0.0:4002,0.0.0.0:4003
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
+You can get the machinse in another way
|
|
|
|
|
+
|
|
|
|
|
+```sh
|
|
|
|
|
+curl -L http://127.0.0.1:4001/v1/keys/machines
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+```json
|
|
|
|
|
+[{"action":"GET","key":"/machines/node1","value":"0.0.0.0,7001,4001","index":4},{"action":"GET","key":"/machines/node3","value":"0.0.0.0,7002,4002","index":4},{"action":"GET","key":"/machines/node4","value":"0.0.0.0,7003,4003","index":4}]
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+The key of the machine is based on the ```commit index``` when it was added. The value of the machine is ```hostname```, ```raft port``` and ```client port```.
|
|
|
|
|
+
|
|
|
Also try to get the current leader in the cluster
|
|
Also try to get the current leader in the cluster
|
|
|
|
|
|
|
|
```
|
|
```
|