Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the log path, config path, data path to the default 10 gen repo #262

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rakusai
Copy link

@rakusai rakusai commented Mar 18, 2014

When we chef solo this cookbook, we will get duplicated mongo log, config file, and data dir and it's quite frustrating.
I am not sure why you will use different paths for these.
So I changed:

Config
/etc/mongodb.conf -> /etc/mongod.conf
Log
/var/log/mongodb/mongodb.log -> /var/log/mongo/mongod.log
Data
/var/lib/mongodb -> /var/lib/mongo

Also, with latest mongo (2.9.x), we will see warnings when we start the mongo:

Starting mongod: 
warning: remove or comment out this line by starting it with '#', skipping now : nojournal = false
warning: remove or comment out this line by starting it with '#', skipping now : rest = false
warning: remove or comment out this line by starting it with '#', skipping now : smallfiles = false
warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by default

So I set the default value of nojournal, rest, smallfiles, and bind_ip to nil.

@jamesonjlee
Copy link

if you don't want the values to be set, you can set them to be 'nil' in the attributes. The default values are set for a minor level of backwards compatibility (and due to demo by 10gen).

I am curious as to why your config/log/data are duplicated, what is your platform and run-list?

@rakusai
Copy link
Author

rakusai commented Mar 19, 2014

@jamesonjlee Thanks for the reply.

if you don't want the values to be set, you can set them to be 'nil' in the attributes.

I know. I just wanted to point out that if we try this cookbook with default option on amazon linux, we got duplicated config files, and warnings. You can close my pull req if is not necessary.

platform is amazon linux
run list:

{"run_list":[
  "yum",
  "yum-epel",
  "yum-remi",
  "build-essential",
  "common-packages",
  "ntp",
  "snmp",
  "sudo",
  "hosts",
  "timezone",
  "mongodb::10gen_repo",
  "mongodb"
  ],

@jamesonjlee
Copy link

I'll give the duplicate directory issue on Amazon Linux (this shouldn't be happening since this would be in rhel family).

@josephholsten
Copy link

I guess you're saying that the package installation creates the following files:

  • /etc/mongod.conf
  • /var/log/mongo/mongod.log
  • /var/lib/mongo/

Which are different than the default paths in this cookbook.

I'd personally rather have the defaults match the newest package from mongodb than historical defaults. But as this would be backwards incompatible, and I seriously don't want to write migration code, this should wait for the next major (breaking) release. I've created a tracking ticket for these in #308.

@josephholsten
Copy link

For those who need a work around, these are the relevant updated attributes:

default['mongodb']['dbconfig_file'] = '/etc/mongod.conf'
default['mongodb']['config']['logpath'] = '/var/log/mongo/mongod.log'
default['mongodb']['config']['dbpath'] = '/var/lib/mongo'
default['mongodb']['sysconfig_file'] = '/etc/default/mongod'
default['mongodb']['default_init_name'] = 'mongod'
default['mongodb']['instance_name'] = 'mongod'

@josephholsten
Copy link

Well I'm enjoying my coworkers fighting with this. Do we know which packages use which set of paths? This is a terrible user experience, especially after a restart.

@jamesonjlee
Copy link

I know the ones for ubuntu (and probably debian). I guess we could just have kitchen find out for rhel, debian, source(?).

@brodock
Copy link

brodock commented Dec 4, 2014

👍

@jeffmacdonald
Copy link

At late as 16.2 at least this still happens, and its especially a pain in the rear because on the first install, the upstart script that comes with the package is run, so the one from the template can't start. You need to manually stop / start the old / new upstart services to make it recognize the changes and run with the right config files.

@zarry
Copy link

zarry commented Mar 13, 2015

I am running into this now as well. Frustrating to say the least. Any idea how far this PR is off from fixing some of this stuff or if it ever has any plans to be merged? Been open for a long while now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants