问题描述
在不同的论坛上,此问题有很多不同形式.我尝试了很多方法来使其正常工作.我正在使用Bitnami的AWS EC2和MEAN,我尝试使用Node JS进行连接,但我意识到我的monogodb服务未运行.我通过在终端上运行(通过腻子连接)进行了检查
There are a lot of variations for this question, on different forums. I tried a lot of things to get it to work. I am using AWS EC2 and MEAN by Bitnami, I tried connecting using Node JS and I realized that my monogodb service is not running. I checked it by running on the terminal (connected using Putty)
service mongod status
这是我得到的错误
为了尝试好运,我尝试了
To try my luck, I tried
sudo service mongod restart
我收到此错误:
现在,为了进一步探究,我尝试查看是否已安装此服务.我运行了以下命令:ls /lib/systemd/system
它给出了一个庞大的列表,但我在任何地方都找不到mongod.service.
Now, just to probe more I tried looking if I have this service installed.I ran this command: ls /lib/systemd/system
And it gave a huge list, but I couldn't find mongod.service anywhere.
我的Ubuntu版本:16.04我猜它不存在,或者我正在寻找错误的东西.请让我知道如何使该服务运行.我对MongoDB和Bitnami有点陌生.
My Ubuntu Ver: 16.04I am guessing it's not present or maybe I am looking for the wrong stuff. Please let me know how do I get the service to run. I am sort of new to MongoDB and Bitnami.
推荐答案
每个Bitnami MEAN堆栈都包含一个控制脚本,使您可以轻松地停止,启动和重新启动服务.
Each Bitnami MEAN stack includes a control script that lets you easily stop, start and restart services.
脚本位于/opt/bitnami/ctlscript.sh
.
要启动所有服务,请执行以下操作:
To start all services:
sudo /opt/bitnami/ctlscript.sh start
要启动一项服务:
sudo /opt/bitnami/ctlscript.sh start <service name>
所以回答您的问题:
sudo /opt/bitnami/ctlscript.sh start mongod
您可以通过运行不带任何参数的脚本来获取可用服务和操作的列表:
You can obtain a list of available services and operations by running the script without any arguments:
sudo /opt/bitnami/ctlscript.sh
这篇关于无法重新启动mongod.service:找不到单元mongod.service的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!