当我在重新启动服务器(Linux VM)而不先关闭数据库之后尝试重新启动数据库时,我收到以下错误。我看到有人在一年半前发布了同样的错误,但是那里提出的解决方案并不适用于我的情况,因为它不是yaml配置问题(数据库运行了很长一段时间) 。我还在最后包括了日志。谢谢你的帮助。
sudo mongod --fork --logpath /nas/is1/bin/mongodb/data/db/mongodb.log --dbpath /nas/is1/bin/mongodb/data/db about to fork child process, waiting until server is ready for connections. forked process: 20085 ERROR: child process failed, exited with error number 14
在日志文件中输出。
2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] MongoDB starting : pid=20085 port=27017 dbpath=/data/mongodb/data/db 64-bit host=raboso 2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] db version v3.2.1 2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2 2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] allocator: tcmalloc 2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] modules: none 2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] build environment: 2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] distarch: x86_64 2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] target_arch: x86_64 2017-01-19T15:33:45.286-0500 I CONTROL [initandlisten] options: { processManagement: { fork: true }, storage: { dbPath: "/data/mongodb/data/db" }, systemLog: { destination: "file", path: "/data/mongodb/data/db/mongodb.log" } } 2017-01-19T15:33:45.329-0500 I - [initandlisten] Detected data files in /data/mongodb/data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 2017-01-19T15:33:45.346-0500 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=112G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0), 2017-01-19T15:33:54.009-0500 E STORAGE [initandlisten] WiredTiger (-31802) [1484858034:9041][20085:0x7f0fcf72bcc0], file:sizeStorer.wt, WT_SESSION.open_cursor: sizeStorer.wt read error: failed to read 4096 bytes at offset 49152: WT_ERROR: non-specific WiredTiger error 2017-01-19T15:33:54.011-0500 I - [initandlisten] Invariant failure: ret resulted in status UnknownError -31802: WT_ERROR: non-specific WiredTiger error at src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp 67 2017-01-19T15:33:54.022-0500 I CONTROL [initandlisten] 0x12cf722 0x127ac14 0x1266dad 0x1058db2 0x10425ea 0x103f540 0xf679a8 0x93bc91 0x9403b9 0x7f0fce33bb35 0x939829 ----- BEGIN BACKTRACE ----- {"backtrace":[{"b":"400000","o":"ECF722"},{"b":"400000","o":"E7AC14"},{"b":"400000", "o":"E66DAD"},{"b":"400000","o":"C58DB2"},{"b":"400000","o":"C425EA"},{"b":"400000", "o":"C3F540"},{"b":"400000","o":"B679A8"},{"b":"400000","o":"53BC91"},{"b":"400000", "o":"5403B9"},{"b":"7F0FCE31A000","o":"21B35"},{"b":"400000","o":"539829"}], "processInfo":{ "mongodbVersion" : "3.2.1", "gitVersion" : "a14d55980c2cdc565d4704a7e3ad37e4e535c1b2", "compiledModules" : [], "uname" : { "sysname" : "Linux", "release" : "3.10.0-514.2.2.el7.x86_64", "version" : "#1 SMP Wed Nov 16 13:15:13 EST 2016", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000" }, { "b" : "7FFEF9CD5000", "elfType" : 3 }, { "b" : "7F0FCF31B000", "path" : "/lib64/librt.so.1", "elfType" : 3 }, { "b" : "7F0FCF117000", "path" : "/lib64/libdl.so.2", "elfType" : 3 }, { "b" : "7F0FCEE0F000", "path" : "/lib64/libstdc++.so.6", "elfType" : 3 }, { "b" : "7F0FCEB0D000", "path" : "/lib64/libm.so.6", "elfType" : 3 }, { "b" : "7F0FCE8F7000", "path" : "/lib64/libgcc_s.so.1", "elfType" : 3 }, { "b" : "7F0FCE6DB000", "path" : "/lib64/libpthread.so.0", "elfType" : 3 }, { "b" : "7F0FCE31A000", "path" : "/lib64/libc.so.6", "elfType" : 3 }, { "b" : "7F0FCF523000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3 } ] }} mongod(_ZN5mongo15printStackTraceERSo+0x32) [0x12cf722] mongod(_ZN5mongo10logContextEPKc+0x134) [0x127ac14] mongod(_ZN5mongo17invariantOKFailedEPKcRKNS_6StatusES1_j+0xAD) [0x1266dad] mongod(_ZN5mongo20WiredTigerSizeStorerC1EP15__wt_connectionRKSs+0x222) [0x1058db2] mongod(_ZN5mongo18WiredTigerKVEngineC2ERKSsS2_S2_mbbb+0x6DA) [0x10425ea] mongod(+0xC3F540) [0x103f540] mongod(_ZN5mongo20ServiceContextMongoD29initializeGlobalStorageEngineEv+0x588) [0xf679a8] mongod(_ZN5mongo13initAndListenEi+0x321) [0x93bc91] mongod(main+0x149) [0x9403b9] libc.so.6(__libc_start_main+0xF5) [0x7f0fce33bb35] mongod(+0x539829) [0x939829] ----- END BACKTRACE ----- 2017-01-19T15:33:54.022-0500 I - [initandlisten] ***aborting after invariant() failure
答案 0 :(得分:1)
如果运行带有WiredTiger存储引擎的MongoDB的系统崩溃或遇到不干净的关闭,如果崩溃/关闭中断了WiredTiger检查点,MongoDB可能无法在重启时恢复数据文件。
MongoDB无法在重启时自动恢复数据文件。
可悲的是,没有解决方法。您可以从备份还原resync from another replica set member恢复数据。
答案 1 :(得分:0)
WiredTiger(-31802)[1484858034:9041] [20085:0x7f0fcf72bcc0],file:sizeStorer.wt,WT_SESSION.open_cursor:sizeStorer.wt读取错误:无法读取偏移49152处的4096字节:WT_ERROR:非特定的WiredTiger错误
以上错误表明您的数据库已损坏。修理:
mongod --repair --dbpath /path/to/data/db