1
我只需要緊急重啓我的linux服務器。我優雅地做了,而不是硬重啓。我一直在通過node.js應用收集數據一個月,但是當服務器再次啓動時,所有數據都消失了!MongoDB數據消失
我有很長的日誌文件:http://clintberry.com/mongod.log
我也跑了修復,看它是否會幫助,但無濟於事。有任何想法嗎?
新發展 它看起來像我命令「服務的mongod開始」,當我嘗試再次運行該命令,我得到這個運行蒙戈:
**************
old lock file: /var/lib/mongo/mongod.lock. probably means unclean shutdown recommend
removing file and running --repair see: http://dochub.mongodb.org/core/repair
for more information
*************
因此,這意味着修復因爲我沒有使用正確的配置文件,所以我試圖不工作。
當我運行與正確的配置文件,它似乎並沒有跑修理修理,就吐出了這一點:
[email protected] [/var/log/mongo]# mongod --dbpath /var/lib/mongo/ --repair
Wed Nov 30 12:09:40 [initandlisten] MongoDB starting : pid=26916 port=27017 dbpath=/var/lib/mongo/ 64-bit
Wed Nov 30 12:09:40 [initandlisten] db version v1.8.4, pdfile version 4.5
Wed Nov 30 12:09:40 [initandlisten] git version: 81f12749a15e3d158b1b16bab6bc3faea538e166
Wed Nov 30 12:09:40 [initandlisten] build sys info: Linux bs-linux64.10gen.cc 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
**************
old lock file: /var/lib/mongo/mongod.lock. probably means unclean shutdown
recommend removing file and running --repair
see: http://dochub.mongodb.org/core/repair for more information
*************
Wed Nov 30 12:09:40 [initandlisten] exception in initAndListen std::exception: old lock file, terminating
Wed Nov 30 12:09:40 dbexit:
Wed Nov 30 12:09:40 [initandlisten] shutdown: going to close listening sockets...
Wed Nov 30 12:09:40 [initandlisten] shutdown: going to flush diaglog...
Wed Nov 30 12:09:40 [initandlisten] shutdown: going to close sockets...
Wed Nov 30 12:09:40 [initandlisten] shutdown: waiting for fs preallocator...
Wed Nov 30 12:09:40 [initandlisten] shutdown: closing all files...
Wed Nov 30 12:09:40 closeAllFiles() finished
Wed Nov 30 12:09:40 dbexit: really exiting now
你確定數據在那裏存在嗎,並且沒有把它保存到數據庫的問題? –
它在那裏,因爲我每晚在地圖上縮小地圖,並在報告中顯示。 – Clint
Clint,是你重新啓動它時指定的dbpath嗎?從你的日誌看來,你使用的是/ var/lib/mongo - 那個目錄的內容是什麼? – mpobrien