Reputation: 123
I found the log show like this
2017-03-10T03:33:29.158+0000 [###################.....] local.oplog.rs 4800969/6041391 (79.5%)
2017-03-10T03:33:31.023+0000 writing local.oplog.rs metadata to <dump_path>.......
2017-03-10T03:33:31.024+0000 done dumping local.oplog.rs (4809092 documents)
Does it backup completely or not? and Why is it show done if not finished?
Upvotes: 0
Views: 336
Reputation: 65383
The replication oplog is a capped collection so it is expected that the document count will not be accurate if you are running mongodump
for the oplog on a replica set member that is actively accepting writes. Older oplog documents will automatically be removed to make room for newer ones, so counts will fluctuate.
If you want to set up replication to a standby deployment, Mongo Connector would be a more suitable option. Mongo Connector is an open source tool that can replicate from a MongoDB deployment to another MongoDB deployment or an external system such as Solr or Elasticsearch.
If you want to backup a replica set member you should follow one of the supported Backup Methods in the documentation. For an active deployment (or one where data is much larger than RAM) the typical approach is using a backup agent (eg. MongoDB Cloud/Ops Manager) or filesystem snapshots.
Note: replication and backup can both help with data recovery, but serve different purposes. For backup planning you should consider factors like recovery point objectives, recovery time objectives, and performance impact on your production deployment when taking backups.
For more information see:
Upvotes: 1