To set-up wal shipping in primary cluster:
- In the file manifests/configmap.yaml, uncomment the line containing wal_s3_bucket and set it to the bucket name created in MinIO.
- And then, add the following lines to the same file:
pod_environment_configmap: postgres-pod-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-pod-config
namespace: default
data:
AWS_ACCESS_KEY_ID: <MinIO access key>
AWS_SECRET_ACCESS_KEY: <MinIO secret key>
AWS_S3_FORCE_PATH_STYLE: "true"
AWS_REGION: us-east-1
AWS_ENDPOINT: <MinIO endpoint (e.g. http://<MinIO server IP>:9000)>
USE_WALG_BACKUP: "true"
WALG_DISABLE_S3_SSE: "true"
To set-up replication in standby cluster:
- Add the following to the file manifests/configmap.yaml
pod_environment_configmap: postgres-pod-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-pod-config
namespace: default
data:
STANDBY_AWS_ACCESS_KEY_ID: <MinIO access key>
STANDBY_AWS_SECRET_ACCESS_KEY: <MinIO secret key>
STANDBY_WALE_ENV_DIR: /home/postgres/etc/wal-e.d/env-standby
STANDBY_USE_WALG_RESTORE: "true"
STANDBY_AWS_S3_FORCE_PATH_STYLE: "true"
STANDBY_AWS_REGION: us-east-1
STANDBY_AWS_ENDPOINT: <MinIO endpoint (e.g. http://<MinIO Server IP>:9000)>
- In the file manifests/standby-manifest.yaml, edit s3_wal_path to use the bucket/path name from the MinIO. For example,
s3_wal_path: "s3://<bucket_name>/spilo/acid-minimal-cluster/1a793032-ba83-11e9-8bc8-080027377c7c/wal/"
- Finally start the operator/pods with this manifest (standby-manifest.yaml).
It is the uid of the primary cluster (not standby cluster). You can get it by running the following command:
kubectl get postgresql <primary_cluster_name> -o=jsonpath='{.metadata.uid}'