edelight / chef-mongodb

MongoDB Chef cookbook
https://community.opscode.com/cookbooks/mongodb
Apache License 2.0
362 stars 3 forks source link

mongos: Error parsing INI config file: unknown option <X> #289

Open vindimy opened 10 years ago

vindimy commented 10 years ago

We've ran into this issue when provisioning hosts with recipe[mongodb::mongos]:

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /sbin/service mongos start ----
STDOUT: Starting mongos: [FAILED]
STDERR: Error parsing INI config file: unknown option smallfiles
try '/usr/bin/mongos --help' for more information
---- End output of /sbin/service mongos start ----
Ran /sbin/service mongos start returned 1

mongos doesn't support nojournal, rest, and smallfiles options, but they're set as default attributes in the cookbook.

We've used a helper cookbook to work around the issue, but ultimately mongodb cookbook should have logic to avoid setting these attributes if recipe[mongodb::mongos] is used:

['nojournal', 'rest', 'smallfiles'].each do |attr|
  node.default['mongodb']['config'].delete(attr) rescue nil
end

include_recipe "mongodb::mongos"
jamesonjlee commented 10 years ago

you should set those to nil... or I guess we can just remove them all.

vindimy commented 10 years ago

I think the attributes should be removed in mongodb::mongos recipe, since sometimes they're set at environment or role level..

jspiewak commented 10 years ago

See what we did in #212 for dbpath. I guess the newer version of mongos is more strict about what it allows.

josephholsten commented 10 years ago

this seems especially relevant to #310

mdivk commented 7 years ago

I got this when I run mongos:

Error parsing INI config file: unrecognised option 'chunkSize'

if I comment out chunkSize in the mongos.conf, I got the following:

FailedToParse: mirrored config server connections are not supported; for config server replica sets be sure to use the replica set connection string

My mongos.conf is as below:

configdb=mongo1:20000,mongo2:20000,mongo3:20000
port=28885
#chunkSize=100
logpath=/usr/local/mongodb/logs/mongos1.log
logappend=true
fork=true

Thanks.