Skip to content

Commit

Permalink
Update how-to-conduct-elections.md
Browse files Browse the repository at this point in the history
Signed-off-by: Shubhdeep02 <[email protected]>
  • Loading branch information
jmhbnz authored and Shubhdeep02 committed Sep 8, 2024
1 parent 0fb95a0 commit 6b2fb6c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ updates:
directory: /
schedule:
interval: weekly
allow:
dependency-type: "development"
dependency-type: "production"
19 changes: 17 additions & 2 deletions content/en/docs/v3.5/tutorials/how-to-conduct-elections.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,28 @@ description: Guide to conducting leader election in an etcd cluster
weight: 900
---


## Prerequisites

- Ensure [`etcd`](https://etcd.io/docs/v3.5/install/) and [`etcdctl`](https://etcd.io/docs/v3.5/install/) is installed.
- Check for active etcd cluster.

`elect` for leader election:

![09_etcdctl_elect_2016050501](https://storage.googleapis.com/etcd/demo/09_etcdctl_elect_2016050501.gif)
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.
2. Ensure the `ENDPOINTS` variable is set with the addresses of each etcd cluster members.
3. Set a unique name for the election for different clients ('<i>one</i>' in the given code below).
4. Lastly, set different leaders name for each clients (<i>p1</i> and <i>p2</i>).


Command format :
`etcdctl --endpoints=$ENDPOINTS elect <election-name> <leader-name>`



```shell
etcdctl --endpoints=$ENDPOINTS elect one p1

# another client with the same name blocks
# another client with the same election name block
etcdctl --endpoints=$ENDPOINTS elect one p2
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"autoprefixer": "^10.4.18",
"docsy": "github:google/docsy#semver:0.10.0",
"hugo-extended": "^0.127.0",
"netlify-cli": "^17.15.2",
"netlify-cli": "^17.29.0",
"postcss": "^8.4.31",
"postcss-cli": "^11.0.0"
}
Expand Down

0 comments on commit 6b2fb6c

Please sign in to comment.