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

Is this production-ready? #38

Closed
james-ai opened this issue May 28, 2015 · 9 comments
Closed

Is this production-ready? #38

james-ai opened this issue May 28, 2015 · 9 comments

Comments

@james-ai
Copy link

Hi guys,

Found my way here from edelight/chef-mongodb#385 and was wondering if this cookbook would be taking over, and is ready to be used in anger? I intend to have it running on an Ubuntu 12 server.

Will it be added to the Chef Supermarket at some point too?

Thanks,
James.

@zarry
Copy link
Contributor

zarry commented May 28, 2015

@james-ai I currently use this cookbook in production, although it is wrapped in a wrapper cookbook for some additional configuration but it does do the job. The wrapper cookbook did require some tweaks to the install paths to get it working properly, I can pass along those changes should you get up and running before we get some of those fixes merged here.

@zarry
Copy link
Contributor

zarry commented May 28, 2015

Didn't see your last snippet, it will be added to supermarket we are discussing how to do that in the meta repo.

@james-ai
Copy link
Author

@zarry That would be great thanks. Any work that I can help with?

@zarry
Copy link
Contributor

zarry commented May 28, 2015

Here is the snippet of code from the wrapper cookbook that configures the path names properly among some other things that may or may not be necessary for you. The major issue I had was path issues between what the package installed and what the cookbook was defaulted to. This created all sorts of odd issues from not managing the service properly to empty mongo directories vs the populated mongodb directories.

I think we have PR that looks to correct some of this stuff if not I will get a ticket in and start looking at a PR.

############
## Config ##
############

node.default['mongodb']['install_method'] = 'mongodb-org'
node.default['mongodb']['config']['bind_ip'] = '0.0.0.0'
node.default['mongodb']['config']['oplogSize'] = '20480'
node.default['mongodb']['config']['rest'] = false
node.default['mongodb']['package_version'] = '2.6.7'

## Configure Paths and names correctly
node.default['mongodb']['cluster_name'] = node['chub_mongodb']['cluster_name']
node.default['mongodb']['config']['replSet'] = node['chub_mongodb']['config']['replSet']
node.default['mongodb']['auto_configure']['replicaset'] = node['chub_mongodb']['auto_configure']['replicaset']

node.default['mongodb']['dbconfig_file'] = '/etc/mongod.conf'
node.default['mongodb']['sysconfig']['DAEMON_OPTS'] = "--config #{node['mongodb']['dbconfig_file']} --httpinterface"
node.default['mongodb']['sysconfig']['CONFIGFILE'] = '/etc/mongod.conf'
node.default['mongodb']['config']['logpath'] = '/var/log/mongodb/mongod.log'
node.default['mongodb']['config']['dbpath'] = '/var/lib/mongodb'
node.default['mongodb']['sysconfig_file'] = '/etc/default/mongod'
node.default['mongodb']['default_init_name'] = 'mongod'
node.default['mongodb']['instance_name'] = 'mongod'

logrotate_app 'mongod' do
  path '/var/log/mongodb/mongod.log'
  options %w(missingok copytruncate notifempty compress)
  frequency 'daily'
  rotate 30
  create '644 mongodb nogroup'
end

##################
## Deploy Mongo ##
##################

if node['chub_mongodb']['test_run']
  include_recipe 'mongodb::mongodb_org_repo'
  include_recipe 'mongodb::default'
else
  include_recipe 'mongodb::mongodb_org_repo'
  include_recipe 'mongodb::replicaset'
end

As for helping out feel free to help out wherever you see fit. If you want to start working with it and submit us some PRs as you hit things great! If you want to comb through some of the PRs out there and do some review/comment thoughts, Great! We picked this cookbook up because of the lack of updates on the previous one so any help is welcome help!

@luishdez
Copy link
Contributor

I can tell that this has been used in prod a lot, at least in my company for +300 instances in EC2 and in ovh for a lot of servers. Just test your requirements before go on prod, waiting for this to go on supermarket sous-chefs/meta#3

@james-ai
Copy link
Author

Top stuff. I can just spin up a test box and give it a whirl on that.

Thanks @zarry, @luishdez

@chuangtim
Copy link

@luishdez
@zarry
any guide for production, for exmple, how to configure replicaset with json?

@zarry
Copy link
Contributor

zarry commented May 10, 2016

@chuangtim I do not have example of configuring replicaset with json, but the example I provided above does setup and manage a replicaset in our production environment. I don't believe there to be a specific guide.

@lock
Copy link

lock bot commented Jul 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants