Giter Site home page Giter Site logo

Comments (9)

zarry avatar zarry commented on July 23, 2024

@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.

from sc-mongodb.

zarry avatar zarry commented on July 23, 2024

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

from sc-mongodb.

james-ai avatar james-ai commented on July 23, 2024

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

from sc-mongodb.

zarry avatar zarry commented on July 23, 2024

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!

from sc-mongodb.

luishdez avatar luishdez commented on July 23, 2024

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

from sc-mongodb.

james-ai avatar james-ai commented on July 23, 2024

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

Thanks @zarry, @luishdez

from sc-mongodb.

chuangtim avatar chuangtim commented on July 23, 2024

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

from sc-mongodb.

zarry avatar zarry commented on July 23, 2024

@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.

from sc-mongodb.

lock avatar lock commented on July 23, 2024

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.

from sc-mongodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.