MongoDB Error: Failed to start mongod.service: Unit mongod.service is not loaded properly

solution


– command line input below, open mongodb.service file
that is

 sudo vim /etc/systemd/system/mongodb.service

– paste and copy the following to the open file
or

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf

[Install]
WantedBy=multi-user.target

Sudo service mongod stop
restart: sudo service mongod stop
restart: sudo service mongod restart

, however, I later found this problem again, at this point using the above boot command still does not work.
then run this startup command:
sudo systemctl start mongodb
problem solved

Read More: