Please help!
Mongodb crashed on my server. When I started the mongod backup
I have no data in database!
Looking at the data/db/
dir开发者_如何学编程ectory I have the following 5 files:
mongo.lock
production-mongodb 4k
production-mongodb.0 64m
production-mongodb.1 128m
production-mongodb.ns 16m
I think mongo has somehow started a new database, keeping my old one? Hopefully! If this is correct how do I fix this? And what is going on here?
I have tried to remove the lock file and run mongod --repair
but still empty database.
What does show dbs
show? Did you switch to the correct DB assuming you see "production" listed?
OK, based on the files you've listed, you have one database named "production-mongodb".
So you'll want to run mongod production-mongodb
to get command-line access.
Or you can do mongod
use production-mongodb
show collections
You should see your data.
精彩评论