厨师 bootstrap 未能与厨师经理交谈

Chef bootstrap failing to talk to chef manager

我正在试用 Chef,我正在尝试从工作站 bootstrap 一个节点,似乎该节点 bootstrapped 很好,它显示在 Chef 服务器节点中,但是如果你看下面的日志,似乎工作站似乎无法与 Chef Manager 通信,我也可以从工作站访问 Chef Manager。

[2016-10-18T15:43:42-07:00] ERROR: Error connecting to https://cent7/organizations/farazk/nodes/unode, retry 5/5

这里是 knife 的完整输出

   test1@ubuntudesk:~/chef-repo$ knife bootstrap 192.168.131.111 -x test1 -P BatmanRobin -N unode --sudo
    Node unode exists, overwrite it? (Y/N) Y
    Client unode exists, overwrite it? (Y/N) Y
    Creating new client for unode
    Creating new node for unode
    Connecting to 192.168.131.111
    192.168.131.111 knife sudo password: 
    Enter your password: 
    192.168.131.111 
    192.168.131.111 -----> Installing Chef Omnibus (-v 12)
    192.168.131.111 downloading https://omnitruck-direct.chef.io/chef/install.sh
    192.168.131.111   to file /tmp/install.sh.6624/install.sh
    192.168.131.111 trying wget...
    192.168.131.111 ubuntu 16.04 x86_64
    192.168.131.111 Getting information for chef stable 12 for ubuntu...
    192.168.131.111 downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=12&p=ubuntu&pv=16.04&m=x86_64
    192.168.131.111   to file /tmp/install.sh.6628/metadata.txt
    192.168.131.111 trying wget...
    192.168.131.111 sha1    a2de7d933734d3a0c4b859576d0be472c5cd55f7
    192.168.131.111 sha256  7073541beb4294c994d4035a49afcf06ab45b3b3933b98a65b8059b7591df6b8
    192.168.131.111 url https://packages.chef.io/files/stable/chef/12.15.19/ubuntu/16.04/chef_12.15.19-1_amd64.deb
    192.168.131.111 version 12.15.19
    192.168.131.111 downloaded metadata file looks valid...
    192.168.131.111 downloading https://packages.chef.io/files/stable/chef/12.15.19/ubuntu/16.04/chef_12.15.19-1_amd64.deb
    192.168.131.111   to file /tmp/install.sh.6628/chef_12.15.19-1_amd64.deb
    192.168.131.111 trying wget...
    192.168.131.111 Comparing checksum with sha256sum...
    192.168.131.111 Installing chef 12
    192.168.131.111 installing with dpkg...
    192.168.131.111 Selecting previously unselected package chef.
    (Reading database ... 175392 files and directories currently installed.)
    192.168.131.111 Preparing to unpack .../chef_12.15.19-1_amd64.deb ...
    192.168.131.111 Unpacking chef (12.15.19-1) ...
    192.168.131.111 Setting up chef (12.15.19-1) ...
    192.168.131.111 Thank you for installing Chef!
    192.168.131.111 Starting the first Chef Client run...
    192.168.131.111 Starting Chef Client, version 12.15.19
    192.168.131.111 [2016-10-18T15:43:22-07:00] ERROR: Error connecting to https://cent7/organizations/test1k/nodes/unode, retry 1/5
    192.168.131.111 [2016-10-18T15:43:27-07:00] ERROR: Error connecting to https://cent7/organizations/test1k/nodes/unode, retry 2/5
    192.168.131.111 [2016-10-18T15:43:32-07:00] ERROR: Error connecting to https://cent7/organizations/test1k/nodes/unode, retry 3/5
    192.168.131.111 [2016-10-18T15:43:37-07:00] ERROR: Error connecting to https://cent7/organizations/test1k/nodes/unode, retry 4/5
    192.168.131.111 [2016-10-18T15:43:42-07:00] ERROR: Error connecting to https://cent7/organizations/test1k/nodes/unode, retry 5/5
    192.168.131.111 
    192.168.131.111 ================================================================================
    192.168.131.111 Chef encountered an error attempting to load the node data for "unode"
    192.168.131.111 ================================================================================
    192.168.131.111 
    192.168.131.111 Networking Error:
    192.168.131.111 -----------------
    192.168.131.111 Error connecting to https://cent7/organizations/test1k/nodes/unode - Failed to open TCP connection to cent7:443 (getaddrinfo: Name or service not known)
    192.168.131.111 
    192.168.131.111 Your chef_server_url may be misconfigured, or the network could be down.
    192.168.131.111 
    192.168.131.111 Relevant Config Settings:
    192.168.131.111 -------------------------
    192.168.131.111 chef_server_url  "https://cent7/organizations/test1k"
    192.168.131.111 
    192.168.131.111 Platform:
    192.168.131.111 ---------
    192.168.131.111 x86_64-linux
    192.168.131.111 
    192.168.131.111 
    192.168.131.111 Running handlers:
    192.168.131.111 [2016-10-18T15:43:47-07:00] ERROR: Running exception handlers
    192.168.131.111 Running handlers complete
    192.168.131.111 [2016-10-18T15:43:47-07:00] ERROR: Exception handlers complete
    192.168.131.111 Chef Client failed. 0 resources updated in 27 seconds
    192.168.131.111 [2016-10-18T15:43:47-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
    192.168.131.111 [2016-10-18T15:43:47-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
    192.168.131.111 [2016-10-18T15:43:47-07:00] ERROR: Error connecting to https://cent7/organizations/test1k/nodes/unode - Failed to open TCP connection to cent7:443 (getaddrinfo: Name or service not known)
    192.168.131.111 [2016-10-18T15:43:47-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

那是目标节点发生故障,而不是工作站。这意味着主机名 cent7 在您的工作站上有效,但在您正在引导的服务器上无效。确保您没有将它添加到您的主机文件或正在使用一些解析器路径技巧。