Mongodb restore using PBM Requirements and consideration

Regarding PBM backup and restore.

In case of two different clusters with same cluster/replica sets/config servers name
Should the users on the backup source be identical to restore destination?

Nothing mentioned here regarding this Restore a backup - Percona Backup for MongoDB

But I tried to restore from Cluster A to Cluster B with same names and config (same number of shards and everything except different internal users creds including backup user and cluster admin and cluster monitor admin etc …

and restore failed after few minutes, state for PerconaServerMongodbRestore was running for around 10 minutes but then it failed with this error and config servers pods went into crashloop

check for concurrent jobs: getting pbm object: create PBM connection to psmdb-db-rs0-1.psmdb-db-rs0.psmdb-db-integration.svc.cluster.local:27017,psmdb-db-rs0-0.psmdb-db-rs0.psmdb-dd-integration.svc.cluster.local:27017,psmdb-db-rs0-2.psmdb-db-rs0.psmdb-db-integration.svc.cluster.local:27017: create mongo connection to configsvr with connection string ' mongodb://<CLUSTER-B_USER> : <CLUSTER_B_PASSWORD>@psmdb-db-cfg-0.psmdb-db-cfg.psmdb-db-integration.svc.cluster.local:27017,psmdb-db-cfg-1.psmdb-db-cfg.psmdb-db-integration.svc.cluster.local:27017,psmdb-db-cfg-2.psmdb-db-cfg.psmdb-db-integration.svc.cluster.local:27017/': mongo ping: connection() error occured during connection handshake: dial tcp: lookup psmdb-db-cfg-0.psmdb-db-cfg.psmdb-db-integration.svc.cluster.local on <LOCAL_IP>:53: no such host

After this I updated cluster B to use same creds as cluster A, Retried to restore and it worked.

1 Like

Hello @reab ,

just to clarify - are you talking about MongoDB clusters deployed with the Operator?

If so, you must have the same credentials for system users that Operator uses. You should set them in the Secrets. It is described here.

When restoring to a new Kubernetes-based environment, make sure it has a Secrets object with the same user passwords as in the original cluster. More details about secrets can be found in System Users. The name of the required Secrets object can be found out from the spec.secrets key in the deploy/cr.yaml (my-cluster-name-secrets by default).

And we are talking only about system users that Operator uses. Other users and roles can be different.

1 Like