[chef] Re: search returns for nodes sometimes reduced or empty


Chronological Thread 
  • From: Ian Marlier < >
  • To:
  • Cc:
  • Subject: [chef] Re: search returns for nodes sometimes reduced or empty
  • Date: Wed, 6 Jun 2012 09:45:45 -0400

Are you using Hosted Chef, or a local installation?  Which version?

If you're running your own Chef installation, try editing /var/lib/chef/solr/conf/solrconfig.xml and changing _both_ maxFieldLength parameters from 10000 to something much larger (100000 or even higher).  Then restart chef-solr, and do `knife index rebuild`.  That worked for me, when I was seeing similar behavior (see chef mailing list thread from ~1 week back).

On Wed, Jun 6, 2012 at 7:34 AM, Dan Adams < " target="_blank"> > wrote:

Hi

I use search quite heavily in my Chef recipes, mainly to return a list of nodes based on a provided environment and role. I then assign attributes to the results of these searches, which are then references in configuration files on other nodes. An example might be, a web host might need to know which app hosts it can pass work off to, and the app hosts might be an occasionally shifting number. So, great, dynamic assignment of values in the config based on search.

However, I have hit two areas where the search really isn't working for us as intended/expected. And I don't know if this is my fauly expectations, my faulty implementation , or something wrong in Chef.

1) Scenario 1 - Nodes vanish from search when I update chef via knife.
I make updates to files in the git repo and then import them to chef couch/solr using:
"knife cookbook upload", "knife environment from file", "knife node from file, "knife role from file"
It appears as though running at least some of these commands *re-creates* the nodes as new objects with no roles (rather than updates the existing objects) so that the nodes have no roles until the chef-client is successfully run on the client host.

2) Scenario 2 - Nodes vanish from search results intermittently.
It appears as though intermittently search will not return a node in the search results for a role that I know it has. I can manually re-populate the roles by running the chef-client executable on the host in question.

Both these together mean that at times, a node will not be returned as the result of a search, meaning the config value used elsewhere is null, which can cause massive problems for our environments.

Can someone advise if I am doing something wrong in my use of search, if the above can be explained by any known bugs, or how I can resolve these issues please. I am unclear on what determines whether a host has a role - in my mind it should be whether a host has a role assigned in the config, but sometimes nodes are not returned in the search when they *are* assigned in the config, and appear in search only after a successul client run is performed manually.

Cheers

Dan



--
Ian Marlier | Senior Systems Engineer
Brightcove, Inc.
290 Congress Street, 4th Floor, Boston, MA 02110
" target="_blank">




Archive powered by MHonArc 2.6.16.

§