sudo service mongodb start code example
Example 1: start mongodb service ubuntu
sudo systemctl start mongod
sudo systemctl stop mongod
Example 2: remove mongo lock file from centos 7
sudo rm /var/lib/mongodb/mongod.lock
sudo mongod --repair
sudo service mongod start
sudo service mongod status