码迷,mamicode.com
首页 > 数据库 > 详细

mongodb不能以服务方式正常启动,而可以用shell的方式启动的解决办法

时间:2017-12-08 13:57:38      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:shell   hat   files   ons   issue   this   ice   启动   min   

After running the repair I was able to start the mongod proccessor but as root, which meant that service mongod start would not work. To repair this issue, I needed to make sure that all the files inside the database folder were owned and grouped to mongod. I did this by the following:

  1. Check the file permissions inside your database folder
    1. note you need to be in your dbpath folder mine was /var/lib/mongo I went to cd /var/lib
    2. I ran ls -l mongo
  2. This showed me that databases were owned by root, which is wrong. I ran the following to fix this: chown -R mongod:mongod mongo. This changed the owner and group of every file in the folder to mongod. (If using the mongodb package, chown -R mongodb:mongodb mongodb)

I hope this helps someone else in the future.

mongodb不能以服务方式正常启动,而可以用shell的方式启动的解决办法

标签:shell   hat   files   ons   issue   this   ice   启动   min   

原文地址:http://www.cnblogs.com/mikeyang/p/8004591.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!