YAML config file FAIL

90 views
Skip to first unread message

k...@briteverify.com

unread,
Nov 10, 2014, 8:22:50 PM11/10/14
to mongod...@googlegroups.com
Hi,

I've been beating my head against this for a while and almost filled up my log partition the other day, so I thought I'd seek some help with it. I'm a sysadmin, not a DBA, so please forgive me if I'm missing something that might be obvious to a database-y type person. My problem is this: Mongod does not start when I replace my old, 2.4-style config file with the YAML file I made to replace it. It looks like this from the command line:

# service mongod restart

Stopping mongod:                                           [  OK  ]

Starting mongod:                                           [FAILED]

The log just shows the shutdown, as it fails to start.

My old config file, the one that works, looks like this:

-----

# mongod.conf


#where to log

logpath=/var/log/mongo/mongod.log


logappend=true


# fork and run in background

fork=true


#port=27017


dbpath=/var/lib/mongo


# location of pidfile

pidfilepath=/var/run/mongodb/mongod.pid


# Listen to local interface only. Comment out to listen on all interfaces. 

#bind_ip=127.0.0.1


# Disables write-ahead journaling

# nojournal=true


# Enables periodic logging of CPU utilization and I/O wait

#cpu=true


# Turn on/off security.  Off is currently the default

#noauth=true

auth=true


# Verbose logging output.

#verbose=true


# Inspect all client data for validity on receipt (useful for

# developing drivers)

#objcheck=true


# Enable db quota management

#quota=true


# Set oplogging level where n is

#   0=off (default)

#   1=W

#   2=R

#   3=both#   7=W+some reads

#diaglog=0


# Ignore query hints

#nohints=true


# Enable the HTTP interface (Defaults to port 28017).

#httpinterface=true


# Turns off server-side scripting.  This will result in greatly limited

# functionality

#noscripting=true


# Turns off table scans.  Any query that would do a table scan fails.

#notablescan=true


# Disable data file preallocation.

#noprealloc=true


# Specify .ns file size for new databases.

# nssize=<size>


# Replication Options


# in replicated mongo databases, specify the replica set name here

#replSet=setname

# maximum size in megabytes for replication operation log

#oplogSize=1024

# path to a key file storing authentication info for connections

# between replica set members

#keyFile=/path/to/keyfile

-----

My new config file that doesn't work looks like this, aside from the IPs being changed for confidentiality:

-----

# new style YAML mongod.conf, -Kit, 09-04-14


# storage

storage:

        dbPath: "/var/lib/mongo"


# logging

systemLog:

        destination: file

        path: "/var/log/mongo/mongod.log"

        quiet: true

        logAppend: true

   

processManagement:

        fork: true

        pidFilePath: "/var/run/mongodb/mongod.pid"

        

net:

        bindIp: 127.0.0.1, 10.171.22.22, 50.22.221.22

        port: 27017

        

security:

        authorization: enabled

-----


Can anyone spare a clue for me? I am puzzled as to why and how this fails.


Thanks,

-Kit

Asya Kamsky

unread,
Nov 11, 2014, 8:11:57 PM11/11/14
to mongodb-user
Easiest way to tell is start it from the command line:

/path/to/mongod --config /path/to/mongodb.conf

It will likely give an error to the console if it can't parse
something in the config file.
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user"
> group.
>
> For other MongoDB technical support options, see:
> http://www.mongodb.org/about/support/.
> ---
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-user...@googlegroups.com.
> To post to this group, send email to mongod...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mongodb-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mongodb-user/977028e2-d18f-4f3d-b535-c202dd5506c9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

k...@briteverify.com

unread,
Nov 11, 2014, 9:00:48 PM11/11/14
to mongod...@googlegroups.com
Thanks for that, but it gives me nothing.
-----

# service mongod stop

Stopping mongod:                                           [  OK  ]

# /usr/bin/mongod --config /etc/mongod.conf.yaml 

about to fork child process, waiting until server is ready for connections.

forked process: 24369

child process started successfully, parent exiting

