sudo systemctl restart mongod code example
Example 1: start mongodb service ubuntu
sudo systemctl start mongod
sudo systemctl stop mongod
Example 2: ubuntu start mongodb
sudo mongod --fork --config /etc/mongod.conf
sudo systemctl start mongod
sudo systemctl stop mongod
sudo mongod --fork --config /etc/mongod.conf