[SERVER-20440] Mongod service not starting after updating config with yaml format Created: 16/Sep/15  Updated: 19/Dec/15  Resolved: 19/Sep/15

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

Type: Bug Priority: Critical - P2
Reporter: Dharminder Singh Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

I am running mongod version 3.0 currently i am going to post my mongod.conf and the error i am getting. I am using the default mongod script that comes with the rpm with no changes being made. All the permissions are correct from what i see. Not getting a permissions error.

[root@ctsnapmongodev01 ~]# cat /etc/mongod.conf
# mongod.conf
storage:
    dbPath: "/data/db"
systemLog:
    path: "/var/log/mongodb/mongod.log"
    logAppend: true
processManagement:
    pidfilepath=/var/run/mongodb/mongod.pid
    fork: true
net:
    bindIp: 127.0.0.1
    port: 27018
sharding:
   clusterRole: shardsvr
replication:
   oplogSizeMB: 1024
}'

Error:

Sep 16 13:56:43 ctsnapmongodev01.surveysampling.com runuser[7372]: pam_unix(runuser:session): session opened for user mongod by (uid=0)
Sep 16 13:56:43 ctsnapmongodev01.surveysampling.com runuser[7372]: pam_unix(runuser:session): session closed for user mongod
Sep 16 13:56:43 ctsnapmongodev01.surveysampling.com mongod[7366]: Starting mongod: [FAILED]
Sep 16 13:56:43 ctsnapmongodev01.surveysampling.com systemd[1]: mongod.service: control process exited, code=exited status=1



 Comments   
Comment by Valery Khamenya [ 19/Dec/15 ]

while trying to hook up the mongodb2 data from mongodb3.2 I am getting similar problems with directoryPerDB:true on mongod start:

2015-12-19T15:33:06.843+0100 I -        [initandlisten] Detected data files in /var/storage/mongodb-storage-pdb created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.
2015-12-19T15:33:06.843+0100 D -        [initandlisten] User Assertion: 72:Requested option conflicts with current storage engine option for directoryPerDB; you requested true but the current server storage is already set to false and cannot be changed
2015-12-19T15:33:06.843+0100 I STORAGE  [initandlisten] exception in initAndListen: 72 Requested option conflicts with current storage engine option for directoryPerDB; you requested true but the current server storage is already set to false and cannot be changed, terminating
2015-12-19T15:33:06.843+0100 I CONTROL  [initandlisten] dbexit:  rc: 100

any ideas?

Comment by Dharminder Singh [ 22/Sep/15 ]

figured it out it was my yaml config, here is the correct way to write a yaml config:

  1. mongod.conf
    storage:
    dbPath: "/var/lib/mongo"
    directoryPerDB: true
    systemLog:
    destination: file
    path: "/var/log/mongodb/mongod.log"
    logAppend: true
    processManagement:
    fork: true
    pidFilePath: /var/run/mongodb/mongod.pid
    net:
    bindIp: 127.0.0.1
    port: 27019
    sharding:
    clusterRole: shardsvr
    replication:
    oplogSizeMB: 1024
Comment by Ramon Fernandez Marina [ 19/Sep/15 ]

dsrakkar, there's is not sufficient information in this ticket to determine of there's a bug in the server. Please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag, where your question will reach a larger audience. A question like this involving more discussion would be best posted on the mongodb-user group. See also our Technical Support page for additional support resources.

Regards,
Ramón.

Comment by Dharminder Singh [ 18/Sep/15 ]

Can someone help me with this?

Comment by Dharminder Singh [ 16/Sep/15 ]

Another thing the service stopped working after i changed the conf file format to yaml.

Comment by Dharminder Singh [ 16/Sep/15 ]

/var/log/mongo/mongod:

2015-09-16T10:39:48.918-0400 I STORAGE  [initandlisten] exception in initAndListen: 72 Requested option conflicts with current storage engine option for directoryPerDB; you requested true but the current server storage is already set to false and cannot be changed, terminating
2015-09-16T10:39:48.918-0400 I CONTROL  [initandlisten] dbexit:  rc: 100\

I have resolved the issue above with " directoryPerDB", but no new errors about" pam_unix(runuser:session): session closed for user mongod"

Comment by Dharminder Singh [ 16/Sep/15 ]

Config File:

  1. mongod.conf

    storage:
        dbPath: "/data/db"
    systemLog:
        path: "/var/log/mongodb/mongod.log"
        logAppend: true
    processManagement:
        pidfilepath=/var/run/mongodb/mongod.pid
        fork: true
    net:
        bindIp: 127.0.0.1
        port: 27018
    sharding:
       clusterRole: shardsvr
    replication:
       oplogSizeMB: 1024
    

Permissions for the /var/run/mongodb

drwxr-xr-x   2 mongod    mongod             40 Sep 16 11:51 mongodb

Error i am getting:

 runuser[7372]: pam_unix(runuser:session): session opened for user mongod by (uid=0)
 runuser[7372]: pam_unix(runuser:session): session closed for user mongod
: Starting mongod: [FAILED]
 systemd[1]: mongod.service: control process exited, code=exited status=1

Comment by Ramon Fernandez Marina [ 16/Sep/15 ]

dsrakkar, can you please post the output of /var/log/mongodb/mongo.log?

Also, what are the permissions of /var/run/mongodb? Note that this directory is used by the system, so even if the user that runs mongod can write there it probably shouldn't.

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