-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Environment:mongod --version
db version v2.4.3
mongooplog --version
mongooplog version 2.4.3
*Location*: http://docs.mongodb.org/manual/reference/mongooplog/
*User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22
*Referrer*: https://www.google.com/
*Screen Resolution*: 1920 x 1080
*repo*: docs
*source*: reference/mongooplog
mongod --version db version v2.4.3 mongooplog --version mongooplog version 2.4.3 *Location*: http://docs.mongodb.org/manual/reference/mongooplog/ *User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22 *Referrer*: https://www.google.com/ *Screen Resolution*: 1920 x 1080 *repo*: docs *source*: reference/mongooplog
Documentation page has an example of using --database option
mongooplog --from mongodb0.example.net --host mongodb1.example.net --database people --collection usage
Stating
In the next command, the parameters limit this operation to only apply operations to the database people in the collection usage on the target host (i.e. mongodb1.example.net):
But the option does not work - I guess "-database" has been renamed to "-db":
$ mongooplog --from 127.0.0.1:20000 --port 20010 --database d01 ERROR: unknown option database
Unfortunately when db is used the mongooplog does not act as described - it applies changes to all database - not only the one specified:
Add doc to replica set "rs0" database "d02"
rs0:PRIMARY> use d02 switched to db d02 rs0:PRIMARY> db.data.save({a:"02"})
Apply oplog from rs0 to rs1 limiting to database 'd01' - change in d02 should not be replicated
mongooplog --from 127.0.0.1:20000 --port 20010 -d d01
but it appears on rs1 after that.
rs1:PRIMARY> use d02 switched to db d02 rs1:PRIMARY> db.data.find() { "_id" : ObjectId("5182929363576b32f0144132"), "a" : "02" }
Reporter: Sergei
E-mail: sbobovich@gmail.com
- duplicates
-
TOOLS-169 mongooplog should not take --db or --collection params
- Closed