如何修复“旧锁文件:/var/lib/mongodb/mongod.lock。可能意味着不正常关机,但是没有可恢复的日志文件...'

时间:2019-07-11 06:29:09

标签: mongodb

我正在通过复制将一些数据从主mongo迁移到辅助mongo,过程中途我的辅助磁盘空间已满,而辅助计算机中的mongo意外关闭。

2019-07-11T08:00:35.327+0800 I CONTROL  [journal writer] LogFile::synchronousAppend failed with 901120 bytes unwritten out of 901120 bytes;  b=0x5394000 errno:28 No space left on device
2019-07-11T08:00:35.327+0800 I -        [journal writer] Fatal Assertion 13515
2019-07-11T08:00:35.356+0800 I CONTROL  [journal writer]
 0xfa97a2 0xf46d29 0xf2af56 0xf477be 0xd629e3 0xd62c35 0xd64c8c 0xff88db 0x7f66e4be4184 0x7f66e39ad03d
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"400000","o":"BA97A2","s":"_ZN5mongo15printStackTraceERSo"},{"b":"400000","o":"B46D29","s":"_ZN5mongo10logContextEPKc"},{"b":"400000","o":"B2AF56","s":"_ZN5mongo13fassertFailedEi"},{"b":"400000","o":"B477BE","s":"_ZN5mongo7LogFile17synchronousAppendEPKvm"},{"b":"400000","o":"9629E3","s":"_ZN5mongo3dur7Journal7journalERKNS0_11JSectHeaderERKNS_14AlignedBuilderE"},{"b":"400000","o":"962C35","s":"_ZN5mongo3dur14WRITETOJOURNALERKNS0_11JSectHeaderERKNS_14AlignedBuilderE"},{"b":"400000","o":"964C8C","s":"_ZN5mongo3dur13JournalWriter20_journalWriterThreadEv"},{"b":"400000","o":"BF88DB"},{"b":"7F66E4BDC000","o":"8184"},{"b":"7F66E38AF000","o":"FE03D","s":"clone"}],"processInfo":{ "mongodbVersion" : "3.0.15", "gitVersion" : "b8ff507269c382bc100fc52f75f48d54cd42ec3b", "uname" : { "sysname" : "Linux", "release" : "3.13.0-170-generic", "version" : "#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000", "buildId" : "204F7BDDDBE792AE7F92CBB5B4C3745513DB2D0D" }, { "b" : "7FFCCEC7D000", "elfType" : 3, "buildId" : "8BEB43CA1BD4CFDB90BC2BFCE0EC3042E4090782" }, { "b" : "7F66E4BDC000", "path" : "/lib/x86_64-linux-gnu/libpthread.so.0", "elfType" : 3, "buildId" : "C4D728AC02A328301C070F5C220B826492273FCD" }, { "b" : "7F66E497D000", "path" : "/lib/x86_64-linux-gnu/libssl.so.1.0.0", "elfType" : 3, "buildId" : "5BB10EACF0B497C21806AACAAF45C36328E831A3" }, { "b" : "7F66E45A0000", "path" : "/lib/x86_64-linux-gnu/libcrypto.so.1.0.0", "elfType" : 3, "buildId" : "0430E61DA2B4291F7CE5512101F7AE23C93236D4" }, { "b" : "7F66E4398000", "path" : "/lib/x86_64-linux-gnu/librt.so.1", "elfType" : 3, "buildId" : "D27A253ACFC83E639AE80A606BBA2C058302D07A" }, { "b" : "7F66E4194000", "path" : "/lib/x86_64-linux-gnu/libdl.so.2", "elfType" : 3, "buildId" : "1B38A86853776548628FA4090913C7A12C8F3F4D" }, { "b" : "7F66E3E8E000", "path" : "/lib/x86_64-linux-gnu/libm.so.6", "elfType" : 3, "buildId" : "1B288F3B11CB908F03FA568752126AD1AE3C6D1E" }, { "b" : "7F66E3C78000", "path" : "/lib/x86_64-linux-gnu/libgcc_s.so.1", "elfType" : 3, "buildId" : "36311B4457710AE5578C4BF00791DED7359DBB92" }, { "b" : "7F66E38AF000", "path" : "/lib/x86_64-linux-gnu/libc.so.6", "elfType" : 3, "buildId" : "5A49BF8DEF435AC3FE9208DF3C6B5622FE347A97" }, { "b" : "7F66E4DFA000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3, "buildId" : "2C5922FE5D8F6A77F42349579B5D9AF51E17C591" } ] }}
 mongod(_ZN5mongo15printStackTraceERSo+0x32) [0xfa97a2]
 mongod(_ZN5mongo10logContextEPKc+0xE9) [0xf46d29]
 mongod(_ZN5mongo13fassertFailedEi+0x66) [0xf2af56]
 mongod(_ZN5mongo7LogFile17synchronousAppendEPKvm+0x21E) [0xf477be]
 mongod(_ZN5mongo3dur7Journal7journalERKNS0_11JSectHeaderERKNS_14AlignedBuilderE+0x203) [0xd629e3]
 mongod(_ZN5mongo3dur14WRITETOJOURNALERKNS0_11JSectHeaderERKNS_14AlignedBuilderE+0x35) [0xd62c35]
 mongod(_ZN5mongo3dur13JournalWriter20_journalWriterThreadEv+0x33C) [0xd64c8c]
 mongod(+0xBF88DB) [0xff88db]
 libpthread.so.0(+0x8184) [0x7f66e4be4184]
 libc.so.6(clone+0x6D) [0x7f66e39ad03d]
-----  END BACKTRACE  -----
2019-07-11T08:00:35.356+0800 I -        [journal writer]

***aborting after fassert() failure

已同步的数据文件几乎存在,所以我不想通过初始同步进行重新同步,因为当我收到高达1.8TB的巨大数据时,它将重新开始。

因此,我决定在辅助mongo上禁用复制,并以独立mongo的身份启动实例,但是在启动后我收到了


2019-07-11T10:22:31.948+0800 I CONTROL  ***** SERVER RESTARTED *****
2019-07-11T10:22:31.968+0800 I CONTROL  [initandlisten] MongoDB starting : pid=910 port=27017 dbpath=/var/lib/mongodb 64-bit host=ip-101-0-0-182
2019-07-11T10:22:31.968+0800 I CONTROL  [initandlisten] db version v3.0.15
2019-07-11T10:22:31.968+0800 I CONTROL  [initandlisten] git version: b8ff507269c382bc100fc52f75f48d54cd42ec3b
2019-07-11T10:22:31.968+0800 I CONTROL  [initandlisten] build info: Linux ip-10-71-195-23 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2019-07-11T10:22:31.968+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2019-07-11T10:22:31.968+0800 I CONTROL  [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "0.0.0.0", port: 27017 }, 2019-07-11T10:25:44.203+0800 I CONTROL  ***** SERVER RESTARTED *****
2019-07-11T10:25:44.206+0800 I CONTROL  [initandlisten] MongoDB starting : pid=1402 port=27017 dbpath=/var/lib/mongodb 64-bit host=ip-101-0-0-182
2019-07-11T10:25:44.206+0800 I CONTROL  [initandlisten] db version v3.0.15
2019-07-11T10:25:44.206+0800 I CONTROL  [initandlisten] git version: b8ff507269c382bc100fc52f75f48d54cd42ec3b
2019-07-11T10:25:44.206+0800 I CONTROL  [initandlisten] build info: Linux ip-10-71-195-23 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2019-07-11T10:25:44.206+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2019-07-11T10:25:44.206+0800 I CONTROL  [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "0.0.0.0", port: 27017 }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2019-07-11T10:25:44.227+0800 W -        [initandlisten] Detected unclean shutdown - /var/lib/mongodb/mongod.lock is not empty.
2019-07-11T10:25:44.234+0800 I STORAGE  [initandlisten] **************
old lock file: /var/lib/mongodb/mongod.lock.  probably means unclean shutdown,
but there are no journal files to recover.
this is likely human error or filesystem corruption.
please make sure that your journal directory is mounted.
found 4 dbs.
see: http://dochub.mongodb.org/core/repair for more information
*************
2019-07-11T10:25:44.237+0800 I STORAGE  [initandlisten] exception in initAndListen: 12596 old lock file, terminating
2019-07-11T10:25:44.237+0800 I CONTROL  [initandlisten] dbexit:  rc: 100

如何使用通过复制过程创建的数据文件启动mongo实例

我发现类似mongod --repair的东西,但是通常我用sudo service mongod start启动mongo进程,如何在Linux机器上使用--repair变量运行进程。

我是否应该只在机器上sudo mongod --dbpath /path/to/datafiles --repair以便首先进行修复过程,以便之后在修复数据文件后像往常一样通常以sudo service mongod start开始我的过程?< / p>

0 个答案:

没有答案