mongod 4 and centos 7 problem

745 views
Skip to first unread message

Tim Arnold

unread,
Jul 27, 2018, 10:40:10 AM7/27/18
to mongodb-user
hi,
I can install mongodb-org.x86_64 0:4.0.0-1.el7 on my centos7 box with no error but when I try to start the mongod process, I get this:

Job for mongod.service failed because a timeout was exceeded. See "systemctl status mongod.service" and "journalctl -xe" for details.

% systemctl status mongod.service

● mongod.service - MongoDB Database Server
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Fri 2018-07-27 14:18:13 UTC; 7s ago
  Process: 16525 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
  Process: 16521 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
  Process: 16518 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
  Process: 16515 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)

That's not enough info for me to figure out what I should do, everything says SUCCESS.

% sudo yum install -y mongodb-org
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:4.0.0-1.el7 will be installed
--> Finished Dependency Resolution
...
Installed:
  mongodb-org.x86_64 0:4.0.0-1.el7
Complete!

% sudo systemctl start mongod.service

then I get the results above.

My /etc/mongod.conf file:
---
systemLog:
  destination: file
  quiet: true
  path: /var/log/mongodb/mongod.log
  logAppend: true

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

processManagement:
   fork: true

net:
   bindIp: <my external ip is here, not localhost>
   port: 27017

Can you tell what's wrong? I'm at a loss. BTW, getenforce returns 'Disabled' so I guess SELinux is not the problem.

thanks,
--Tim

Wan Bachtiar

unread,
Aug 1, 2018, 11:27:31 PM8/1/18
to mongodb-user

Can you tell what’s wrong? I’m at a loss. BTW, getenforce returns ‘Disabled’ so I guess SELinux is not the problem.

Hi Tim,

I just tried to replicate the issue on CentOS 7 (1804), but seems to work without any issue.
Check the content of the log file in /var/log/mongodb/mongod.log to see if there’s any error.

Also, I noticed from your mongod.conf file that you have database path in /var/db/mongodb. Could you make sure this directory exist and the permission is correct ? The default should be in /var/lib/mongo.

Regards,
Wan.

Tim Arnold

unread,
Aug 2, 2018, 9:17:28 AM8/2/18
to mongodb-user
Hi Wan,
Thank you for taking a look. I'm using ansible (yum module) to install and I think I see what I did wrong.

I created the repo file in /etc/yum.repos.d but named it as mongodb.repo; when I changed the name to mongodb-org-4.0.repo, everything started working.

That was yesterday but it seems to be fine now. 
thanks again,
--Tim
Reply all
Reply to author
Forward
0 new messages