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.
We found that the reason for this error was the dbpath variable in /etc/mongodb. conf. Previously, the default value for dbpath was /data/db. The upstart job mongodb(which comes with mongodb-10gen package) invokes the mongod with –config /etc/mongodb.
so the right command to unmask it would be: sudo systemctl unmask mongod .
The mongod process is the primary database process that runs on an individual server. mongos provides a coherent MongoDB interface equivalent to a mongod from the perspective of a client. The mongosh binary provides the administrative shell.
Most probably unit mongodb.service is masked. Use following command to unmask it.
sudo systemctl unmask mongod
and re-run
sudo service mongod start
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With