我已经在 docker 容器上安装了 mongodb,并在 ubuntu 14.04 上安装了 openssh。容器正在使用 ssh 运行,但是当我 ssh 进入容器时,尝试启动 mongod 时出现以下错误。
root@430f9502ba2d:~# service mongod start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongod start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mongod
Also start mongod
不影响任何事情。
也尝试过看看这个Mongo 守护进程不通过服务 mongod start 运行 https://stackoverflow.com/questions/25271077/mongo-daemon-doesnt-run-by-service-mongod-start?rq=1没有它的帮助。
mongod --config /your/path/to/mongod.conf
似乎也不起作用,只是锁定。
下面的错误是标准错误,因为当然没有运行 mongod 服务器。
root@430f9502ba2d:/# mongo
MongoDB shell version: 2.6.9
connecting to: test
2015-05-07T20:49:56.213+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-05-07T20:49:56.214+0000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed