- From: markus korn <
>
- To:
- Subject: [chef] Re: Re: New Community Cookbook: MongoDB
- Date: Fri, 16 Sep 2011 08:13:32 +0200
Hi Brad,
first of all, thanks for using the mongodb cookbook, and your feedback.
On Fri, Sep 16, 2011 at 2:30 AM, Brad Knowles
<
>
wrote:
[...]
>
In cookbooks/mongodb/definitions/mongodb.rb, starting at line 140, we have
>
this code:
>
>
# replicaset
>
if !replicaset_name.nil?
>
rs_nodes = search(
>
:node,
>
"mongodb_cluster_name:#{replicaset['mongodb']['cluster_name']} AND \
>
recipes:mongodb\\:\\:replicaset AND \
>
mongodb_shard_name:#{replicaset['mongodb']['shard_name']} AND \
>
chef_environment:#{replicaset.chef_environment}"
>
)
>
>
However, this search is returning null for us. We confirmed this by adding
>
the following logging statement:
>
>
Chef::Log.info("mongodb:rs_nodes:#{rs_nodes}")
>
There could be multible reasons for this search returning nil, can you
please check if
* node['mongodb']['cluster_name'] is defined and has the same value
for all the nodes in the replicaset (e.g you have one role which
defines this attribute in 'default_attributes' and this role is in
every nodes run_list)
* in every replicaset member there is either directly or indeirectly
the 'mongodb::replicaset' recipe in the run_list (maybe by also adding
this recipe to the role )
* If you are only using a replicaset (without sharding) you should
not really care about mongodb's shard_name attribute, it should be set
to '_default' on all mongodb related nodes
* and last but not least you could check if chef_envionment is set correctly
If I had to debug this further I would remove the the various AND
conditions from the search statement one-by-one and see if rs_nodes
has somemembers then. This way it is easy to find the
culprit.
>
The result is a chef-client run that looks like this:
[...]
>
I don't suppose you have any hints or comments? Thanks!
I hope I could help you with my hints, please come back if you need
some more help with the mongodb cookbook.
Markus
Archive powered by MHonArc 2.6.16.