我正在尝试使用小刀引导命令从Chef工作站添加一个Chef客户端节点,但是得到的错误消息为'''ERROR:Train::Transports::SSHFailed:无法建立SSH session '''
我在厨师客户端上禁用了iptables
[root@chefclient ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled)
Active: inactive (dead)
Jul 29 16:21:18 chefclient.jp.com systemd[1]: [/usr/lib/systemd/system/iptables.service:5] Unknown lvalue 'AssertPathExists' in... 'Unit'
Hint: Some lines were ellipsized, use -l to show in full
'''knife bootstrap 192.168.56.6 -N chefclient.jp.com -U root --sudo -i /root/Downloads/chefsetup.pem'''
Getting result as:
Connecting to 192.168.56.6
WARN: [SSH] PTY requested: stderr will be merged into stdout
The authenticity of host '192.168.56.6 ()' can't be established.
fingerprint is SHA256:8x0e7QPub3Zj/2GFz5XSFZCABEbez6uVV/eR1MvYoIE.
Are you sure you want to continue connecting
? (Y/N) Y
WARN: [SSH] PTY requested: stderr will be merged into stdout
WARN: [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user [email protected]>)
ERROR: Train::Transports::SSHFailed: SSH session could not be established
最佳答案
从Chef服务器webui下载knife.rb文件,oraganization-validator.pem并保存在Chefstation的.chef目录中,并运行如下所示的boots bootstrap命令后,此问题已修复。
'''刀引导192.168.56.6 -N Chefclient.jp.com -U根'''
输出:
Connecting to 192.168.56.6
WARN: [SSH] PTY requested: stderr will be merged into stdout
The authenticity of host '192.168.56.6 ()' can't be established.
fingerprint is SHA256:8x0e7QPub3Zj/2GFz5XSFZCABEbez6uVV/eR1MvYoIE.
Are you sure you want to continue connecting
? (Y/N) Y
WARN: [SSH] PTY requested: stderr will be merged into stdout
Performing legacy client registration with the validation key at /root/chef-repo/.chef/short_name-validator.pem...
Delete your validation key in order to use your user credentials for client registration instead.
Bootstrapping 192.168.56.6
[192.168.56.6] -----> Installing Chef Omnibus (stable/15)
downloading https://omnitruck.chef.io/chef/install.sh
......................................................
......................................................
[192.168.56.6] Thank you for installing Chef Infra Client! For help getting started visit https://learn.chef.io
[192.168.56.6] Starting the first Chef Infra Client Client run...
[192.168.56.6] Starting Chef Infra Client, version 15.1.36
[192.168.56.6] Creating a new client identity for chefclient.jp.com using the validator key.
[192.168.56.6] resolving cookbooks for run list: []
[192.168.56.6] Synchronizing Cookbooks:
[192.168.56.6] Installing Cookbook Gems:
Compiling Cookbooks...
[2019-07-30T13:12:01+05:30] WARN: Node chefclient.jp.com has an empty run list.
[192.168.56.6] Converging 0 resources