How Do You Troubleshoot Mongodb when It Will Not Start and You Get This Error “Failed to start mongodb.service: Unit mongodb.service not found.”?

Problem scenario
Using Linux you try to start the Mongodb service, but the service fails to start.  You get this error: "Failed to start mongodb.service: Unit mongodb.service not found."  How do you fix this problem?

Verify you have this file: /etc/systemd/system/mongodb.service
Verify it has this content (with the last line being the "" stanza):

Description=High-performance, schema-free document-oriented database

ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf


With Ubuntu 16 the command "systemctl start mongodb" (as root with no quotes) should start the Mongodb service.

See what version of Mongo you have installed by going to this link.

Leave a comment

Your email address will not be published. Required fields are marked *