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

Changes from Parse #96

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

Conversation

maplebed
Copy link

small changes:

  • optionally use a config file instead of command line arguments to start mongo
  • optionally suppress server restarts on config change (sometimes you want to
    restart production servers more carefully)
  • if ganglia is installed, report metrics
  • make the replicaset prefix "rs_" customizable via attribute
  • add ubuntu as a platform and use upstart when on ubuntu

big changes:

  • new recipe to backup mongo using ec2-consistent-snapshot
  • new recipe to put the mongo db mountpoint on a set of raided EBS volumes
    ** when using raided EBS volumes, automatically start new instances
    using snapshots to make joining the cluster fast and easy

Ben Hartshorne added 2 commits March 20, 2013 11:53
small changes:
* optionally use a config file instead of command line arguments to start mongo
* optionally suppress server restarts on config change (sometimes you want to
  restart production servers more carefully)
* if ganglia is installed, report metrics
* make the replicaset prefix "rs_" customizable via attribute
* add ubuntu as a platform and use upstart when on ubuntu
big changes:
* new recipe to backup mongo using ec2-consistent-snapshot
* new recipe to put the mongo db mountpoint on a set of raided EBS volumes
** when using raided EBS volumes, automatically start new instances
   using snapshots to make joining the cluster fast and easy
# service
service name do
supports :status => true, :restart => true
action service_action
service_notifies.each do |service_notify|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

this is for Chef 11 and is backward compatible with Chef 10, you might want to keep it as is

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'll change that one back. It was a false addition based on an older version.

@gilles
Copy link

gilles commented Mar 26, 2013

I'm trying to pull some of these changes in my fork, here are the things I noticed so far:


When using upstart on ubuntu, the init file must be #{name}.conf and the mode should be 644 (mongdb.rb resource line 130) and the provider has to be Chef::Provider::Service::Upstart


In the templates/raid_snapshots.sh.erb: <%= node['backups']['mongo_volumes'].join(" ") %>

My understanding is that node['backups']['mongo_volumes'] are the snapshot ids (as used in definitions/mongodb.rb line 222). Shouldn't the snapshot command have the mounted EBS volume ids as input, not the snapshot ids?


Thanks

--Gilles

@maplebed
Copy link
Author

@gilles the node['backups']['mongo_volumes'] attribute has the volume IDs, not the snapshot IDs. You specify the volume IDs in the role (or wrapper cookbook recipe) once (when you mount them) and the snapshot IDs change every time a snapshot is taken (eg every 2hrs). The find_snapshots function (from libraries/ec2.rb) is what transforms the volume IDs into the most recent available snapshot IDs.

@gilles
Copy link

gilles commented Mar 27, 2013

Got it, thanks


if node[:mongodb][:use_config_file]
type == "mongos" ? daemon = "/usr/bin/mongos" : daemon = "/usr/bin/mongod"
template configfile do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use /etc/#{name}/ for the configfile or the mongos confilgfile will tramp mongodb configfile (also there is a need for a mongos config template). It will make it so the configfile matches the service name

@gilles gilles mentioned this pull request May 12, 2013
@jamesonjlee
Copy link

are these the changes mentioned at chef-conf?

@amilu
Copy link

amilu commented May 30, 2013

Gem package aws-sdk requires two prior libraries to be installed.

package "libxml2-dev" do
action :install
end.run_action(:install)

package "libxslt1-dev" do
action :install
end.run_action(:install)

@amilu
Copy link

amilu commented May 30, 2013

If should_restart_server is set to false, when do config_replicaset and config_sharding blocks get called ?
Stopping the service and then running chef client does not seem as the best solution ..

@amilu
Copy link

amilu commented Jun 3, 2013

Why is the raid level hardcoded to raid 0 ? I guess it should at least be a configuration parameter ..

@@ -21,6 +21,9 @@

# if we are configuring a shard as a replicaset we do nothing in this recipe
if !node.recipe?("mongodb::shard")
# these are used in the library for searches
node.set["mongodb_cluster_name"] = node['mongodb']['cluster_name']
node.set["mongodb_shard_name"] = node['mongodb']['shard_name']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see these being used anywhere.

@mkantor
Copy link

mkantor commented Oct 9, 2013

Looks like #26 (which was already merged) also adds config file support.

(I'm trying to manually merge this into master in my fork, so I'll probably leave a bunch of notes like this in hopes that they will help future mergers.)

@gilles
Copy link

gilles commented Oct 9, 2013

@mkantor you can take a look here: https://github.com/kwarter-cookbooks/mongodb

@mkantor
Copy link

mkantor commented Oct 9, 2013

@gilles Thanks for the pointer. Are you planning on sending pull requests to this repo with those changes?

@gilles
Copy link

gilles commented Oct 9, 2013

I think we did at some point but it was getting complicated with our own
changes. We closed it and commented on this PR instead, there's a couple if
issues with config template names and upstart for mongos

On Wed, Oct 9, 2013 at 11:43 AM, Matt Kantor [email protected]:

@gilles https://github.com/gilles Thanks for the pointer. Are you
planning on sending a pull request to this repo with those changes?


Reply to this email directly or view it on GitHubhttps://github.com//pull/96#issuecomment-25997071
.

@jamesonjlee
Copy link

looks like most of this was merged in via a PR here and there. The major stuff with ebs, backups, and scripts are worth adding to the cookbook, but probably not directly inside a recipe (probably into a proper docs/examples directory)

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

Successfully merging this pull request may close these issues.

5 participants