Hello everyone.
Try to do incremental backup with percona tools:
percona/percona-backup-mongodb:2.1.0
percona/percona-server-mongodb:6.0.6-5
- running cluster into docker,
docker-compose up -d pdmdb_master pdmdb_slave pdmdb-init-replica
services:
pdmdb_master:
container_name: pdmdb_master
image: percona/percona-server-mongodb:6.0.6-5
ports:
- 27022:27017
restart: unless-stopped
networks:
- pdmdb-network
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "dbrs", "--oplogSize=2148" ]
pdmdb_slave:
container_name: pdmdb_slave
image: percona/percona-server-mongodb:6.0.6-5
ports:
- 27023:27017
restart: unless-stopped
networks:
- pdmdb-network
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "dbrs", "--oplogSize=2148" ]
pdmdb-init-replica:
container_name: pdmdb_replica
image: percona/percona-server-mongodb:6.0.6-5
volumes:
- ./rs-init.sh:/scripts/rs-init.sh
restart: "no"
networks:
- pdmdb-network
depends_on:
- pdmdb_master
- pdmdb_slave
command: >
/scripts/rs-init.sh
pdmdb-backup-master:
container_name: pdmdb_backup_master
image: percona/percona-backup-mongodb:2.1.0
volumes:
- ./mongodb_backup:/mongodb_backup
- ./pbm_config.yaml:/etc/pbm_config.yaml
networks:
- pdmdb-network
environment:
PBM_MONGODB_URI: "mongodb://pdmdb_master:27017/?replicaSet=dbrs"
depends_on:
- pdmdb_master
- pdmdb_slave
user: root
command: >
bash -c "pbm config --file /etc/pbm_config.yaml &&
pbm-agent"
pdmdb-backup-slave:
container_name: pdmdb_backup_slave
image: percona/percona-backup-mongodb:2.1.0
volumes:
- ./mongodb_backup:/mongodb_backup
- ./pbm_config.yaml:/etc/pbm_config.yaml
networks:
- pdmdb-network
environment:
PBM_MONGODB_URI: "mongodb://pdmdb_slave:27017/?replicaSet=dbrs"
depends_on:
- pdmdb_master
- pdmdb_slave
user: root
command: >
bash -c "pbm config --file /etc/pbm_config.yaml &&
pbm-agent"
networks:
pdmdb-network:
driver: bridge
- try to do incremental backup:
docker-compose run pdmdb-backup
pbm config --file /etc/pbm_config.yaml
pbm-agent 2> /pbm_log.txt &
Cluster:
========
dbrs:
- dbrs/pdmdb_master:27017 [P]: pbm-agent v2.1.0 OK
- dbrs/pdmdb_slave:27017 [S]: pbm-agent v2.1.0 OK
PITR incremental backup:
========================
Status [OFF]
Currently running:
==================
(none)
Backups:
========
FS /mongodb_backup
Snapshots:
2023-07-04T02:19:57Z 0.00B <incremental, base> [ERROR: upload file `/data/db/journal/WiredTigerLog.0000000001`: get file stat: stat /data/db/journal/WiredTigerLog.0000000001: no such file or directory] [2023-07-04T02:20:03Z]
pbm backup --type incremental --base
my log is:
2023-07-04T01:19:36.000+0000 I starting PITR routine
2023-07-04T01:19:36.000+0000 I node: dbrs/pdmdb_master:27017
2023-07-04T01:19:36.000+0000 I listening for the commands
2023-07-04T01:19:41.000+0000 W [agentCheckup] get current storage status: query mongo: mongo: no documents in result
2023-07-04T01:19:43.000+0000 I got command backup [name: 2023-07-04T01:19:43Z, compression: s2 (level: default)] <ts: 1688433583>
2023-07-04T01:19:43.000+0000 I got epoch {1688433554 10}
2023-07-04T01:19:43.000+0000 D [backup/2023-07-04T01:19:43Z] init backup meta
2023-07-04T01:19:43.000+0000 D [backup/2023-07-04T01:19:43Z] nomination list for dbrs: [[pdmdb_master:27017]]
2023-07-04T01:19:43.000+0000 D [backup/2023-07-04T01:19:43Z] nomination dbrs, set candidates [pdmdb_master:27017]
2023-07-04T01:19:44.000+0000 I [backup/2023-07-04T01:19:43Z] backup started
2023-07-04T01:19:45.000+0000 D [backup/2023-07-04T01:19:43Z] flush incremental backup history
2023-07-04T01:19:45.000+0000 D [backup/2023-07-04T01:19:43Z] backup cursor id: b086c445-0e36-464e-96c2-ebdaf3519fe9
2023-07-04T01:19:48.000+0000 D [backup/2023-07-04T01:19:43Z] set journal up to {1688433585 2}
2023-07-04T01:19:48.000+0000 I [backup/2023-07-04T01:19:43Z] uploading data
2023-07-04T01:19:48.000+0000 D [backup/2023-07-04T01:19:43Z] stop cursor polling: <nil>, cursor err: <nil>
2023-07-04T01:19:48.000+0000 I [backup/2023-07-04T01:19:43Z] mark RS as error `upload file `/data/db/index-44-9164515937719912368.wt`: get file stat: stat /data/db/index-44-9164515937719912368.wt: no such file or directory`: <nil>
2023-07-04T01:19:48.000+0000 I [backup/2023-07-04T01:19:43Z] mark backup as error `upload file `/data/db/index-44-9164515937719912368.wt`: get file stat: stat /data/db/index-44-9164515937719912368.wt: no such file or directory`: <nil>
2023-07-04T01:19:48.000+0000 E [backup/2023-07-04T01:19:43Z] backup: upload file `/data/db/index-44-9164515937719912368.wt`: get file stat: stat /data/db/index-44-9164515937719912368.wt: no such file or directory
2023-07-04T01:19:48.000+0000 D [backup/2023-07-04T01:19:43Z] releasing lock
or
pbm-agent'
pitr:
enabled: false
oplogSpanMin: 0
compression: s2
storage:
type: filesystem
filesystem:
path: /mongodb_backup
backup:
compression: s2
2023-07-04T02:18:04.000+0000 I pbm-agent:
Version: 2.1.0
Platform: linux/amd64
GitCommit: 342b5b9c996e8bd17a678ea0cecbf2eaaf9704ab
GitBranch: release-2.1.0
BuildTime: 2023-04-14_12:23_UTC
GoVersion: go1.19
2023-07-04T02:18:04.000+0000 I node: dbrs/pdmdb_slave:27017
2023-07-04T02:18:04.000+0000 I starting PITR routine
2023-07-04T02:18:04.000+0000 I listening for the commands
2023-07-04T02:18:04.000+0000 I got command resync <ts: 1688437084>
2023-07-04T02:18:04.000+0000 I got epoch {1688437084 3}
2023-07-04T02:18:04.000+0000 D [resync] lock not acquired
2023-07-04T02:18:09.000+0000 W [agentCheckup] get current storage status: query mongo: mongo: no documents in result
2023-07-04T02:19:58.000+0000 I got command backup [name: 2023-07-04T02:19:57Z, compression: s2 (level: default)] <ts: 1688437197>
2023-07-04T02:19:58.000+0000 I got epoch {1688437084 24}
2023-07-04T02:19:59.000+0000 I [backup/2023-07-04T02:19:57Z] backup started
2023-07-04T02:20:00.000+0000 D [backup/2023-07-04T02:19:57Z] flush incremental backup history
2023-07-04T02:20:00.000+0000 D [backup/2023-07-04T02:19:57Z] backup cursor id: dcaae42e-2b68-4f45-a68d-c2628c8ea487
2023-07-04T02:20:03.000+0000 D [backup/2023-07-04T02:19:57Z] set journal up to {1688437200 2}
2023-07-04T02:20:03.000+0000 I [backup/2023-07-04T02:19:57Z] uploading data
2023-07-04T02:20:03.000+0000 D [backup/2023-07-04T02:19:57Z] stop cursor polling: <nil>, cursor err: <nil>
2023-07-04T02:20:03.000+0000 I [backup/2023-07-04T02:19:57Z] mark RS as error `upload file `/data/db/journal/WiredTigerLog.0000000001`: get file stat: stat /data/db/journal/WiredTigerLog.0000000001: no such file or directory`: <nil>
2023-07-04T02:20:03.000+0000 I [backup/2023-07-04T02:19:57Z] mark backup as error `upload file `/data/db/journal/WiredTigerLog.0000000001`: get file stat: stat /data/db/journal/WiredTigerLog.0000000001: no such file or directory`: <nil>
2023-07-04T02:20:03.000+0000 E [backup/2023-07-04T02:19:57Z] backup: upload file `/data/db/journal/WiredTigerLog.0000000001`: get file stat: stat /data/db/journal/WiredTigerLog.0000000001: no such file or directory
2023-07-04T02:20:03.000+0000 D [backup/2023-07-04T02:19:57Z] releasing lock
what is wrong i did?