Cant execute incremental backup

Hi,

Got everything running, system is 3 nodes with 1 replica, got a backup container for every container. im able to run psyhical backup, but getting error below when trying to run incremental.
Note: the mongodb container is the mongo community editon, not perconas.

Hi @Pjotz ,

The Physical, Incremental, and Snapshot-based backups are only possible with Percona Server for MongoDB. PSMDB has $backupCursor, which is not available in Community Edition.

The error tells: no available PBM agents (or proper mongod) for backups (in your case, incremental).

With MongoDB Community Edition, you can only have Full Logical, Selective Logical, and Point-in-Time recovery backups.

However, since PBM 2.3.0, you can set up a mixed environment - replace one or more CE node(s) with PSMDB mongod in each replsets. In this case, PBM will try to do other backups. Later, you can restore with CE-only instances.

PSMDB is fully compatible with CE (just with extra enterprise-level features available for everyone).

You can do this in one of two ways:

  • replace existing node(s) with PSMDB
  • add one hidden PSMDB node with PBM and one arbiter node (for voting balance; no agent is needed for the arbiter)

Thanks for the reply, have gotten everything running, and gotten the first incremental backup done, when i try to restore i get this error message?

when i check the user on the node:
image

Are you running PBM as a sidecar (not inside the same mongod container)?

