Reputation: 87
I recently started studying chef and trying out with 3 nodes. I managed to set up my workstation on ubuntu (was not obvious) and bootstrapped 2 nodes for now. But below on this image their IP address is set to 127.0.0.1.
I boostrapped them using this following method:
$knife bootstrap xxxx.xxxx.com -x root -P xxxxxxxx -N xxxxxxxx
It seems fine, it appears on chef server but when I do the following to force run the chef-client on it, it throws some errors as displayed below.
$ knife ssh "name:logsmanager" "chef-client" -x root -a xxxx.xxxx.com
FATAL: 1 node found, but does not have the required attribute to establish the connection. Try setting another attribute to open the connection using --attribute.
Besides , I understand that the client nodes check in every 30 minutes by default but on my chef server nodes tab, it shows last checked in 6 days ago and 13 hours ago.
Does that mean the client nodes don't check the chef server or it's like source versioning checkin, checkout terminology?
I would be grateful if anybody can she some lights on this for me. Thank you
EDIT:
After running the command above, I run into another issue:
$ knife ssh "name:logsmanager" "chef-client" -x root -a fqdn
WARNING: Failed to connect to my.domain.com -- Net::SSH::AuthenticationFailed: Authentication failed for user [email protected]@my.domain.com .Seems to understant [email protected] as username for my.domain.com fqdn.
Upvotes: 1
Views: 1199
Reputation: 11242
By default chef client is not checking changes on Chef server. It's done manually.
To make node run chef-client periodically check this option:
-i SECONDS, --interval SECONDS
The frequency (in seconds) at which the chef-client runs. When the chef-client is run at intervals, --splay and --interval values are applied before the chef-client run. Default value: 1800.
More info about other options for chef-client you can find here.
About providing attribute, you must provide which attribute you want to use for SSH, not actual value. That means that:
$ knife ssh "role:web" "uptime" -x ubuntu -a public_hostname
public_hostname - represents node attribute called public_hostname
Upvotes: 1
Reputation: 54249
The -a
argument to knife ssh
should be a node attribute in the "dotted path" syntax so things like fqdn
or cloud.public_ipv4
. By default knife ssh
will use the node's FQDN to connect to.
Knife will run the search quer you provide and then use the given attribute to look up which name to pass to Net::SSH
.
Upvotes: 1