mongodump with replica set with oplog throws error: "oplog mode is only supported on full dumps"
Asked Answered
J

1

6

I have a replica set with 3 members. Each one is running mongod 2.4.8 on Linux. I am using MMS agent to monitor the health of my replicaset/hosts and all appears ok.

I am using mongodump to backup my dbs & can do a successful dump if I don't use the --oplog switch, like this:

mongodump -v --db "mydb" --out /backups

However, as I am backing up live db's I want to use the --oplog switch. So I have modified my command to include the --oplog switch and specify my replica set in the --hosts switch:

mongodump -v --oplog --host myrepset/m1:27017,m2:27017,m3:27017 --db "mydb" --out /backup

However, this command fails with this error: oplog mode is only supported on full dumps

This is apparently the same error that would be thrown when trying to use the --oplog switch on a single instance.

I have read the mongo tutorials & reference pages, but don't understand what I am doing wrong. http://docs.mongodb.org/manual/reference/program/mongodump/

Any help much appreciated.

Joelie answered 15/5, 2014 at 15:39 Comment(2)
this of dump of "mydb" as being a partial dump (in contrast to full dump).Schmidt
Thanks for pointing that out Asya - I missed that vital "full dump" clue in the error messageJoelie
V
8

The --oplog option for mongodump is for full dumps, not for those specifying an individual database. In order to run it you'll need to remove the --db "mydb" from the mongodump command.

Vibrissa answered 15/5, 2014 at 17:43 Comment(1)
For the record, this is the command I am now using: mongodump -v --oplog --out /backup which dumps all dbs to the folder specifiedJoelie

© 2022 - 2024 — McMap. All rights reserved.