• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

repair and boot mongodb on centos

mysql 搞代码 4年前 (2022-01-09) 37次浏览 已收录 0个评论

When I somehow login and logout my linode vps where I start the service of mongodb for some times, then I got these errors: # service mongod startStarting mongod: Wed Oct 30 01:28:42.557Wed Oct 30 01:28:42.558 warning: 32-bit servers don’t

When I somehow login and logout my linode vps where I start the service of mongodb for some times, then I got these errors:

<code class="language-text"># service mongod startStarting mongod: Wed Oct 30 01:28:42.557Wed Oct 30 01:28:42.558 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.Wed Oct 30 01:28:42.558about to fork child process, waiting until server is ready for connections.forked process: 6873all output going to: /var/log/mongo/mongod.logERROR: child process failed, exited with error number 100                                                       [FAILED]</code>

So, after googling, I find the reason:

<code class="language-text">Unclean shutdown detected.Please visit http://dochub.mongodb.org/core/repair for recovery instructions.</code>

How to resolve it?

First, kill the process if it exists

<code class="language-text">ps -ef | grep mongo*ps -ef | grep mongodkill -9 pid</code>

Second, remove the lock file for mongodb

<code class="language-text">rm -rf /var/lib/mongo/m<b style="color:transparent">本文来源gao@!dai!ma.com搞$$代^@码网*</b>ongod.lock</code>

Third, boot it with repair mode

<code class="language-text">mongod -f /etc/mongod.conf --repair</code>

Forth, boot again without repair mode

<code class="language-text">mongod -f /etc/mongod.conf</code>

Now we can check if the mongodb process is running:

<code class="language-text">ps -ef | grep mongo*ps -ef | grep mongod</code>

And try it: mongo

Done!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:repair and boot mongodb on centos
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址