Errors when trying to set storage.directoryPerDB in the config file but —directoryperdb works when starting manually

677 views
Skip to first unread message

Dan Finn

unread,
Jan 15, 2015, 10:19:11 AM1/15/15
to mongod...@googlegroups.com
Version 2.6.6-1 on CentOS 6.6

I'm trying to enable directoryPerDB.  I tried setting it in the following ways in the config file:

storage.directoryPerDB: true

directoryPerDB: true

directoryPerDB

and none of those worked, they all resulted in this error:

Starting mongod: Error parsing INI config file: unrecognized line in 'directoryPerDB'

What does work though is if I add --directoryperdb as a flag when starting mongod manually.  Am I doing something wrong when trying to add this to the config file?  I found various examples online of other people doing this (all using the first line mentioned above) so I'm assuming it should work.

Thanks,

Dan

Spencer Jackson

unread,
Jan 15, 2015, 3:46:35 PM1/15/15
to mongod...@googlegroups.com
Hi Dan, I gave this a go and came up with a couple of configuration files which enabled the setting on my machine, which I've attached. I ran them manually like this:

sajack@linux /home/sajack/mongo git r2.6.6 () % ./mongod --config db.config
2015-01-15T15:39:07.491-0500 [initandlisten] MongoDB starting : pid=22434 port=27017 dbpath=/data/db 64-bit host=linux.site
2015-01-15T15:39:07.491-0500 [initandlisten] _DEBUG build (which is slower)
2015-01-15T15:39:07.492-0500 [initandlisten] db version v2.6.6
2015-01-15T15:39:07.492-0500 [initandlisten] git version: 608e8bc319627693b04cc7da29ecc300a5f45a1f
2015-01-15T15:39:07.492-0500 [initandlisten] OpenSSL version: OpenSSL 1.0.1j-fips 15 Oct 2014
2015-01-15T15:39:07.492-0500 [initandlisten] build info: Linux linux.site 3.16.7-7-desktop #1 SMP PREEMPT Wed Dec 17 18:00:44 UTC 2014 (762f27a) x86_64 BOOST_LIB_VERSION=1_49
2015-01-15T15:39:07.492-0500 [initandlisten] allocator: tcmalloc
2015-01-15T15:39:07.492-0500 [initandlisten] options: { config: "db.config", storage: { directoryPerDB: true } }

Do these files enable the setting for you?
If no, can you copy paste your shell output, including the command you're running? Thanks!

Cheers,
Spencer
db.config
db2.config

Dan Finn

unread,
Jan 16, 2015, 10:29:35 AM1/16/15
to mongod...@googlegroups.com
Hmm...Neither worked.  They generated the following errors:

[root@icebox-backup ~]# /etc/init.d/mongod32 start
Starting mongod: Error parsing INI config file: unrecognized line in 'storage.directoryPerDB: true'
try '/usr/bin/mongod --help' for more information
                                                           [FAILED]
[root@icebox-backup ~]# vi /etc/mongo/mongod32.conf 
[root@icebox-backup ~]# /etc/init.d/mongod32 start
Starting mongod: Error parsing INI config file: unrecognized line in 'storage:'
try '/usr/bin/mongod --help' for more information
                                                           [FAILED]

I have attached my config.

Thanks,
Dan
mongo_config.txt

Spencer Jackson

unread,
Jan 16, 2015, 11:25:44 AM1/16/15
to mongod...@googlegroups.com
Thank you for the configuration file, that was really useful. I think I have an idea about what's going on. Your config file appears to be using the 2.4 configuration format, with keys and values, and the configuration parameters for directoryperdb you've added are in the 2.6 format, which uses YAML.

Try this configuration line:
directoryperdb = true

Let me know how that works!

Spencer

--
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 a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/66aOnia7m8s/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/11a4be4c-4a2d-415f-813b-27e576527d81%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dan Finn

unread,
Jan 19, 2015, 5:53:55 AM1/19/15
to mongod...@googlegroups.com
It seems kind of odd but that actually gave a different error, one that is rather strange:

[root@icebox-backup ~]# /etc/init.d/mongod32 start
Starting mongod: about to fork child process, waiting until server is ready for connections.
forked process: 40206
ERROR: child process failed, exited with error number 100



On Thursday, January 15, 2015 at 5:19:11 PM UTC+2, Dan Finn wrote:

Asya Kamsky

unread,
Jan 19, 2015, 4:25:08 PM1/19/15
to mongodb-user
What's in the log file? (pointed to by logpath parameter from 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/f7a41af9-f745-40b3-bef0-38e3920f178b%40googlegroups.com.

Dan Finn

unread,
Jan 20, 2015, 2:53:24 AM1/20/15
to mongod...@googlegroups.com
Well, I guess I should have looked closer at the error.  It seems that the last method of setting this in the config is working.  The issue was that my file permissions were screwed up since I had started mongo manually and it had run as root.

Thanks,
Dan
Reply all
Reply to author
Forward
0 new messages