Failed to start mongod.service: Unit mongod.service not found

1.5K    Asked by IraJoshi in Spark , Asked on May 11, 2021

 I follow all the steps mention in mongodb installation documents.

for ubuntu 16.04

steps 1:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
steps 2:
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
steps 3:
sudo apt-get update
steps 4:
sudo apt-get install -y mongodb-org
steps 5:
sudo service mongod start
when I started mongodb got an error as
"Failed to start mongod.service: Unit mongod.service not found." please help me to solve this.

Answered by Carole Thom

In case, you failed to start mongod.service: unit mongod.service not found then you should use unit mongodb.service is masked. Use the following command to unmask it.

  sudo systemctl unmask mongodb

and after that re-run the below-mentioned command:-

  sudo service mongod start


Your Answer

Interviews

Parent Categories