For physical/incremental restore, PBM agent must have ability to execute mongod binary (it can be available by $PATH env var or customized by restore.mongodLocation / restore.mongodLocationMap config.

PBM Agents perform important MongoDB nodes and cluster config preparations during restore from physical backups.

Additionally to the blog article, take a look at PBM docs: Physical backups and restores

Hi, yeah running as a sidecar, didnt know the option for running the pbm agent inside the percona-mongodb-server was an option? because the pbm-agent is not installed there by default as i can see.

i would rather run both in same container if you got the recipy for that.

We do not provide docker images for PBM with PSMDB inside.

You will need to build your own image using Percona Software Repositories to install PSDMB and PBM for the image.

Hello again,

Tried to create the container with both service, with no luck, cannot get it to start both services. so I´m back to the sidecar. and tried the solution with the mongoLocation: and still getting an error. when i try to execute the binary inside the node container it can win.


configfile:
storage:
type: filesystem
filesystem:
path: /opt/backup/
restore:
mongodLocation: /usr/bin/mongod

[mongodb@mongodb_backup_cfg_server1 /]$ cat /opt/xci/percona/storage.yaml
storage:
type: filesystem
filesystem:
path: /opt/xci/backup/
restore:
mongodLocation: /usr/bin/mongod

PBM LOGS:

[mongodb@mongodb_backup_cfg_server1 /]$ pbm logs
2023-10-09T10:25:17Z I [mongo_conf/mongodb_content_cfg_server3:27017] [restore/2023-10-09T10:25:17.375588822Z] backup: 2023-10-06T09:25:38Z
2023-10-09T10:25:17Z I [mongo_conf/mongodb_content_cfg_server1:27017] [restore/2023-10-09T10:25:17.375588822Z] recovery started
2023-10-09T10:25:17Z I [mongo_conf/mongodb_content_cfg_server3:27017] [restore/2023-10-09T10:25:17.375588822Z] recovery started
2023-10-09T10:25:17Z I [mongo_conf/mongodb_content_cfg_server2:27017] got command restore [name: 2023-10-09T10:25:17.375588822Z, snapshot: 2023-10-06T09:25:38Z] <ts: 1696847117>
2023-10-09T10:25:17Z I [mongo_conf/mongodb_content_cfg_server2:27017] got epoch {1696832006 5}
2023-10-09T10:25:17Z E [mongo_conf/mongodb_content_cfg_server1:27017] [restore/2023-10-09T10:25:17.375588822Z] restore: check mongod binary: run: fork/exec /usr/bin/mongod: no such file or directory. stderr:
2023-10-09T10:25:17Z I [mongo_conf/mongodb_content_cfg_server2:27017] [restore/2023-10-09T10:25:17.375588822Z] backup: 2023-10-06T09:25:38Z
2023-10-09T10:25:17Z E [mongo_conf/mongodb_content_cfg_server3:27017] [restore/2023-10-09T10:25:17.375588822Z] restore: check mongod binary: run: fork/exec /usr/bin/mongod: no such file or directory. stderr:
2023-10-09T10:25:17Z I [mongo_conf/mongodb_content_cfg_server2:27017] [restore/2023-10-09T10:25:17.375588822Z] recovery started
2023-10-09T10:25:17Z E [mongo_conf/mongodb_content_cfg_server2:27017] [restore/2023-10-09T10:25:17.375588822Z] restore: check mongod binary: run: fork/exec /usr/bin/mongod: no such file or directory. stderr:
2023-10-09T10:25:17Z I [mongo_data_rs1/mongodb_content_rs1n1:27017] got command restore [name: 2023-10-09T10:25:17.375588822Z, snapshot: 2023-10-06T09:25:38Z] <ts: 1696847117>
2023-10-09T10:25:17Z I [mongo_data_rs1/mongodb_content_rs1n1:27017] got epoch {1696832006 5}
2023-10-09T10:25:17Z I [mongo_data_rs1/mongodb_content_rs1n1:27017] [restore/2023-10-09T10:25:17.375588822Z] backup: 2023-10-06T09:25:38Z
2023-10-09T10:25:17Z I [mongo_data_rs1/mongodb_content_rs1n1:27017] [restore/2023-10-09T10:25:17.375588822Z] recovery started
2023-10-09T10:25:18Z E [mongo_data_rs1/mongodb_content_rs1n1:27017] [restore/2023-10-09T10:25:17.375588822Z] restore: check mongod binary: run: fork/exec /usr/bin/mongod: no such file or directory. stderr:
2023-10-09T10:25:18Z I [mongo_data_rs2/mongodb_content_rs2n1:27017] got command restore [name: 2023-10-09T10:25:17.375588822Z, snapshot: 2023-10-06T09:25:38Z] <ts: 1696847117>
2023-10-09T10:25:18Z I [mongo_data_rs2/mongodb_content_rs2n1:27017] got epoch {1696832006 5}
2023-10-09T10:25:18Z I [mongo_data_rs2/mongodb_content_rs2n1:27017] [restore/2023-10-09T10:25:17.375588822Z] backup: 2023-10-06T09:25:38Z
2023-10-09T10:25:18Z I [mongo_data_rs2/mongodb_content_rs2n1:27017] [restore/2023-10-09T10:25:17.375588822Z] recovery started
2023-10-09T10:25:18Z E [mongo_data_rs2/mongodb_content_rs2n1:27017] [restore/2023-10-09T10:25:17.375588822Z] restore: check mongod binary: run: fork/exec /usr/bin/mongod: no such file or directory. stderr:

when running command in the node container:

[mongodb@mongodb_content_rs1n1 /]$ whoami
mongodb
[mongodb@mongodb_content_rs1n1 /]$ /usr/bin/mongod
{“t”:{“$date”:“2023-10-09T10:26:58.385+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23285, “ctx”:“main”,“msg”:“Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols ‘none’”}
{“t”:{“$date”:“2023-10-09T10:26:58.388+00:00”},“s”:“I”, “c”:“NETWORK”, “id”:4648601, “ctx”:“main”,“msg”:“Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize.”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:4615611, “ctx”:“initandlisten”,“msg”:“MongoDB starting”,“attr”:{“pid”:157,“port”:27017,“dbPath”:“/data/db”,“architecture”:“64-bit”,“host”:“mongodb_content_rs1n1”}}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“W”, “c”:“CONTROL”, “id”:20720, “ctx”:“initandlisten”,“msg”:“Available memory is less than system memory”,“attr”:{“availableMemSizeMB”:16384,“systemMemSizeMB”:96575}}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23403, “ctx”:“initandlisten”,“msg”:“Build Info”,“attr”:{“buildInfo”:{“version”:“4.4.23-22”,“gitVersion”:“6dbe14d25e2a4ba0515610749b1afe4119b06c42”,“openSSLVersion”:“OpenSSL 1.1.1k FIPS 25 Mar 2021”,“modules”:,“allocator”:“tcmalloc”,“environment”:{“distarch”:“x86_64”,“target_arch”:“x86_64”}}}}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:51765, “ctx”:“initandlisten”,“msg”:“Operating System”,“attr”:{“os”:{“name”:“Oracle Linux Server release 8.8”,“version”:“Kernel 5.4.0-139-generic”}}}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:21951, “ctx”:“initandlisten”,“msg”:“Options set by command line”,“attr”:{“options”:{}}}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“E”, “c”:“STORAGE”, “id”:20568, “ctx”:“initandlisten”,“msg”:“Error setting up listener”,“attr”:{“error”:{“code”:9001,“codeName”:“SocketException”,“errmsg”:“Address already in use”}}}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“REPL”, “id”:4784900, “ctx”:“initandlisten”,“msg”:“Stepping down the ReplicationCoordinator for shutdown”,“attr”:{“waitTimeMillis”:10000}}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“COMMAND”, “id”:4784901, “ctx”:“initandlisten”,“msg”:“Shutting down the MirrorMaestro”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“SHARDING”, “id”:4784902, “ctx”:“initandlisten”,“msg”:“Shutting down the WaitForMajorityService”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“NETWORK”, “id”:4784905, “ctx”:“initandlisten”,“msg”:“Shutting down the global connection pool”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“NETWORK”, “id”:4784918, “ctx”:“initandlisten”,“msg”:“Shutting down the ReplicaSetMonitor”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“SHARDING”, “id”:4784921, “ctx”:“initandlisten”,“msg”:“Shutting down the MigrationUtilExecutor”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:4784925, “ctx”:“initandlisten”,“msg”:“Shutting down free monitoring”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:4784927, “ctx”:“initandlisten”,“msg”:“Shutting down the HealthLog”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“STORAGE”, “id”:4784929, “ctx”:“initandlisten”,“msg”:“Acquiring the global lock for shutdown”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“-”, “id”:4784931, “ctx”:“initandlisten”,“msg”:“Dropping the scope cache for shutdown”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“FTDC”, “id”:4784926, “ctx”:“initandlisten”,“msg”:“Shutting down full-time data capture”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:20565, “ctx”:“initandlisten”,“msg”:“Now exiting”}
{“t”:{“$date”:“2023-10-09T10:26:58.389+00:00”},“s”:“I”, “c”:“CONTROL”, “id”:23138, “ctx”:“initandlisten”,“msg”:“Shutting down”,“attr”:{“exitCode”:48}}
[mongodb@mongodb_content_rs1n1 /]$

what am i doing wrong?

@Dmytro_Zghoba any ideas?

the most simplest way I found

FROM mongo:6.0 as mongo
FROM percona/percona-backup-mongodb:2.3.0

COPY --from=mongo /bin/mongod /bin/
1 Like

Thank you for that, had missed that it was missing mongod inside the backup sidecar. now that is done. it acctully starts the restore without any errors. Tho, as you can follow on the screenshot below.

  1. starts restore of incremental backup
  2. stuck at waiting
  3. logs stuck at waiting for cluster
  4. pbm agent lost connection and not comming back up.
  5. nothing is restored, but all docker containers are running.

I have tried to create a single container with both backup and mongo server, but without any success.




PBM shuts down the mongod process during physical restore. Docker Engine could start it again.

Physical/incremental backup is a copy of –dbpth. To restore, PBM has to shut down the mongod process and replace the dbpath (and do extra work using mongod binary).
The mongod process should not start during restore. (if it starts, the dbpath data will be broken.) Make sure the restart policy does not restart the mongod process/container.
Start cluster when PBM report about successful restore.

Also, all mongos instances should be down during restore period.