You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
standby cluster that streams from a remote primary (zalando#1830)
* add the possibility to create a standby cluster that streams from a remote primary
* extending unit tests
* add more docs and e2e test
Co-authored-by: machine424 <[email protected]>
At the moment, the operator only allows to stream from the WAL archive of the
864
-
master. Thus, it is recommended to deploy standby clusters with only [one pod](https://github.com/zalando/postgres-operator/blob/master/manifests/standby-manifest.yaml#L10).
865
-
You can raise the instance count when detaching. Note, that the same pod role
866
-
labels like for normal clusters are used: The standby leader is labeled as
867
-
`master`.
863
+
```yaml
864
+
spec:
865
+
standby:
866
+
standby_host: "acid-minimal-cluster.default"
867
+
standby_port: "5433"
868
+
```
869
+
870
+
Note, that the pods and services use the same role labels like for normal clusters:
871
+
The standby leader is labeled as `master`. When using the `standby_host` option
872
+
you have to copy the credentials from the source cluster's secrets to successfully
873
+
bootstrap a standby cluster (see next chapter).
868
874
869
875
### Providing credentials of source cluster
870
876
871
877
A standby cluster is replicating the data (including users and passwords) from
872
878
the source database and is read-only. The system and application users (like
873
879
standby, postgres etc.) all have a password that does not match the credentials
874
-
stored in secrets which are created by the operator. One solution is to create
875
-
secrets beforehand and paste in the credentials of the source cluster.
876
-
Otherwise, you will see errors in the Postgres logs saying users cannot log in
877
-
and the operator logs will complain about not being able to sync resources.
880
+
stored in secrets which are created by the operator. You have two options:
878
881
879
-
When you only run a standby leader, you can safely ignore this, as it will be
880
-
sorted out once the cluster is detached from the source. It is also harmless if
881
-
you don’t plan it. But, when you created a standby replica, too, fix the
882
-
credentials right away. WAL files will pile up on the standby leader if no
883
-
connection can be established between standby replica(s). You can also edit the
884
-
secrets after their creation. Find them by:
882
+
a. Create secrets manually beforehand and paste the credentials of the source
883
+
cluster
884
+
b. Let the operator create the secrets when it bootstraps the standby cluster.
885
+
Patch the secrets with the credentials of the source cluster. Replace the
886
+
spilo pods.
885
887
886
-
```bash
887
-
kubectl get secrets --all-namespaces | grep <standby-cluster-name>
888
-
```
888
+
Otherwise, you will see errors in the Postgres logs saying users cannot log in
889
+
and the operator logs will complain about not being able to sync resources.
890
+
If you stream changes from a remote primary you have to align the secrets or
891
+
the standby cluster will not start up.
892
+
893
+
If you stream changes from WAL files and you only run a standby leader, you
894
+
can safely ignore the secret mismatch, as it will be sorted out once the
895
+
cluster is detached from the source. It is also harmless if you do not plan it.
896
+
But, when you create a standby replica, too, fix the credentials right away.
897
+
WAL files will pile up on the standby leader if no connection can be
0 commit comments