我想通过pgbackrest使用来自s3的备份来测试恢复群集
我有: OpenShift 4.7PGO镜像标签: centos8-13.2-4.6.2 Postgres version13
如何重现:
Step1:我安装了crunchy operator并创建了集群:
pgo create cluster example-db \
--pgbouncer \
--replica-count=1 \
--password-superuser="%%%%%" \
--password-replication="%%%%%" \
--database test-db \
--username test-user \
--password="%%%%%%" \
--pvc-size 20Gi \
--pgbackrest-pvc-size 40Gi \
--metrics \
--pgbackrest-storage-type=s3 \
--pgbackrest-s3-key=test-db-backup-rw \
--pgbackrest-s3-key-secret=%%%%% \
--pgbackrest-s3-bucket=test-db-backup \
--pgbackrest-s3-endpoint=s3.my_site.com \
--pgbackrest-s3-uri-style=path \
--pgbackrest-s3-verify-tls=false没问题的。
步骤2:创建备份
pgo backup example-db --backup-opts="--type=full --repo1-retention-full=3 --archive-timeout=300" --pgbackrest-storage-type=s3这也没问题。
步骤3:移除集群(模拟这个集群的丢失)。
pgo delete cluster example-db备份仍保留在s3中。
第4步:我正在尝试通过创建备用群集来恢复此群集
pgo create cluster standby-test-db \
--standby \
--pgbouncer \
--replica-count=1 \
--password-superuser="%%%%%" \
--password-replication="%%%%" \
--database test-db \
--username test-user \
--password="%%%%" \
--pvc-size 20Gi \
--pgbackrest-pvc-size 40Gi \
--metrics \
--pgbackrest-storage-type=s3 \
--pgbackrest-s3-key=test-db-backup-rw \
--pgbackrest-s3-key-secret=%%%%% \
--pgbackrest-s3-bucket=test-db-backup \
--pgbackrest-s3-endpoint=s3.my_site.com \
--pgbackrest-s3-uri-style=path \
--pgbackrest-s3-verify-tls=false \
--pgbackrest-repo-path=/backrestrepo/example-db-backrest-shared-repo我在我的pod中得到了很多相同的警告:
...
�[0;33mTue Jun 22 16:30:16 UTC 2021 WARN: Detected an earlier failed attempt to initialize�[0m
�[0;32mTue Jun 22 16:30:16 UTC 2021 INFO: Correct the issue, remove '/pgdata/standby-test-db.initializing', and try again�[0m
�[0;32mTue Jun 22 16:30:16 UTC 2021 INFO: Your data might be in: /pgdata/standby-test-db_*�[0m
�[0;33mTue Jun 22 16:30:26 UTC 2021 WARN: Detected an earlier failed attempt to initialize�[0m
�[0;32mTue Jun 22 16:30:26 UTC 2021 INFO: Correct the issue, remove '/pgdata/standby-test-db.initializing', and try again�[0m
�[0;32mTue Jun 22 16:30:26 UTC 2021 INFO: Your data might be in: /pgdata/standby-test-db_*�[0m
...如果我删除了/pgdata/standby-test-db_*,那么如果我重新启动pod - /pgdata/standby-test-db_*,它不会改变消息--/pgdata/standby-test-db_*会被再次创建。
我完全搞不懂这个问题。
发布于 2021-06-28 23:58:50
我研究了这个问题,发现pgbackrest找不到正确的完整备份。我重新创建了一个完整备份,问题就解决了。
https://stackoverflow.com/questions/68096665
复制相似问题