amazon ec2 - Knife ec2: need to avoid re-boostraping of server after hostname change -


i might doing wrong, here situation. standalone chef server 12.3.0. centos 6.3 running on aws. during execution of knife bootstrap applying hostname:default recipe change server's fqdn along other recipes. iseems fine. chef server shows newly boostrapped instance, node name column still showing old fqdn, smth ip-x-x-x-x.aws-region-name.compute.internal.

then try ssh host , run chef-client getting following error:

[ec2-user@newhostname ~]$ sudo chef-client   starting chef client, version 12.3.0  chef encountered error attempting load node data "newhostname" authentication error: ---------------- failed authenticate chef server (http 401).  server response: ---------------- failed authenticate 'newhostname'. ensure node_name , client key correct.  relevant config settings: ------------------------- chef_server_url   "https://chefserverdomain/organizations/organizationname" node_name         "newhostname" client_key        "/etc/chef/client.pem"  if these settings correct, client_key may invalid, or may have chef user same client name node.  [2015-05-04t12:36:03-07:00] fatal: stacktrace dumped /var/chef/cache/chef-stacktrace.out chef client failed. 0 resources updated in 0.962848623 seconds [2015-05-04t12:36:03-07:00] error: 401 "unauthorized" [2015-05-04t12:36:03-07:00] fatal: chef::exceptions::childconvergeerror: chef run process exited unsuccessfully (exit code 1) 

i have checked closed issue #8 on github, according need manually change client.rb file , include node_name parameter. @ same time chef client.rb documentation indicates should not :

node_name used determine configuration should applied , set client_name (which name used when authenticating chef server). default value set automatically fqdn of chef-client, detected ohai. in general, leaving setting blank , letting ohai assign fqdn of node node_name during each chef-client run recommended approach.

after cleaning /etc/chef/* folder, removing instance chef server , re-bootstrapping ec2 instance again able make work. fqdn displayed correctly in chef server under node name column newservername.

could please advise, should avoid double bootsrapping?

pass node name want node use "-n hostname" bootstrap command. register final node name.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -