[SERVER-19792] Starting mongod service on CentOS 7 fails Created: 06/Aug/15  Updated: 10/Aug/15  Resolved: 10/Aug/15

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 3.0.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Patrick Wanjau Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

Install mongodb packages using package manager.
yum install mongodb-org -y
sudo systemctl start mongod

Participants:

 Description   

mongod.service - SYSV: Mongo is a scalable, document-oriented database.
Loaded: loaded (/etc/rc.d/init.d/mongod)
Active: failed (Result: exit-code) since Thu 2015-08-06 09:16:21 EAT; 20s ago
Process: 9621 ExecStart=/etc/rc.d/init.d/mongod start (code=exited, status=1/FAILURE)

Aug 06 09:16:21 localhost.localdomain runuser[9627]: pam_unix(runuser:session): session opened for user mongod by (uid=0)
Aug 06 09:16:21 localhost.localdomain runuser[9627]: pam_unix(runuser:session): session closed for user mongod
Aug 06 09:16:21 localhost.localdomain mongod[9621]: Starting mongod: [FAILED]
Aug 06 09:16:21 localhost.localdomain systemd[1]: mongod.service: control process exited, code=exited status=1
Aug 06 09:16:21 localhost.localdomain systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database..
Aug 06 09:16:21 localhost.localdomain systemd[1]: Unit mongod.service entered failed state.



 Comments   
Comment by Ramon Fernandez Marina [ 10/Aug/15 ]

Thanks for double checking patwanjau, glad to hear that things are working now. The permissions for /var/lib/mongo are already set on package installation, so is not clear how this directory was owned by root in your setup. If you do clean install and permissions for /var/lib/mongo are not set correctly please let us know so we can investigate further.

Regards,
Ramón.

Comment by Patrick Wanjau [ 06/Aug/15 ]

I've inspected the logs, and from my end, the issue was with permissions. By default, the directory ownership for /var/lib/mongo was set to root. I've updated this to reflect owner as mongod and the daemon has started successfully.

I'd suggest that this should be defaulted to user mongod as default user while installing the server, or be included in setup documentation for other users.

Comment by Ramon Fernandez Marina [ 06/Aug/15 ]

patwanjau, can you please upload the logs produced by mongod when the above failure happens?

Thanks,
Ramón.

Comment by Patrick Wanjau [ 06/Aug/15 ]

Affected OS version: Linux localhost.localdomain 3.10.0-229.7.2.el7.x86_64 #1 SMP Tue Jun 23 22:06:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Generated at Thu Feb 08 03:52:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.