Mongodb 错误:子进程失败,以错误号 51 退出 [英] Mongodb ERROR: child process failed, exited with error number 51

查看:245
本文介绍了Mongodb 错误:子进程失败,以错误号 51 退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

mongodb 由于某种原因关闭了.系统异常关闭.

mongodb was closed by some reason. system shutdown abnormally.

当我尝试重新启动 mongodb 时使用:

when i try to restart mongodb use:

mongod -f /usr/local/mongodb/etc/mongo.conf

得到

about to fork child process, waiting until server is ready for connections.
forked process: 28402
ERROR: child process failed, exited with error number 51
To see additional information in this output, start without the "--fork" option.

mongodb.log:

mongodb.log:

2019-02-19T13:22:24.105+0800 I CONTROL  [main] ***** SERVER RESTARTED *****
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] MongoDB starting :     pid=28131 port=27017 dbpath=/usr/local/mongodb/data/mongodata 64-bit     host=nginx.xchs
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] db version v3.6.2
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] git version:     489d177dbd0f0420a8ca04d39fd78d0a2c539420
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] OpenSSL version:         OpenSSL 1.0.1e-fips 11 Feb 2013
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] modules: none
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] build environment:
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten]     distmod: rhel62
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten]     distarch: x86_64
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten]     target_arch:     x86_64
2019-02-19T13:22:24.112+0800 I CONTROL  [initandlisten] options: { config:     "/usr/local/mongodb/etc/mongo.conf", net: { bindIp: "0.0.0.0" },     processManagement: { fork: true }, storage: { dbPath:     "/usr/local/mongodb/data/mongodata" }, systemLog: { destination: "file",     logAppend: true, path: "/usr/local/mongodb/data/log/mongolog/mongodb.log" } }
2019-02-19T13:22:24.112+0800 W -        [initandlisten] Detected unclean     shutdown - /usr/local/mongodb/data/mongodata/mongod.lock is not empty.
2019-02-19T13:22:24.113+0800 I -        [initandlisten] Detected data files     in /usr/local/mongodb/data/mongodata created by the 'wiredTiger' storage engine,     so setting the active storage engine to 'wiredTiger'.
2019-02-19T13:22:24.113+0800 W STORAGE  [initandlisten] Recovering data from     the last clean checkpoint.
2019-02-19T13:22:24.113+0800 I STORAGE  [initandlisten] 
2019-02-19T13:22:24.113+0800 I STORAGE  [initandlisten] ** WARNING: Using     the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-02-19T13:22:24.113+0800 I STORAGE  [initandlisten] **          See     http://dochub.mongodb.org/core/prodnotes-filesystem
2019-02-19T13:22:24.113+0800 I STORAGE  [initandlisten] wiredtiger_open     config: create,cache_size=3424M,session_max=20000,eviction=    (threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=    (enabled=true,archive=true,path=journal,compressor=snappy),file_manager=    (close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2019-02-19T13:22:24.602+0800 E STORAGE  [initandlisten] WiredTiger error (0)     [1550553744:602025][28131:0x7f41a84cea80], file:WiredTiger.wt, WT_CURSOR.next: read checksum error for 24576B block at offset 1671168: block header checksum of 3727800471 doesn't match expected checksum of 605632
2019-02-19T13:22:24.602+0800 E STORAGE  [initandlisten] WiredTiger error (0) [1550553744:602085][28131:0x7f41a84cea80], file:WiredTiger.wt, WT_CURSOR.next: WiredTiger.wt: encountered an illegal file format or internal value: (__wt_block_read_off, 227)
2019-02-19T13:22:24.602+0800 E STORAGE  [initandlisten] WiredTiger error (-31804) [1550553744:602097][28131:0x7f41a84cea80], file:WiredTiger.wt, WT_CURSOR.next: the process must exit and restart: WT_PANIC: WiredTiger library panic
2019-02-19T13:22:24.602+0800 F -        [initandlisten] Fatal Assertion 28558 at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 361
2019-02-19T13:22:24.602+0800 F -        [initandlisten] 

***aborting after fassert() failure

如何解决这个问题?

推荐答案

在 VIM 或纯文本编辑器中打开您的配置文件,到了这一行:

Open your config file in VIM or in a plain text editor, got to this line:

存储:数据库路径:THE_PATH_TO_THE_DIRECTORY_YOU_STORE_YOUR_DB

例如:

/var/mongodb/db/mydb

到你的终端确认dbPath下的路径是否存在,输入:

Go to your terminal to confirm if the path under dbPath exists, type:

ls THE_PATH_TO_THE_DIRECTORY_YOU_STORE_YOUR_DB

以我这里的情况为例:

ls/var/mongodb/db/mydb

如果结果是目录不存在,则重新创建它:

If the result is directory does not exist, then just recreate it:

mkdir -p THE_PATH_TO_THE_DIRECTORY_YOU_STORE_YOUR_DB

例如:

mkdir -p/var/mongodb/db/mydb

如果您发现该目录存在,那么它在关机期间已损坏,如上面的回答中突出显示的那样.

If you found that the directory exists then it was corrupted during shutdown,as highlighted in the answere above.

转到您的终端并运行以下命令:

Go to your terminal and run the following command:

mongod --dbpath/data/db --repair

请参考以上 Mongo DB 官方文档

这篇关于Mongodb 错误:子进程失败,以错误号 51 退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