-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
Conversation
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| |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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 |
@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. |
Got it, thanks |
|
||
if node[:mongodb][:use_config_file] | ||
type == "mongos" ? daemon = "/usr/bin/mongos" : daemon = "/usr/bin/mongod" | ||
template configfile do |
There was a problem hiding this comment.
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
are these the changes mentioned at chef-conf? |
Gem package aws-sdk requires two prior libraries to be installed. package "libxml2-dev" do package "libxslt1-dev" do |
If should_restart_server is set to false, when do config_replicaset and config_sharding blocks get called ? |
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'] |
There was a problem hiding this comment.
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.
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.) |
@mkantor you can take a look here: https://github.com/kwarter-cookbooks/mongodb |
@gilles Thanks for the pointer. Are you planning on sending pull requests to this repo with those changes? |
I think we did at some point but it was getting complicated with our own On Wed, Oct 9, 2013 at 11:43 AM, Matt Kantor [email protected]:
|
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) |
small changes:
restart production servers more carefully)
big changes:
** when using raided EBS volumes, automatically start new instances
using snapshots to make joining the cluster fast and easy