How can the Mongodb database service on the server be always enabled by default?
漂亮男人2017-05-02 09:23:54
0
2
743
After connecting to the server remotely, start the mongodb service on the server. How to keep the service running after disconnecting the remote connection
Use mongod -f to add the configuration file, set fork=true in it and run it in the background. My mongo configuration file is in /data/mongo/27017.conf
If I understand your question correctly, you use ssh to remotely log in to the server and start mongodb; then close the ssh connection and the service stops running.
It is recommended that when starting mongodb, let it run as a daemon process.
Use mongod -f to add the configuration file, set fork=true in it and run it in the background.
My mongo configuration file is in /data/mongo/27017.conf
Run the command mongod -f /data/mongo/27017.conf and it’s done
Thanks.
If I understand your question correctly, you use ssh to remotely log in to the server and start mongodb; then close the ssh connection and the service stops running.
It is recommended that when starting mongodb, let it run as a daemon process.
mongod adds --fork startup option.