我可以通过mongo shell重新启动mongodb服务器吗? [英] Can I restart mongodb server through mongo shell?

查看:52
本文介绍了我可以通过mongo shell重新启动mongodb服务器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过mongo CLI客户端重新启动MongoDB服务器吗?

Can I restart a MongoDB server through the mongo CLI client?

推荐答案

您无法从客户端停止和启动(重新启动)它.正如i.kimiko所述,您可以通过mongo shell db.shutdownServer()在客户端上关闭它/method/db.shutdownServer/"rel =" nofollow noreferrer>数据库方法文档3.6.0 但是然后,您仍然必须连接到服务器并使用 sudo service mongodb start 从那里重新启动服务器.

You can't stop and start (restart) it from the client. As i.kimiko already mentioned, you can shut it down on your client with db.shutdownServer() through a mongo shell database methods documentation 3.6.0 But then you'd still have to connect to the server and restart it from there with sudo service mongodb start for example.

这篇关于我可以通过mongo shell重新启动mongodb服务器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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