Skip to content

Commit

Permalink
Mixed mongodb cookbook if sharding without replication is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Korn committed Nov 9, 2011
1 parent a71a640 commit b3f72bd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mongodb/definitions/mongodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@

replicaset = params[:replicaset]
if type == "shard"
# for replicated shards we autogenerate the replicaset name for each shard
replicaset_name = "rs_#{replicaset['mongodb']['shard_name']}"
if replicaset.nil?
replicaset_name = nil
else
# for replicated shards we autogenerate the replicaset name for each shard
replicaset_name = "rs_#{replicaset['mongodb']['shard_name']}"
end
else
# if there is a predefined replicaset name we use it,
# otherwise we try to generate one using 'rs_$SHARD_NAME'
Expand Down Expand Up @@ -141,7 +145,7 @@
notifies :create, "ruby_block[config_replicaset]"
end
if type == "mongos"
notifies :create, "ruby_block[config_sharding]"
notifies :create, "ruby_block[config_sharding]", :immediately
end
if name == "mongodb"
# we don't care about a running mongodb service in these cases, all we need is stopping it
Expand Down

0 comments on commit b3f72bd

Please sign in to comment.