mongodb error while taking backup of oplog.$main collection for point in time recovery

33 views
Skip to first unread message

meghan

unread,
Nov 17, 2017, 2:02:16 AM11/17/17
to mongodb-user
HI...
I am using mongodb 3.4 and I am trying for point in time recovery.
I have started my mongod instance with master-slave replication with --master option.
After that inserted some sample collections & took backup of that. Then inserted some more collections and trying to take backup of oplog.$main collection. 
But i am getting below error.
mongodump -d local -c oplog.$main --port 27021 -o /backup/oplog/
2017-11-17T12:19:17.078+0530    the collection local.oplog. appears to have been dropped after the dump started
2017-11-17T12:19:17.078+0530    writing local.oplog. to
2017-11-17T12:19:17.078+0530    done dumping local.oplog. (0 documents)

Anyone know the reson...

Many Thanks!!!

Rhys Campbell

unread,
Nov 17, 2017, 10:08:40 AM11/17/17
to mongodb-user
The oplog is usually called oplog.rs but I guess this is different for the master/slave mode. Has the collection name really got a dollar in it?

If it has you will need to escape it as the shell with think it's a variable. Note in your output...

2017-11-17T12:19:17.078+0530    writing local.oplog. to

Placing single quotes around the colllection name should do it....
Reply all
Reply to author
Forward
0 new messages