What exact search command are you using? I also assume that the other new nodes are called test02 and test03?
Our values: Privacy, Liberty, Justice
From: Douglas Garstang email@example.com
Sent: Sunday 14th June 2015 11:58
Subject: [chef] Re: Re: Re: RE: Chef Search for Node Discovery.
I created three new nodes with the “knife node create” command, like this, for each:
“name”: "test01.dev.slicetest.com http://test01.dev.slicetest.com ",
I’ve been doing a knife search repeatedly over the past 15 minutes, and all I get each time for the nodes is this:
Node Name: test01.dev.slicetest.com http://test01.dev.slicetest.com
Run List: role[zookeeper]
How long should I need to wait? The chef_environment is immediately populated. Why not the role? That comes from the run list and should be available immediately, just like the chef_environment. I need at least the environment and the role to be able to do a useful search.
It does not take an instance 15 minutes to boot. Therefore, by the time the client runs, the data won’t be available. Can I reduce the solr refresh frequency down to a useful value?
On Sun, Jun 14, 2015 at 11:48 AM, Daniel DeLeo <firstname.lastname@example.org mailto:email@example.com > wrote:
On Saturday, June 13, 2015 at 2:03 PM, Douglas Garstang wrote:
My boot process runs a script that calls a knife node add, to add the node to chef. Since it’s been added to chef, it should be discoverable. However, it’s not discoverable until the client has run at least once. That seems more like an architectural problem with chef, rather than a fundamental flaw in the universe.
As described elsewhere in the thread, the amount of time it takes for an object to hit the search index depends on your configuration and whether or not you’re on Chef Server 12 (which upgrades to Solr 4, which has a “soft commit” feature, reducing indexing time to 1s from default of 60s).
What you’re probably seeing is that chef-client sets some data about its last run into the “automatic” attributes section (where ohai data lives). If your search query queries on these values, you won’t see it until chef-client runs. If you search for things like run list items, node names, etc., you’ll see them when the node is created (after the next Solr commit).
As for whether it’s an architectural issue with chef, sort of. It’s definitely a problem that the node object in Chef represents both desired/aspirational state and last observed state. On the other hand, it’s important that you be able to search for nodes based on one or that other of these. For example, you probably don’t want to add an application server into the load balancer rotation or begin monitoring it as a production system before the application is running. In other cases you definitely do want to find all systems, even if they’re not fully configured yet.
Email: firstname.lastname@example.org mailto:email@example.com