我正在运行mongodb作为守护进程并在crontab中运行使用mongodb的各种脚本。
我意外关机,之后我尝试使用修复模式重新运行它,但不幸的是有以下响应。我可以采取哪些措施来恢复数据库并重新启动守护进程?
siddharta@0data:/var/lib/mongodb$ sudo mongod --dbpath /var/lib/mongodb --repair --repairpath /var/lib/mongodb0
Tue Oct 29 17:37:38 [initandlisten] MongoDB starting : pid=12379 port=27017 dbpath=/var/lib/mongodb 64-bit host=0data
Tue Oct 29 17:37:38 [initandlisten] db version v2.0.4, pdfile version 4.5
Tue Oct 29 17:37:38 [initandlisten] git version: nogitversion
Tue Oct 29 17:37:38 [initandlisten] build info: Linux lamiak 2.6.42-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 x86_64 BOOST_LIB_VERSION=1_46_1
Tue Oct 29 17:37:38 [initandlisten] options: { dbpath: "/var/lib/mongodb", repair: true, repairpath: "/var/lib/mongodb0" }
Tue Oct 29 17:37:38 [initandlisten] journal dir=/var/lib/mongodb/journal
Tue Oct 29 17:37:38 [initandlisten] recover begin
Tue Oct 29 17:37:38 [initandlisten] info no lsn file in journal/ directory
Tue Oct 29 17:37:38 [initandlisten] recover lsn: 0
Tue Oct 29 17:37:38 [initandlisten] recover /var/lib/mongodb/journal/j._16
Tue Oct 29 17:37:38 [initandlisten] recover create file /var/lib/mongodb/$tmp_repairDatabase_0/boardreader.ns 16MB
Tue Oct 29 17:37:38 [initandlisten] creating directory /var/lib/mongodb/$tmp_repairDatabase_0
Tue Oct 29 17:37:38 [initandlisten] recover create file /var/lib/mongodb/$tmp_repairDatabase_0/boardreader.0 64MB
Tue Oct 29 17:37:39 [initandlisten] recover create file /var/lib/mongodb/$tmp_repairDatabase_0/boardreader.1 128MB
Tue Oct 29 17:37:43 [initandlisten] recover cleaning up
Tue Oct 29 17:37:43 [initandlisten] removeJournalFiles
Tue Oct 29 17:37:43 [initandlisten] recover done
Tue Oct 29 17:37:43 [initandlisten] preallocating a journal file /var/lib/mongodb/journal/prealloc.0
283115520/1073741824 26%
398458880/1073741824 37%
534773760/1073741824 49%
713031680/1073741824 66%
901775360/1073741824 83%
Tue Oct 29 17:38:04 [initandlisten] ****
Tue Oct 29 17:38:04 [initandlisten] ****
Tue Oct 29 17:38:04 [initandlisten] need to upgrade database rezagm with pdfile version 4.5, new version: 4.5
Tue Oct 29 17:38:04 [initandlisten] starting upgrade
Tue Oct 29 17:38:04 [initandlisten] rezagm repairDatabase rezagm
Tue Oct 29 17:38:04 [initandlisten] removeJournalFiles
Tue Oct 29 17:38:04 [initandlisten] query rezagm.system.namespaces nscanned:7 nreturned:7 reslen:277 259ms
Tue Oct 29 17:38:04 [FileAllocator] allocating new datafile /var/lib/mongodb0/$tmp_repairDatabase_0/rezagm.ns, filling with zeroes...
Tue Oct 29 17:38:04 [FileAllocator] creating directory /var/lib/mongodb0/$tmp_repairDatabase_0/_tmp
Tue Oct 29 17:38:04 [FileAllocator] done allocating datafile /var/lib/mongodb0/$tmp_repairDatabase_0/rezagm.ns, size: 16MB, took 0.001 secs
Tue Oct 29 17:38:04 [FileAllocator] allocating new datafile /var/lib/mongodb0/$tmp_repairDatabase_0/rezagm.0, filling with zeroes...
Tue Oct 29 17:38:04 [FileAllocator] done allocating datafile /var/lib/mongodb0/$tmp_repairDatabase_0/rezagm.0, size: 64MB, took 0.014 secs
Tue Oct 29 17:38:04 [FileAllocator] allocating new datafile /var/lib/mongodb0/$tmp_repairDatabase_0/rezagm.1, filling with zeroes...
Tue Oct 29 17:38:04 [FileAllocator] done allocating datafile /var/lib/mongodb0/$tmp_repairDatabase_0/rezagm.1, size: 128MB, took 0.003 secs
Tue Oct 29 17:38:04 [initandlisten] query rezagm.tweetbase nscanned:7 nreturned:7 reslen:335029 231ms
Tue Oct 29 17:38:04 [initandlisten] build index rezagm.tweetbase { _id: 1 }
Tue Oct 29 17:38:05 [initandlisten] build index done 7 records 0.077 secs
Tue Oct 29 17:38:05 [initandlisten] warning: ClientCursor::yield can't unlock b/c of recursive lock ns: rezagm.favorite_det top: { opid: 4, active: true, waitingForLock: false, secs_running: 0, op: "getmore", ns: "rezagm.favorite_det", query: {}, client: "0.0.0.0:0", desc: "initandlisten", threadId: "0x7f95b479a740", numYields: 0 }
Tue Oct 29 17:38:05 [initandlisten] warning: ClientCursor::yield can't unlock b/c of recursive lock ns: rezagm.favorite_det top: { opid: 4, active: true, waitingForLock: false, secs_running: 0, op: "getmore", ns: "rezagm.favorite_det", query: {}, client: "0.0.0.0:0", desc: "initandlisten", threadId: "0x7f95b479a740", numYields: 0 }
Tue Oct 29 17:38:05 [initandlisten] warning: ClientCursor::yield can't unlock b/c of recursive lock ns: rezagm.favorite_det top: { opid: 4, active: true, waitingForLock: false, secs_running: 0, op: "getmore", ns: "rezagm.favorite_det", query: {}, client: "0.0.0.0:0", desc: "initandlisten", threadId: "0x7f95b479a740", numYields: 0 }
Tue Oct 29 17:38:05 [initandlisten] warning: ClientCursor::yield can't unlock b/c of recursive lock ns: rezagm.favorite_det top: { opid: 4, active: true, waitingForLock: false, secs_running: 0, op: "getmore", ns: "rezagm.favorite_det", query: {}, client: "0.0.0.0:0", desc: "initandlisten", threadId: "0x7f95b479a740", numYields: 0 }
Tue Oct 29 17:38:05 [initandlisten] build index rezagm.favorite_det { _id: 1 }
Tue Oct 29 17:38:05 [initandlisten] build index done 633 records 0.003 secs
Tue Oct 29 17:38:05 [initandlisten] build index rezagm.progression { _id: 1 }
Tue Oct 29 17:38:05 [initandlisten] build index done 98 records 0.003 secs
Tue Oct 29 17:38:05 [initandlisten] Assertion failure _recovering db/dur_recover.cpp 235
0x56e0a3 0x56c9f3 0x574639 0x6cb1b3 0x6cb655 0x6cb835 0x6cc0a0 0x6c766a 0x6c7b03 0x6c137d 0x6be9c4 0x6beb9e 0x7839ca 0x77420d 0x7940d5 0x8926b3 0x8946f4 0x895448 0x5281f0 0x7f95b2ad576d
mongod(_ZN5mongo15printStackTraceERSo+0x23) [0x56e0a3]
mongod(_ZN5mongo12sayDbContextEPKc+0xc3) [0x56c9f3]
mongod(_ZN5mongo8assertedEPKcS1_j+0xf9) [0x574639]
mongod(_ZN5mongo3dur11RecoveryJob5writeERKNS0_18ParsedJournalEntryE+0x543) [0x6cb1b3]
mongod(_ZN5mongo3dur11RecoveryJob10applyEntryERKNS0_18ParsedJournalEntryEbb+0x235) [0x6cb655]
mongod(_ZN5mongo3dur11RecoveryJob12applyEntriesERKSt6vectorINS0_18ParsedJournalEntryESaIS3_EE+0x65) [0x6cb835]
mongod(_ZN5mongo3dur11RecoveryJob14processSectionEPKNS0_11JSectHeaderEPKvjPKNS0_11JSectFooterE+0x640) [0x6cc0a0]
mongod(_ZN5mongo3dur22WRITETODATAFILES_Impl1ERKNS0_11JSectHeaderERNS_14AlignedBuilderE+0x8a) [0x6c766a]
mongod(_ZN5mongo3dur16WRITETODATAFILESERKNS0_11JSectHeaderERNS_14AlignedBuilderE+0x43) [0x6c7b03]
mongod() [0x6c137d]
mongod(_ZN5mongo8MongoMMF5closeEv+0x34) [0x6be9c4]
mongod(_ZN5mongo8MongoMMFD1Ev+0x2e) [0x6beb9e]
mongod(_ZN5mongo8DatabaseD2Ev+0x4a) [0x7839ca]
mongod(_ZN5mongo8Database13closeDatabaseEPKcRKSs+0x22d) [0x77420d]
mongod(_ZN5mongo14repairDatabaseESsRSsbb+0x3b5) [0x7940d5]
mongod(_ZN5mongo11doDBUpgradeERKSsSsPNS_14DataFileHeaderE+0x63) [0x8926b3]
mongod(_ZN5mongo14_initAndListenEi+0x7a4) [0x8946f4]
mongod(_ZN5mongo13initAndListenEi+0x18) [0x895448]
mongod(main+0x2770) [0x5281f0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f95b2ad576d]
Tue Oct 29 17:38:05 [initandlisten] dbexception in groupCommit causing immediate shutdown: 0 assertion db/dur_recover.cpp:235
Tue Oct 29 17:38:05 gc1
Tue Oct 29 17:38:05 Got signal: 6 (Aborted).
Tue Oct 29 17:38:05 Backtrace:
0x56e0a3 0x8913dc 0x7f95b2aea4a0 0x7f95b2aea425 0x7f95b2aedb8b 0x77123e 0x6c14f7 0x6be9c4 0x6beb9e 0x7839ca 0x77420d 0x7940d5 0x8926b3 0x8946f4 0x895448 0x5281f0 0x7f95b2ad576d 0x529861
mongod(_ZN5mongo15printStackTraceERSo+0x23) [0x56e0a3]
mongod(_ZN5mongo10abruptQuitEi+0x34c) [0x8913dc]
/lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7f95b2aea4a0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f95b2aea425]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7f95b2aedb8b]
mongod(_ZN5mongo10mongoAbortEPKc+0x3e) [0x77123e]
mongod() [0x6c14f7]
mongod(_ZN5mongo8MongoMMF5closeEv+0x34) [0x6be9c4]
mongod(_ZN5mongo8MongoMMFD1Ev+0x2e) [0x6beb9e]
mongod(_ZN5mongo8DatabaseD2Ev+0x4a) [0x7839ca]
mongod(_ZN5mongo8Database13closeDatabaseEPKcRKSs+0x22d) [0x77420d]
mongod(_ZN5mongo14repairDatabaseESsRSsbb+0x3b5) [0x7940d5]
mongod(_ZN5mongo11doDBUpgradeERKSsSsPNS_14DataFileHeaderE+0x63) [0x8926b3]
mongod(_ZN5mongo14_initAndListenEi+0x7a4) [0x8946f4]
mongod(_ZN5mongo13initAndListenEi+0x18) [0x895448]
mongod(main+0x2770) [0x5281f0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f95b2ad576d]
mongod() [0x529861]
Logstream::get called in uninitialized state
Tue Oct 29 17:38:05 [initandlisten] ERROR: Client::~Client _context should be null but is not; client:initandlisten
Logstream::get called in uninitialized state
Tue Oct 29 17:38:05 [initandlisten] ERROR: Client::shutdown not called: initandlisten
太多持久的crons会关闭mongodb守护进程吗?