[chef] Re: Re: Re: Add Client to Chef Server Immediately?


Chronological Thread 
  • From: Douglas Garstang < >
  • To:
  • Subject: [chef] Re: Re: Re: Add Client to Chef Server Immediately?
  • Date: Tue, 12 Aug 2014 15:38:23 -0700

Daniel,

Caveats aside, where would the node.save go? Would it go in the recipe somewhere very early in the run list? I think the hack I saw had this run on the client side with chef-client.

Doug.



On Tue, Aug 12, 2014 at 2:48 PM, Daniel DeLeo < " target="_blank"> > wrote:


On Tuesday, August 12, 2014 at 2:40 PM, Douglas Garstang wrote:

> Lamont,
>
> Tried that. Waited a couple of minutes, and the nothing returned by my knife search. Run chef-client, and the knife search command does return data for the node.
>
> I think there was more options after the -z.
>
> Doug.
Either you’re misremembering or there was a lot more to it. The `-z` option just runs chef in “local mode” where it starts a Chef Zero server bound to localhost and saves data to disk. The `-z` option takes optional arguments to run specific recipes without changing the run_list so you have something along the lines of `chef-apply` but with server features available.

You can use `node.save` to force Chef to save the node object at any time, but beware that any attributes you set after calling `node.save` won’t appear in the data, which can cause search to intermittently not find nodes. Also, depending on which flavor of Chef Server you use and how it’s tuned, there is some latency to when things get indexed. Eventually everything will get upgraded to Solr 4 which has in-memory commit for much lower latency, but I’m not sure what the release timeline is. I think Hosted Enterprise Chef is using Solr 4 now, not sure about the others.

--
Daniel DeLeo




--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: ">
Cell: +1-805-340-5627



Archive powered by MHonArc 2.6.16.

§