mongodb服务未启动 [英] mongodb service is not starting up

查看:57
本文介绍了mongodb服务未启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用mongodb-10gen debian软件包安装了mongodb 2.0.3.一切正常,除了计算机启动时默认情况下未安装的服务无法启动. mongod仅以root用户身份运行.也许这就是原因.但据我所知,这些服务应该已经在运行,因为它们是由root用户添加的.

I've installed the mongodb 2.0.3, using the mongodb-10gen debian package. Everything went well, except the service which is installed by default is not starting up when computer starts. The mongod is running only as root user. maybe this is the reason. but as far as I know, the services should be running since they are added by the root user.

有什么解决方案?

如果我只运行mongod

Tue Mar 27 13:00:44 [initandlisten] couldn't open /data/db/transaction_processor_dummy_development.ns errno:1 Operation not permitted

如果我运行sudo service mongodb start,它会说:

mongodb start/running, process 4861

,但是使用htopmongo进行查看时没有任何过程:

but there's no process when looking with htop and mongo says:

MongoDB shell version: 2.0.3
connecting to: test
Tue Mar 27 13:02:40 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84
exception: connect failed

推荐答案

已修复!

原因是/etc/mongodb.conf中的dbpath变量. 以前,我使用的是mongodb 1.8,其中dbpath的默认值为/data/db. 新贵作业mongodb(与mongodb-10gen软件包一起提供)使用--config /etc/mongodb.conf选项调用mongod.

The reason was the dbpath variable in /etc/mongodb.conf. Previously, I was using mongodb 1.8, where the default value for dbpath was /data/db. The upstart job mongodb(which comes with mongodb-10gen package) invokes the mongod with --config /etc/mongodb.conf option.

作为解决方案,我只需要递归地更改/data/db目录的所有者.

As a solution, I only had to change the owner of the /data/db directory recursively.

这篇关于mongodb服务未启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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