MongoDB 服务器问题,(匿名):1137 异常连接失败

MongoDB 服务器问题,(匿名):1137 异常连接失败

我最近在 Ubuntu 上安装了 MongoDB 服务器。它运行正常,我也使用 PHP 中的 id,但我不知道为什么它开始失败。这是我第一次使用 mongodb,所以我有点迷茫。

实际上,当尝试通过 PHP 或 shell 访问 mongo 时:

root@ubuntu:~# /etc/init.d/mongodb restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongodb restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mongodb ; start mongodb. The restart(8) utility is also available.
mongodb start/running, process 7223
root@ubuntu:~#

root@ubuntu:~# mongo
MongoDB shell version: 1.6.3
Wed Sep  7 10:20:35 *** warning: spider monkey build without utf8 support.  consider rebuilding with utf8 support
connecting to: test
Wed Sep  7 10:20:35 Error: couldn't connect to server 127.0.0.1 (anon):1137
exception: connect failed
root@ubuntu:~#

我第一次使用 Spider Monkey 时没有出现错误。而且它起作用了。我尝试重新安装,但没有任何效果。

我该如何解决这个问题?

提前谢谢您!如有任何需要补充的信息,请告知我。

答案1

正如它所说,尝试一下:

# start mongodb

另请查看暴发户- 基于事件的 SysV init 替代品。

相关内容