【发布时间】:2016-12-13 19:44:00
【问题描述】:
我有 3 个组件:节点、服务器和工作站。我没有设置这些。我可以从工作站运行刀状态并返回当前结果(我相信这确认了从工作站到服务器的连接)。我可以从节点本身成功运行 chef-client(我相信这证实了从节点到服务器的连接 + 显然它已经被引导)。
但尝试再次引导失败。我发现奇怪的一件事是,我注意到工作站上的 /etc/chef/client.rb 文件将其 node_name 行替换为我尝试引导的节点的名称。也许这很正常?
我无法解决的一件事是,这个错误使它看起来像 /someone/ 无法连接到厨师服务器;但是,如上所述,我确认工作站和节点都可以验证并连接到厨师服务器。
我一直在查看文档,但一个大问题是含糊不清。它会说“有些东西位于 /etc/chef/client.rb” - 好的,但是在节点、服务器或工作站上?他们都有这个文件!!
我认为这可能是我的密钥,它在工作站上的 ~/.chef/knife.rb 中由“client_key”行指示 - 但我不想更改它,以免我失去与服务器的连接.但似乎很明显某处存在身份验证故障 - 除了在引导期间,我无法在任何地方找到它。
[root@workstation chef]# cat client.rb
log_location STDOUT
chef_server_url "https://chefserver/organizations/domain"
validation_client_name "domain-validator"
node_name "workstation"
ssl_verify_mode :verify_none
trusted_certs_dir "/etc/chef/trusted_certs"
[root@workstation chef]# knife bootstrap node.domain.goes.here -N node -x user -i /home/user/.ssh/id_rsa --sudo --use-sudo-password --node-ssl-verify-mode none -r recipe[chef-client]
Doing old-style registration with the validation key at ~/.keys/domain-validator.pem...
Delete your validation key in order to use your user credentials instead
Connecting to node.domain.goes.here
node.domain.goes.here -----> Existing Chef installation detected
node.domain.goes.here Starting the first Chef Client run...
node.domain.goes.here Starting Chef Client, version 12.10.24
node.domain.goes.here
node.domain.goes.here ================================================================================
node.domain.goes.here Chef encountered an error attempting to load the node data for "node"
node.domain.goes.here ================================================================================
node.domain.goes.here
node.domain.goes.here Authentication Error:
node.domain.goes.here ---------------------
node.domain.goes.here Failed to authenticate to the chef server (http 401).
node.domain.goes.here
node.domain.goes.here Server Response:
node.domain.goes.here ----------------
node.domain.goes.here Invalid signature for user or client 'node'
node.domain.goes.here
node.domain.goes.here Relevant Config Settings:
node.domain.goes.here -------------------------
node.domain.goes.here chef_server_url "https://chefserver/organizations/domain"
node.domain.goes.here node_name "node"
node.domain.goes.here client_key "/etc/chef/client.pem"
node.domain.goes.here
node.domain.goes.here If these settings are correct, your client_key may be invalid, or
node.domain.goes.here you may have a chef user with the same client name as this node.
node.domain.goes.here
node.domain.goes.here Platform:
node.domain.goes.here ---------
node.domain.goes.here x86_64-linux
node.domain.goes.here
node.domain.goes.here
node.domain.goes.here Running handlers:
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: Running exception handlers
node.domain.goes.here Running handlers complete
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: Exception handlers complete
node.domain.goes.here Chef Client failed. 0 resources updated in 01 seconds
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: 401 "Unauthorized"
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[root@workstation chef]# cat client.rb
log_location STDOUT
chef_server_url "https:/chef/organizations/domain"
validation_client_name "domain-validator"
node_name "node"
ssl_verify_mode :verify_none
trusted_certs_dir "/etc/chef/trusted_certs"
【问题讨论】:
标签: chef-infra knife