Kubernetes mongodb with replicasets backup

1/29/2020

can someone please help me to take mongodb backup with replicasets. We are using kubernetest which is deployed in AWS, I deployed mongodb with replicasets in kubernetes using helm chart and tried to take backup using velero and restic, I could able to take backup of mongodb but when I restore sometime pods are not coming up and errors are like corrupted db or checksum did not match etc.

Can someone please let me know how to take mongodb backup in kubernetes without stopping mongodb server i.e hot backup. Appreciate your inputs.

-- Ram
database-backups
kubernetes
mongodb
mongodb-replica-set

1 Answer

1/29/2020

use mongodump with --oplog option for point in time hot backups. See https://docs.mongodb.com/manual/reference/program/mongodump/#cmdoption-mongodump-oplog. This option is not available on a stand-alone. Even if you only have a single server you can convert to a single member replica set for oplog functionality.

-- barrypicker
Source: StackOverflow