在启动或修复mongod时,在invariant()失败错误后中止

时间:2016-11-17 06:29:19

标签: mongodb

最初我的mongod进程运行正常。我在我的虚拟机上发现空间紧张,所以删除了2个旧的oplog文件以释放空间。接下来我启动mongod并开始收到错误。然后我尝试在db中本地修复我的数据路径,它给出了以下错误。请帮忙。

[mongo@localhost data]$ /opt/mongo/mongodb-linux-x86_64-3.0.5/bin/mongod --dbpath local --repair
2016-11-17T03:26:01.502-0800 W -        [initandlisten] Detected unclean shutdown - local/mongod.lock is not empty.
2016-11-17T03:26:01.525-0800 I CONTROL  [initandlisten] MongoDB starting : pid=2872 port=27017 dbpath=local 64-bit host=localhost.localdomain
2016-11-17T03:26:01.525-0800 I CONTROL  [initandlisten] db version v3.0.5
2016-11-17T03:26:01.525-0800 I CONTROL  [initandlisten] git version: 8bc4ae20708dbb493cb09338d9e7be6698e4a3a3
2016-11-17T03:26:01.525-0800 I CONTROL  [initandlisten] build info: Linux build2.ny.cbi.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2016-11-17T03:26:01.525-0800 I CONTROL  [initandlisten] allocator: tcmalloc
2016-11-17T03:26:01.525-0800 I CONTROL  [initandlisten] options: { repair: true, storage: { dbPath: "local" } }
2016-11-17T03:26:01.526-0800 I STORAGE  [initandlisten] repairDatabase local
2016-11-17T03:26:01.526-0800 I STORAGE  [initandlisten] info openExisting file size 16777216 but mmapv1GlobalOptions.smallfiles=false: local/local.0
2016-11-17T03:26:01.538-0800 I STORAGE  [initandlisten] _getOpenFile() invalid file index requested 2
2016-11-17T03:26:01.538-0800 I -        [initandlisten] Invariant failure false src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp 201
2016-11-17T03:26:01.554-0800 I CONTROL  [initandlisten] 
 0xf5e1a9 0xf06f71 0xeeaad2 0xd44d8b 0xd44de9 0xd445b9 0xd514ad 0xd3dcc5 0xd3e3df 0xd3eb4f 0xd41edf 0x904fe5 0xd59afd 0xbf03c4 0x7e4004 0x7e88d9 0x3e7901ecdd 0x7e1789
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"400000","o":"B5E1A9"},{"b":"400000","o":"B06F71"},{"b":"400000","o":"AEAAD2"},{"b":"400000","o":"944D8B"},{"b":"400000","o":"944DE9"},{"b":"400000","o":"9445B9"},{"b":"400000","o":"9514AD"},{"b":"400000","o":"93DCC5"},{"b":"400000","o":"93E3DF"},{"b":"400000","o":"93EB4F"},{"b":"400000","o":"941EDF"},{"b":"400000","o":"504FE5"},{"b":"400000","o":"959AFD"},{"b":"400000","o":"7F03C4"},{"b":"400000","o":"3E4004"},{"b":"400000","o":"3E88D9"},{"b":"3E79000000","o":"1ECDD"},{"b":"400000","o":"3E1789"}],"processInfo":{ "mongodbVersion" : "3.0.5", "gitVersion" : "8bc4ae20708dbb493cb09338d9e7be6698e4a3a3", "uname" : { "sysname" : "Linux", "release" : "2.6.32-358.el6.x86_64", "version" : "#1 SMP Tue Jan 29 11:47:41 EST 2013", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000" }, { "b" : "7FFF212FF000", "elfType" : 3 }, { "path" : "/lib64/libpthread.so.0", "elfType" : 3 }, { "path" : "/lib64/librt.so.1", "elfType" : 3 }, { "path" : "/lib64/libdl.so.2", "elfType" : 3 }, { "path" : "/usr/lib64/libstdc++.so.6", "elfType" : 3 }, { "path" : "/lib64/libm.so.6", "elfType" : 3 }, { "path" : "/lib64/libgcc_s.so.1", "elfType" : 3 }, { "path" : "/lib64/libc.so.6", "elfType" : 3 }, { "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3 } ] }}
 mongod(_ZN5mongo15printStackTraceERSo+0x29) [0xf5e1a9]
 mongod(_ZN5mongo10logContextEPKc+0xE1) [0xf06f71]
 mongod(_ZN5mongo15invariantFailedEPKcS1_j+0xB2) [0xeeaad2]
 mongod(_ZNK5mongo19MmapV1ExtentManager12_getOpenFileEi+0x8B) [0xd44d8b]
 mongod(_ZNK5mongo19MmapV1ExtentManager9getExtentERKNS_7DiskLocEb+0x19) [0xd44de9]
 mongod(_ZN5mongo19MmapV1ExtentManager9cacheHintERKNS_7DiskLocERKNS_13ExtentManager8HintTypeE+0x19) [0xd445b9]
 mongod(_ZN5mongo19CappedRecordStoreV1C2EPNS_16OperationContextEPNS_28CappedDocumentDeleteCallbackERKNS_10StringDataEPNS_21RecordStoreV1MetaDataEPNS_13ExtentManagerEb+0xED) [0xd514ad]
 mongod(_ZN5mongo26MMAPV1DatabaseCatalogEntry14_insertInCacheEPNS_16OperationContextERKNS_10StringDataEPNS0_5EntryE+0x1C5) [0xd3dcc5]
 mongod(_ZN5mongo26MMAPV1DatabaseCatalogEntry5_initEPNS_16OperationContextE+0x4EF) [0xd3e3df]
 mongod(_ZN5mongo26MMAPV1DatabaseCatalogEntryC1EPNS_16OperationContextERKNS_10StringDataES5_bb+0x16F) [0xd3eb4f]
 mongod(_ZN5mongo12MMAPV1Engine23getDatabaseCatalogEntryEPNS_16OperationContextERKNS_10StringDataE+0x1AF) [0xd41edf]
 mongod(_ZN5mongo14DatabaseHolder6openDbEPNS_16OperationContextERKNS_10StringDataEPb+0x105) [0x904fe5]
 mongod(_ZN5mongo12MMAPV1Engine14repairDatabaseEPNS_16OperationContextERKSsbb+0x30D) [0xd59afd]
 mongod(_ZN5mongo14repairDatabaseEPNS_16OperationContextEPNS_13StorageEngineERKSsbb+0xEB4) [0xbf03c4]
 mongod(_ZN5mongo13initAndListenEi+0xA44) [0x7e4004]
 mongod(main+0x139) [0x7e88d9]
 libc.so.6(__libc_start_main+0xFD) [0x3e7901ecdd]
 mongod(+0x3E1789) [0x7e1789]
-----  END BACKTRACE  -----
2016-11-17T03:26:01.554-0800 I -        [initandlisten] 

***aborting after invariant() failure

2 个答案:

答案 0 :(得分:1)

请确保您正在运行的mongod具有在/ data / db目录中读取和写入的完全权限,并且还可以读取和写入其中的所有文件

答案 1 :(得分:1)

  

_getOpenFile()请求无效的文件索引2

尝试修复您的数据库:

click

还尝试升级MongoDB并重新尝试。

相关:After changing DB locations, the KVstore is not initializing