# ps ax | grep mongo

 8974 ?        S      0:00 su -s /bin/bash mongodb-mms-agent -c /usr/bin/mongodb-mms-monitoring-agent -conf /etc/mongodb-mms/monitoring-agent.config

 8983 ?        Ssl   31:06 /usr/bin/mongodb-mms-monitoring-agent -conf /etc/mongodb-mms/monitoring-agent.config

24460 pts/0    S+     0:00 grep mongo

# ps ax | grep 24369

24525 pts/0    S+     0:00 grep 24369

-----
Thanks,
-Kit

Asya Kamsky

unread,
Nov 12, 2014, 2:06:57 PM11/12/14
to mongodb-user

What's in the log file?

Asya

k...@briteverify.com

unread,
Nov 12, 2014, 2:14:27 PM11/12/14
to mongod...@googlegroups.com
Nothing.
----

# /usr/bin/mongod --config /etc/mongod.conf.yaml 

about to fork child process, waiting until server is ready for connections.

forked process: 32024

child process started successfully, parent exiting

# tail /var/log/mongo/mongod.log 

2014-11-12T19:09:00.171+0000 [initandlisten] shutdown: going to close sockets...

2014-11-12T19:09:00.171+0000 [initandlisten] shutdown: waiting for fs preallocator...

2014-11-12T19:09:00.171+0000 [initandlisten] shutdown: lock for final commit...

2014-11-12T19:09:00.171+0000 [initandlisten] shutdown: final commit...

2014-11-12T19:09:00.176+0000 [initandlisten] shutdown: closing all files...

2014-11-12T19:09:00.178+0000 [initandlisten] closeAllFiles() finished

2014-11-12T19:09:00.178+0000 [initandlisten] journalCleanup...

2014-11-12T19:09:00.178+0000 [initandlisten] removeJournalFiles

2014-11-12T19:09:00.180+0000 [initandlisten] shutdown: removing fs lock...

2014-11-12T19:09:00.180+0000 [initandlisten] dbexit: really exiting now

-----

-Kit

Asya Kamsky

unread,
Nov 14, 2014, 1:28:37 PM11/14/14
to mongodb-user
That's tail - the relevant part would be *before* mongod shuts down.

Asya
> https://groups.google.com/d/msgid/mongodb-user/e6c51809-a837-4655-a06e-0cc399713c5d%40googlegroups.com.

Kit Halsted

unread,
Nov 14, 2014, 1:56:18 PM11/14/14
to mongod...@googlegroups.com
Oh, my bad! I thought that was the old mongod shutting down in the logs; thanks for the clue!

The problem seems to be here:

2014-11-14T18:37:12.958+0000 [initandlisten] options: { config: "/etc/mongod.conf.yaml", net: { bindIp: "127.0.0.1, 10.171.22.22, 50.22.22.22", port: 27017 }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, security: { authorization: "enabled" }, storage: { dbPath: "/var/lib/mongo" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongo/mongod.log", quiet: true } }
2014-11-14T18:37:12.965+0000 [initandlisten] journal dir=/var/lib/mongo/journal
2014-11-14T18:37:12.965+0000 [initandlisten] recover : no journal files present, no recovery needed
2014-11-14T18:37:13.127+0000 [initandlisten] getaddrinfo(" 10.171.22.22") failed: Name or service not known
2014-11-14T18:37:13.131+0000 [initandlisten] getaddrinfo(" 50.22.22.22") failed: Name or service not known
2014-11-14T18:37:13.131+0000 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2014-11-14T18:37:13.131+0000 [initandlisten] ERROR: addr already in use
2014-11-14T18:37:13.133+0000 [initandlisten] now exiting

Commenting out the "bindIp:" line in the config seems to have fixed it.

Thanks,
-Kit
> You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/iskgytYL3YI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
> To post to this group, send email to mongod...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mongodb-user.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAOe6dJAFCzxADXZYE_0fpo4gP%3DHqi%3Dj1Cn45h8Hyu6BhLo%3DVGg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages