Hi,
Hoping someone can help! We’ve set up a MongoDB Sharded Cluster via the MongoDB Operator - all working well, performance is great, and we’re really happy. However - the last thing we need to work out is backups. We’re on AWS, trying to upload to S3.
I’ve followed the guide and done the following:
- Updated cr.yaml to enable backups, and set the details
- Applied a backup-secret.yaml file, containing B64-encoded AWS Creds
- Added a daily task to backup in cr.yaml
All of the backups error, either manually triggered ones or ones from the task.
cr.yaml:
backup:
enabled: true
debug: true
restartOnFailure: true
image: percona/percona-server-mongodb-operator:1.11.0-backup
serviceAccountName: percona-server-mongodb-operator
storages:
s3-eu-west-2:
type: s3
s3:
bucket: <bucket-name>
credentialsSecret: my-cluster-name-backup-s3
region: eu-west-2
pitr:
enabled: false
tasks:
- name: daily-s3-eu-west
enabled: true
schedule: "0 0 * * *"
keep: 3
storageName: s3-eu-west-2
compressionType: gzip
backup-secret.yaml:
apiVersion: v1
kind: Secret
metadata:
name: my-cluster-name-backup-s3
type: Opaque
data:
AWS_ACCESS_KEY_ID: <key>
AWS_SECRET_ACCESS_KEY: <key>
The output of “kubectl get psmdb-backup” is as follows:
NAME CLUSTER STORAGE DESTINATION STATUS COMPLETED AGE
backup1 my-cluster-name s3-eu-west-2 2022-03-21T09:23:33Z error 87m
backup2 my-cluster-name s3-eu-west-2 2022-03-21T10:08:05Z error 42m
cron-my-cluster-name-20220317000002-d5nwq my-cluster-name s3-eu-west-2 2022-03-17T00:00:24Z error 4d10h
cron-my-cluster-name-20220318000002-tzmhn my-cluster-name s3-eu-west-2 2022-03-18T00:00:24Z error 3d10h
cron-my-cluster-name-20220319000002-lc54j my-cluster-name s3-eu-west-2 2022-03-19T00:00:24Z error 2d10h
cron-my-cluster-name-20220320000001-mcrzw my-cluster-name s3-eu-west-2 2022-03-20T00:00:23Z error 34h
cron-my-cluster-name-20220321000001-2t876 my-cluster-name s3-eu-west-2 2022-03-21T00:00:23Z error 10h
And the error I get from all of the backups (from running “kubectl get psmdb-backup -o yaml”) is as follows:
apiVersion: psmdb.percona.com/v1
kind: PerconaServerMongoDBBackup
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"psmdb.percona.com/v1","kind":"PerconaServerMongoDBBackup","metadata":{"annotations":{},"name":"backup1","namespace":"mongo"},"spec":{"psmdbCluster":"my-cluster-name","storageName":"s3-eu-west-2"}}
creationTimestamp: "2022-03-21T09:23:12Z"
generation: 1
name: backup1
namespace: mongo
resourceVersion: "2189522"
uid: 89007408-3439-4b52-a406-af71643f7b40
spec:
psmdbCluster: my-cluster-name
storageName: s3-eu-west-2
status:
azure:
credentialsSecret: ""
destination: "2022-03-21T09:23:33Z"
error: starting deadline exceeded
lastTransition: "2022-03-21T09:23:34Z"
pbmName: "2022-03-21T09:23:33Z"
s3:
bucket: <bucket>
credentialsSecret: my-cluster-name-backup-s3
region: eu-west-2
start: "2022-03-21T09:23:34Z"
state: error
storageName: s3-eu-west-2
Can anyone help me diagnose?