问题描述
我在 Google Compute Engine 上创建了一个 linux debian 实例.
I created a instance of linux debian on Google Compute Engine.
我安装git、node.js、python等一些东西都没有问题
I Install git, node.js, python and some other things without problems
但是当我安装mongodb的时候,安装完成后尝试运行mongod,说:[失败] 启动数据库:mongod 失败!
But when I install mongodb, when finish the installation and the installation try to run mongod, said:[FAIL] Starting database: mongod failed!
我尝试使用:sudo service mongod start 并且是相同的.
I try with: sudo service mongod start and was the same.
我尝试了很多类似的东西:
I try many thing like:
rm mongodb.lock
rm mongodb.lock
改变数据路径到/data/db将权限更改为 mongodb.log
Change path of data to / data / dbChange permisions to mongodb.log
但没有任何效果.
当我运行/etc/init.d/mongod start
When I run /etc/init.d/mongod start
错误是:start-stop-daemon:无法将 9 月 gid 设置为 65534(不允许操作)失败的!
The error is:start-stop-daemon: unable to September gid to 65534 (Operation not permitted) failed!
知道可能是什么错误吗?
Any idea what could be the error?
mongodb.log 是空的,所以我可以在这里粘贴详细的结果.
The mongodb.log is empty so, I can paste here the results of verbose.
谢谢
推荐答案
如果你在 mongodb-org 的 apt-get 日志中看到这种错误日志:
If you are seeing this kind of error log in the apt-get log of mongodb-org:
Package mongodb-org-server is not configured yet.
这可能与语言环境的 GCE debian 映像错误有关https://github.com/andsens/bootstrap-vz/issues/49
This maybe related to the GCE debian image bug with the localehttps://github.com/andsens/bootstrap-vz/issues/49
所以解决这个问题的方法是:
So a way around this is to do:
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
dpkg-reconfigure 命令将打开一个对话框,用于选择所需的语言环境.只需选择全部生成,然后选择 e_US.UTF-8
The dpkg-reconfigure command will open a dialog for selecting the desires locales. Just select generate all, then choose e_US.UTF-8
然后您可以按照以下步骤操作:
Then you can follow the steps in :
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/
正如你以前可能做过的那样.
As you have probably have done before.
这在今天的 gce debian-7 映像中对我有用.
This worked for me in gce debian-7 image today.
这篇关于debian上的服务mongod启动不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!