From e1ed4c7350895338866cc1f5c7ebf04a90cdc001 Mon Sep 17 00:00:00 2001 From: Brett Edwards Date: Tue, 10 Dec 2024 15:44:33 -0800 Subject: [PATCH] instructions --- docs/database/CLUSTER_DB.MD | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/database/CLUSTER_DB.MD b/docs/database/CLUSTER_DB.MD index c690374b2..b2c324685 100644 --- a/docs/database/CLUSTER_DB.MD +++ b/docs/database/CLUSTER_DB.MD @@ -56,8 +56,12 @@ Spin up the Repo-Standby Cluster with: ### Promoting a Standby Cluster Once a standby is stood up, it can be promoted to be the primary cluster. **Note: only do this if the existing primary has been shut down first.** +You can shutdown the primary cluster with this command: +`kubectl patch postgrescluster/ --type merge --patch '{"spec":{"shutdown": true}}'` +You can determine that the cluster is fully shutdown when there are no StatefulSet pods running for that cluster. Promote the standby cluster by editing the [crunchy_standby.yaml](../../openshift/templates/crunchy_standby.yaml) to set the `standby` field to `false`. +You can determine that promotion has completed when the logs of the standby StatefulSet show a leader has been elected. More details here: @@ -66,8 +70,19 @@ More details here: " TO "";` - -Once this is done, the deployment using the crunchy secrets will need to be updated. This can be done by manually editing the deployment YAML and changing all config that referenced the original crunchy secrets to the newly promoted standby cluster secrets. Once this is done, new pods should roll out successfully. +Use `\du` in psql to see users in the database. + +Once this is done, the deployment using the crunchy secrets and cluster references will need to be updated. This can be done by manually editing the deployment YAML in the Openshift UI and changing all config that referenced the original crunchy cluster to the newly promoted standby cluster secrets. Once this is done, new pods should roll out successfully. + +- Change to name of new cluster secret + - POSTGRES_READ_USER + - POSTGRES_WRITE_USER + - POSTGRES_PASSWORD + - POSTGRES_WRITE_HOST + - POSTGRES_READ_HOST + - POSTGRES_PORT +- Change to name of new cluster + - PATRONI_CLUSTER_NAME ## Cluster Restore From pg_dump