I can start mongodb on terminal via command
./mongod
It starts the mongodb server and then display me information that server is running on this port. but It does not give my terminal back. How can I start mongodb and can get terminal back so mongodb is running the background.
Also how to shutdown if its running in background
Use
or
To shutdown you have to send it a TERM signal.
ps aux | grep mongod– to find a PIDkill -TERM PID– send it a TERM signal, and using the first example we can use the PID file:kill -TERM $(cat /var/run/mongodb/mongod.pid)Also you can shut it down from the shell.
—
And another method:
then (please notice the ticks around the cat)