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

查看:61
本文介绍了停止:未知实例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服务mongodb重新启动,我将收到以下消息:

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.

在为服务mongodb启动之后,请建议我如何解决此问题以及如何连接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.这将阻止服务调用通过服务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天全站免登陆