MongoDB — Ubuntu 16.04 (code=exited, status=14) AWS lightsail problem

Hi, here is a quick tip about a really annoying problem when you install MongoDB over Ubuntu 16.04 distro at AWS LightSail.

When you start your MongoDB through:

sudo service mongod start

And the result is something like this:

● mongod.service — High-performance, schema-free document-oriented database Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2016–12–07 03:43:00 UTC; 3min 9s ago Docs: https://docs.mongodb.org/manual Process: 24453 ExecStart=/usr/bin/mongod — quiet — config /etc/mongod.conf (code=exited, status=14) Main PID: 24453 (code=exited, status=14)

And you don't know why.

The problem is, the Mongodb SOCK do not belong to the mongodb group and user.

So here is a quick fix

1 — Go to the TMP directory: cd /tmp
2 — Check if you have the mongodb sock file: ls *.sock
3 — Change the user:group permission: chown mongodb:mongodb <YOUR_SOCK>
4 — Start MongoDB: sudo service mongod start
5 — Check the MongoDB status: sudo service mongod status

As the result, you should see something like this:

● mongod.service — High-performance, schema-free document-oriented database Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled) Active: active (running) since Wed 2016–12–07 03:48:30 UTC; 6s ago Docs: https://docs.mongodb.org/manual Main PID: 24720 (mongod) Tasks: 13 Memory: 40.1M CPU: 66ms CGroup: /system.slice/mongod.service └─24720 /usr/bin/mongod — quiet — config /etc/mongod.conf

If the problem persist, feel free to contact me: Twitter @gabrielpires or by e-mail eu at gabrielpires.com.br

SEEYA!

Like what you read? Give Gabriel Pires a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.