File tree Expand file tree Collapse file tree 1 file changed +21
-11
lines changed
content/en/docs/v3.5/tutorials Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -9,21 +9,31 @@ weight: 900
99- Ensure [ ` etcd ` ] ( https://etcd.io/docs/v3.5/install/ ) and [ ` etcdctl ` ] ( https://etcd.io/docs/v3.5/install/ ) is installed.
1010- Check for active etcd cluster.
1111
12- ` elect ` for leader election:
12+ ## Conduct Leader election
1313
14- 1 . The ` etcdctl ` command is used to conduct leader elections in an etcd cluster. It makes sure that only one client become leader at a time.
15- 2 . Ensure the ` ENDPOINTS ` variable is set with the addresses of each etcd cluster members.
16- 3 . Set a unique name for the election for different clients ('* one* ' in the given code below).
17- 4 . Lastly, set different leaders name for each clients (* p1* and * p2* ).
18-
19-
20- Command format :
21- ` etcdctl --endpoints=$ENDPOINTS elect <election-name> <leader-name> `
14+ The ` etcdctl ` command is used to conduct leader elections in an etcd cluster. It makes sure that only one client become leader at a time.
2215
16+ ` etcdctl --endpoints=$ENDPOINTS elect <election-name> <leader-name> `
2317
18+ ### Example
2419
2520``` shell
26- etcdctl --endpoints=$ENDPOINTS elect one p1
21+ etcdctl --endpoints=$ENDPOINTS elect election-name p1
2722
2823# another client with the same election name block
29- etcdctl --endpoints=$ENDPOINTS elect one p2
24+ etcdctl --endpoints=$ENDPOINTS elect election-name p2
25+ ```
26+
27+ ### Options
28+
29+ - ` --endpoints : $ENDPOINTS `
30+
31+ Address of each etcd cluster members.
32+
33+ - ` election-name ` string
34+
35+ A string identifier for the election. All participants competing for leadership must use the same election name.
36+
37+ - ` leader-name ` string
38+
39+ Leaders name for each clients
You can’t perform that action at this time.
0 commit comments