0% found this document useful (0 votes)
98 views

(SOLVED) Mongod Service Start Exits With Code 100 - MongoDB Knowledge Base

The document summarizes troubleshooting steps for a MongoDB service that fails to start with exit code 100 on an Ubuntu 16.04 system. The key issues addressed are incorrect ownership of the data directory and log files, and a missing mongod.lock file. Running mongod directly from the command line works but starting from the service fails, and enabling authentication during setup may have introduced permissions problems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views

(SOLVED) Mongod Service Start Exits With Code 100 - MongoDB Knowledge Base

The document summarizes troubleshooting steps for a MongoDB service that fails to start with exit code 100 on an Ubuntu 16.04 system. The key issues addressed are incorrect ownership of the data directory and log files, and a missing mongod.lock file. Running mongod directly from the command line works but starting from the service fails, and enabling authentication during setup may have introduced permissions problems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

 

MongoDB Pedia Tutorial Knowledge-Base Awesome

Mongod Service start exits with


code 100
mongodb service ubuntu-16.04

Question Accepted Answer


Problem You may still have some
problems with the permissions in
My mongo service does not start your data directory. Especially if
anymore: you have run mongod from the
terminal to start with.
root@machine ~ # service mongod
root@machine ~ # service mongod I find that the data files are
● mongod.service - High-perform
created under root not the
Loaded: loaded (/lib/systemd
mongodb user when you run Icon
Active: failed (Result: exit
Docs: https://docs.mongodb from the terminal. To fix ..
Process: 26942 ExecStart=/usr
Main PID: 26942 (code=exited, cd /var/lib/mongodb
sudo chown -R mongodb:mongodb *
Aug 15 12:03:50 machine systemd
Aug 15 12:03:51 machine systemd
Aug 15 12:03:51 machine systemd rockettc
Aug 15 12:03:51 machine systemd

Where exit code 100 is blurry


defined as: Popular Answer
rm /var/lib/mongodb/mongod.lock
Returned by mongod when the
systemctl restart mongod
process throws an uncaught systemctl status mongod
exception.

What I did
Try this!
First, I have installed my
A. Pascual
mongodb (3.4.7) on Ubuntu
16.04.2 LTS via the official guide.

Starting and stopping the service


worked fine. So I continued to
enable authentication (again via
the official guide).

Then I added the service to be


able to run on server startup.

root@machine ~ # systemctl enab

mongod.conf

I also edited my config file, which


is passed a yaml linter:

# Where and how to store data.


storage:
dbPath: /var/lib/mongodb
journal:
enabled: true

# engine: mmapv1
# mmapv1:
# wiredTiger:

# where to write logging data.


systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod

# network interfaces
net:
port: 27017
bindIp: 127.0.0.1

#processManagement:

security:
authorization: enabled

The ownership of the file is

root@machine ~ # ls -la /etc/ |


-rw-r--r-- 1 root root 5

DbPath

I know there are issues with the


dbpath so this is what
/var/lib/mongodb has in terms
of ownership:

root@ machine ~ # ls -la /var/l


drwxr-xr-x 4 mongodb mong

Service List

When listing all services via


service --status-all there is

no entry for any mongo related


service.

Somebody has a clue what could


cause the issue?

UPDATE

As suggested I ran the following


command (with a slight
modification):

root@machine ~ /usr/bin/mongod
[1] 28495

When I get it right, this is a direct


execute of the binary. This allows
me now to at least login into
mongo shell:

root@machine ~ # mongo
MongoDB shell version v3.4.7
connecting to: mongodb://127.0.
MongoDB server version: 3.4.7
>

However, the service status is still


remaining failed with exit code
100.

UPDATE UPDATE

When typing
root@machine ~ #
/usr/bin/mongod --verbose

I receive the following error:

2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 D
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I
2017-08-15T13:45:40.973+0200 I

Jankapunkt

View more on Stack Overflow

Licensed under: CC-BY-SA with attribution


Not affiliated with: Stack Overflow

You might also like