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.