sous-chefs / sc-mongodb

Development repository for the sc-mongodb cookbook
https://supermarket.chef.io/cookbooks/sc-mongodb
Apache License 2.0
75 stars 91 forks source link

Is this production-ready? #38

Closed james-ai closed 9 years ago

james-ai commented 9 years ago

Hi guys,

Found my way here from https://github.com/edelight/chef-mongodb/issues/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 commented 9 years ago

@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 commented 9 years ago

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 commented 9 years ago

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

zarry commented 9 years ago

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 commented 9 years ago

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 https://github.com/chef-brigade/meta/issues/3

james-ai commented 9 years ago

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

Thanks @zarry, @luishdez

chuangtim commented 8 years ago

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

zarry commented 8 years ago

@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[bot] commented 6 years ago

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.