Sobes.tech
Middle

Why does Patroni need etcd and how many nodes were in the cluster?

sobes.tech AI

Answer from AI

Patroni uses etcd as a distributed configuration store and a mechanism for leader election in a PostgreSQL cluster. Etcd provides a consistent cluster state and helps coordinate role switching between nodes to prevent split-brain and ensure high availability.

The number of nodes in an etcd cluster is usually odd to ensure quorum, often 3 or 5 nodes. In the context of Patroni, 3 etcd nodes are typically used to ensure fault tolerance and proper leader election mechanism operation.