How it works...
We were serious when we said this recipe would be fairly simple. By calling patronictl with the failover parameter, we're telling it that we definitely want to promote another node to primary status.
The -d flag allows us to specify etcd as a configuration source and is usually the safer option since it should always reflect the current state of the cluster.
Our example targeted the pgha1 server on the etcd port of 2379, but we could have used any of the cluster systems. Since the distributed key-value system may play host to any number of clusters, we must also specify stampede as the name of the cluster we want to manage.
Once we invoke the failover command, Patroni asks multiple questions to verify the process to make absolutely ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access