Last active
August 29, 2015 14:01
-
-
Save sherlockholmes/e8208d18a73ec310d659 to your computer and use it in GitHub Desktop.
Cheat Sheet 3.5 homework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongod --config mongod.df30592c9ae3.conf | |
mongodump -d local -c oplog.rs -o oplogD --port 30001 | |
mkdir data | |
mongo local --port 30001 | |
MongoDB shell version: 2.6.1 | |
connecting to: 127.0.0.1:30001/local | |
> db.oplog.rs.findOne({o: {drop: "backupColl"}}) | |
{ | |
"ts" : Timestamp(1398778745, 1), | |
"h" : NumberLong("-4262957146204779874"), | |
"v" : 2, | |
"op" : "c", | |
"ns" : "backupDB.$cmd", | |
"o" : { | |
"drop" : "backupColl" | |
} | |
} | |
> use admin | |
> db.shutdownServer() | |
> exit | |
mongorestore --dbpath data backupDB | |
mongod --dbpath data --smallfiles --port 30001 | |
mongo --port 30001 | |
> use local | |
> db.runCommand( { create: "oplog.rs", capped: true, size: (2 * 1024 * 1024 * 1024) } ) | |
> exit | |
mkdir oplogR | |
cp oplogD/local/oplog.rs.bson oplogR/oplog.bson | |
mongorestore --port 30001 --oplogReplay --oplogLimit 1398778745:1 oplogR | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment