Chef infra Chef在尝试创建客户端时遇到错误

Chef infra Chef在尝试创建客户端时遇到错误,chef-infra,Chef Infra,描述 Chef在尝试创建客户端“rh36”时遇到错误 切夫德克版本 厨师长开发工具包版本:2.4.17 厨师长客户端版本:13.6.4 交付版本:master(73ebb72a6c42b3d2ff5370c476be800fee7e5427) 伯克斯版本:6.3.1 厨房版本:1.19.2 inspec版本:1.45.13 平台版本 世纪7 Linux rh36 3.10.0-693.el7.x86_64#1 SMP周二8月22日21:09:27 UTC 2017 x86_64 x86_64 x

描述 Chef在尝试创建客户端“rh36”时遇到错误

切夫德克版本 厨师长开发工具包版本:2.4.17 厨师长客户端版本:13.6.4 交付版本:master(73ebb72a6c42b3d2ff5370c476be800fee7e5427) 伯克斯版本:6.3.1 厨房版本:1.19.2 inspec版本:1.45.13

平台版本 世纪7 Linux rh36 3.10.0-693.el7.x86_64#1 SMP周二8月22日21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

复制案例 刀子引导rh36——ssh用户lijun——sudo——身份文件~/.ssh/id\u rsa——节点名rh36——运行列表“菜谱[learn\u chef\u httpd]”

#自举输出
lijun@rh66:~/learn-chef/.chef$ knife bootstrap rh36 --ssh-user lijun --sudo --identity-file ~/.ssh/id_rsa --node-name rh36 --run-list ‘recipe[learn_chef_httpd]’
Doing old-style registration with the validation key at /home/lijun/learn-chef/.chef/learnchef-validator.pem…
Delete your validation key in order to use your user credentials instead

Connecting to rh36
rh36 knife sudo password:
Enter your password:
rh36
rh36 -----> Installing Chef Omnibus (-v 13)
rh36 downloading https://omnitruck-direct.chef.io/chef/install.sh
rh36 to file /tmp/install.sh.1643/install.sh
rh36 trying wget…
rh36 el 7 x86_64
rh36 Getting information for chef stable 13 for el…
rh36 downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=13&p=el&pv=7&m=x86_64
rh36 to file /tmp/install.sh.1648/metadata.txt
rh36 trying wget…
rh36 sha1   f69e475eb3bcdeefe761462f05cbf7c7281270ae
rh36 sha256 39227d13e5ca2ae023627ad63c56a073b7fecf1a68030915b11ce55e9692c214
rh36 url    https://packages.chef.io/files/stable/chef/13.8.5/el/7/chef-13.8.5-1.el7.x86_64.rpm
rh36 version    13.8.5
rh36 downloaded metadata file looks valid…
rh36 downloading https://packages.chef.io/files/stable/chef/13.8.5/el/7/chef-13.8.5-1.el7.x86_64.rpm
rh36 to file /tmp/install.sh.1648/chef-13.8.5-1.el7.x86_64.rpm
rh36 trying wget…
rh36 Comparing checksum with sha256sum…
rh36 Installing chef 13
rh36 installing with rpm…
rh36 warning: /tmp/install.sh.1648/chef-13.8.5-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
rh36 Preparing… ################################# [100%]
rh36 Updating / installing…
rh36 1:chef-13.8.5-1.el7 ################################# [100%]
rh36 Thank you for installing Chef!
rh36 Starting the first Chef Client run…
rh36 Starting Chef Client, version 13.8.5
rh36 Creating a new client identity for rh36 using the validator key.
rh36
rh36 ================================================================================
rh36 Chef encountered an error attempting to create the client “rh36”
rh36 ================================================================================
rh36
rh36 Authentication Error:
rh36 ---------------------
rh36 Failed to authenticate to the chef server (http 401).
rh36
rh36 Server Response:
rh36 ----------------
rh36 Failed to authenticate as ‘learnchef’. Ensure that your node_name and client key are correct.
rh36
rh36 Relevant Config Settings:
rh36 -------------------------
rh36 chef_server_url “https://rh56/organizations/learnchef”
rh36 validation_client_name “learnchef”
rh36 validation_key “/etc/chef/validation.pem”
rh36
rh36 If these settings are correct, your validation_key may be invalid.
rh36
rh36 System Info:
rh36 ------------
rh36 chef_version=13.8.5
rh36 ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
rh36 program_name=chef-client worker: ppid=1643;start=22:36:29;
rh36 executable=/opt/chef/bin/chef-client
rh36
rh36
rh36 Running handlers:
rh36 [2018-04-12T22:36:31-04:00] ERROR: Running exception handlers
rh36 Running handlers complete
rh36 [2018-04-12T22:36:31-04:00] ERROR: Exception handlers complete
rh36 Chef Client failed. 0 resources updated in 01 seconds
rh36 [2018-04-12T22:36:31-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
rh36 [2018-04-12T22:36:31-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
rh36 [2018-04-12T22:36:31-04:00] ERROR: 401 “Unauthorized”
rh36 [2018-04-12T22:36:31-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
环境:

主机名:rh56 角色:厨师长服务器

主机名:rh66 角色:厨师工作站

主机名:rh36 角色:Linux服务器(CentOS 7)

rh66上的Knife.rb: lijun@rh66:~/learn chef/.chef$猫刀.rb

current_dir = File.dirname(__FILE__)
log_level                 :info
log_location              STDOUT
node_name                 "lijun"
client_key                "#{current_dir}/lijun.pem"
validation_client_name   'learnchef'
validation_key           "#{current_dir}/learnchef-validator.pem"
chef_server_url           "https://rh56/organizations/learnchef"
cache_type               'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path             ["#{current_dir}/../cookbooks"]
lijun@rh66:~/learn chef/.chef$刀ssl检查

正在连接到主机rh56:443

已成功验证来自“rh56”的证书

lijun@rh66:~/learn chef/.chef$刀客户列表

学习验证程序

lijun@rh66:~/learn chef/.chef$刀子引导rh36——ssh用户lijun——sudo-P hotmail_1——标识文件~/.ssh/id_rsa——节点名rh36——运行列表“recipe[learn_chef_httpd]”

此命令已成功下载并安装Chef,但在使用验证密钥为rh36创建新的客户端标识时出现身份验证错误


请分享解决此问题的任何想法。谢谢。

您将验证客户端名称设置为
learnchef
,这将是非常不寻常的。通常是
$orgname validator
$orgname validation
,具体取决于Chef Server的版本。如果您有
knife
在本地工作,您可以使用
knife客户端列表

learnchef validator在执行“knife客户端列表”时返回,那么这就是要使用的东西:)