[SERVER-18439] Unable to start MongoDB 3.0.2 service on CentOS 7 Created: 12/May/15 Updated: 01/Jun/22 Resolved: 01/Jun/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin, Packaging |
| Affects Version/s: | 3.0.2 |
| Fix Version/s: | 4.1 Desired |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Shashank Agrawal | Assignee: | Alex Neben |
| Resolution: | Won't Fix | Votes: | 3 |
| Labels: | centos, service | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
centos7, amazon ec2 |
||
| Issue Links: |
|
||||||||
| Operating System: | Linux | ||||||||
| Steps To Reproduce: | Given in description |
||||||||
| Participants: | |||||||||
| Description |
|
We are setting up a MongoDB server for the production environment on Amazon EC2 instance, but could not able to start the service. I've followed this documentation for setup. Here are the steps, I've taken for setting up the server: Added following to `/etc/yum.repos.d/mongodb-org-3.0.repo`
And installed MongoDB 3.0.2 using `sudo yum install -y mongodb-org-3.0.2` Created three partitions for data, journal & log:
Created file system for three separate partitions:
Created entry in `fstab` for reboot:
And mounted the partitions:
Given the permissions and created link
Configured `ulimit` & read ahead settings as given in the documentation link above. Verified permissions and partitions:
Permissions:
Inside `/mongo`
After changing the configurations inside `/etc/mongodb.conf`
Also, changed the SELinux setting to `permissive`. Now when I'm doing: `sudo service mongod start`, I'm getting this error:
Further logging:
Kernal version from uname -a:
If I directly run the mongodb service from the normal user something like this: sudo mongod --config /etc/mongod.conf, then this service is starting properly but not as the system service? I've followed various articles and blog posts and stackexchange answers, but didn't get any solution. http://stackoverflow.com/questions/30182016/unable-to-start-mongodb-3-0-2-service-on-centos-7 |
| Comments |
| Comment by Shashank Agrawal [ 19/May/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you, Ernie for your effort. The server on which we are facing problem has gone live for production. So I can't really test your solution on that. We are going to launch a same server and will do the same thing on that server and will get back to you on this. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ernie Hershey [ 15/May/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I was able to reproduce the problem. I think it's either an oddity with systemd's sysvinit compatibility or just with systemd. As a workaround you can move your pid file back to a location under /var/run, or add "SYSTEMCTL_SKIP_REDIRECT=1" to the top of the init script, which will bypass the systemd call being made which is hanging. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Shashank Agrawal [ 14/May/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
No, the content in the file /etc/sysconfig/mongod is empty and only contains one commented line. Also, I'm using command sudo service mongod start and it is freezing after printing the logs I provided in my previous comment. I tried again after rebooting our that database server and I'm still facing that issue. Not sure what is going on. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ernie Hershey [ 14/May/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It all looks okay to me. And mongod is starting fine, which you can tell from this line:
But it shouldn't freeze. It should return. Do you have anything in /etc/sysconfig/mongod? One thing you can try is turning off "fork: true" although it seems to me more like having it inadvertently turned off already would be causing the problem you're seeing. Can you try that and see if it makes a difference? Also sorry to ask for you to repeat yourself but when you see the freezing behavior can you tell me exactly what command you're using when you see that? Thanks, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Shashank Agrawal [ 14/May/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Ernie, thank you for the quick reply on this. Previously, when I was doing sudo service mongod start nothing was getting logged in the log file, but when I did it today after your comment I'm getting following log:
Looks like a problem with permission, so I deleted the old content inside the data directory & fixed the permission issue since we were running the mongod process directly with the root user as described in my question. Now when I'm starting the service again it's getting freeze at the state:
with the following logs in mongod.log
The data at /etc/mongodb.conf is having only following data (rest are commented):
Also, content of /etc/init.d/mongod is:
As you asked to run: bash -x /etc/rc.d/init.d/mongod start the output is:
Please note: I've mentioned in the question that we have created three separate partition mounted on /mongo/data, /mongo/journal and /mongo/log but we had changed it to simply /data, /journal and /log to further debug the problem before adding question on Jira but permissions were correct at that time also since I've added the real data on the question. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ernie Hershey [ 13/May/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi sagrawal14 - Can you clear out your mongod.log and see if anything is in it after trying to start the service? Also If you're comfortable with it, can you attach your mongod.conf and /etc/init.d/mongod? And run this and share the output: bash -x /etc/rc.d/init.d/mongod start Thanks, |