

- A single leader is elected; all writes go through the leader.
- If a client writes to a follower, the follower forwards the request to the leader.
- The leader appends the write as a log entry and replicates it to followers.
- The leader considers the write committed only after a majority (quorum) acknowledges persistence.
- Once committed, the change is applied to the state machine on each member.

- Each node starts with a randomized election timeout.
- The first node whose timeout expires becomes a candidate and requests votes.
- If it receives votes from a majority of members, it becomes leader.
- Leader sends periodic heartbeats (AppendEntries RPCs) to prevent new elections.
- If heartbeats stop (leader crash or partition), followers trigger a new election.
Key takeaways:
- A 3‑node cluster tolerates 1 node failure.
- A 5‑node cluster tolerates 2 node failures.
- A 2‑node cluster is not recommended: quorum is 2, so losing one node prevents commits.
Use an odd number of etcd members (minimum 3) for HA. Three is a good starting point; five increases fault tolerance to two node failures.

- Client communication: port 2379
- Peer (cluster) communication: port 2380
- When creating members, provide the initial cluster membership so each member knows the other peers and the cluster token/state.
- Ensure certificate SANs include the advertise/listen IPs and hostnames for TLS.
Installing etcd (binary-based example)
A straightforward installation approach is to download the official release tarball, extract it, and move the binaries to a system path. Replace the version below with the latest supported release for production.
/etc/etcd/ (paths in the systemd example below assume this). Make sure certificates are generated using your PKI process and that SANs match the advertise/listen URLs.
Example systemd unit (etcd.service)
A minimal systemd unit demonstrates important flags. The --initial-cluster option lists all peers in the bootstrap. Update names/IPs and file paths to match your environment.
- Replace
peer-1/peer-2/peer-3and IP addresses with your hostnames/IPs. - Ensure TLS certificate paths, auth flags, and advertise/listen URLs match your certificates and network.
- Use
--initial-cluster-state newfor a fresh cluster. Useexistingwhen re‑joining an existing cluster.
Certificates must include correct SANs that match advertise/listen hostnames and IPs. Mismatched SANs will cause peer/client TLS handshakes to fail and prevent cluster formation.
ETCDCTL_API=3. For secured clusters pass TLS flags or set environment variables.
Examples:
- Minimum recommended HA cluster: 3 etcd members (odd number).
- 3 members tolerate 1 node failure; 5 members tolerate 2.
- Avoid 2‑node clusters — they do not improve availability.
- Choose between stacked topology (etcd co‑located on control-plane nodes) or an external dedicated etcd cluster based on operational needs, fault tolerance, and cost.
- etcd official docs: https://etcd.io
- Kubernetes docs: https://kubernetes.io/docs/
- etcd GitHub releases: https://github.com/etcd-io/etcd/releases