mongodb - How to recover from losing all your /data/db -


we using mongodb 3.0.2 , our system managed via mms discover 1 of our new dev environment lost content /data/db including journals, logs , config file.

one thing the instance still , running in memory.

does has solution on how recover situation?

i tried db.fsynclock() supposed flush data disk no luck.

afaict, files opened/memmapped mongodb, removing entry filesystem not prevent mongodb still use them (on unix-like systems, @ least). long not closed , mongodb not need open other files, things should still usable. enough start doing dumps.

as experiment, populated newly installed mongodb 3.0.2 instance 2m documents. stopping it, restarting it, , removing data folder -- before having accessed collection. able mongodump collection without issue:

> (i = 0; < 2000000; ++i) { db.test.insert({x:i}) } 
# stop mongodb # start mongodb again  rm -rf data  mongodump -d test -c test  # success !  # stop mongodb  mkdir -p data/db  # start mongodb again  mongorestore -d test -c test dump/test/test.bson  
> db.test.count() 2000000 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -