停止:未知实例 mongodb (Ubuntu) [英] Stop: Unknown instance mongodb (Ubuntu)

查看:20
本文介绍了停止:未知实例 mongodb (Ubuntu)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Mongodb 的新手.当我运行以下命令时:

I am new to Mongodb. When I run the following command:

sudo service mongodb start

它向我显示mongodb 启动/运行,进程 3566".但是当我尝试通过给出以下命令来停止时:

It shows me "mongodb start/running, process 3566". But when I try to stop by giving the below command:

sudo service mongodb stop

它显示停止:未知实例:.有没有人知道如何解决这个问题.

It shows stop: Unknown instance:. Do anybody have any idea how to slove this issue.

如果我给 sudo service mongodb restart,我会收到以下消息:

And if I give sudo service mongodb restart, I'm getting the below message:

stop: Unknown instance: 
mongodb start/running, process 3644

PS:如果我只使用 mongod,我可以启动服务器并可以通过给 mongo 连接 mongo shell.

PS: If I'm using just mongod, I could start the server and could connect the mongo shell by giving mongo.

请建议我如何解决这个问题以及如何在给 service mongodb start 后连接 mongo shell.提前致谢.

Please suggest me how to fix the issue and how to connect mongo shell after giving service mongodb start. Thanks in advance.

推荐答案

我刚遇到这个.问题很可能出在您的 conf 文件中(显然,因为您重新安装了种子)

I just ran into this. Chances are the issue is in your conf file (obviously, since you reinstalled the seeded)

在 mongodb.conf 中,如果将其作为服务调用,请不要设置 fork = true.这将阻止服务调用能够通过 service mongodb.conf status/stop/restart 访问它.

In the mongodb.conf do not set fork = true if calling it as a service. This will prevent the service call from being able to access it with service mongodb.conf status/stop/restart.

然而,删除 fork=True 行将缓解该问题.

Removing a fork=True line, however, will alleviate the issue.

见评论;即使接受了这个解决方案,也可以使用其他解决方案.

See comments; use the other solution even though this one is accepted.

这篇关于停止:未知实例 mongodb (Ubuntu)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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