I am building a HA Postgres db cluster with one master and multiple slaves. Please look at the below points and correct me if I am wrong:
- For each slave node, I need to use pg_basebackup to sync and setup stream replication with the master node.
- Setup Patroni on each node so that the leader can be elected from any of the available nodes in case of master failure (In this case, if the master fails, a slave node will be elected as master and write operations will be handled by it. Now if the master comes online and becomes the master of the cluster, then will the master sync with the previous master i.e. updated slaves).
- Setup Etcd on a node and configure it in the Patroni files of each node.
1 Answer 1
No.
Patroni will automatically perform
pg_basebackup
.see the answer to 3.
If you have a single etcd, you have a single point of failure. No good. You need to setup an etcd cluster on three nodes that don't share any hardware. Patroni communicates with that etcd cluster to determine who is up or down and who is to be the primary.
Explore related questions
See similar questions with these tags.