我运行的命令:
knife bootstrap 223.194.70.128 --sudo -x <username> -P '~~~' -N pc128
错误:
223.194.70.128 -----> Installing Chef Omnibus (-v 13)
223.194.70.128 downloading http://apl.chef-server.com:34512/nodes/install.sh
223.194.70.128 to file /tmp/install.sh.1783/install.sh
223.194.70.128 trying wget...
223.194.70.128 trying curl...
223.194.70.128 trying perl...
223.194.70.128 trying python...
223.194.70.128 >>>>>> wget, curl, fetch, perl, or python not found on this instance.
223.194.70.128 \nDEBUG OUTPUT FOLLOWS:\n\nSTDERR from wget:\n\n--2018-07-12 17:40:12-- http://apl.chef-server.com:34512/nodes/install.sh
223.194.70.128 Resolving apl.chef-server.com (apl.chef-server.com)... 223.194.70.126
223.194.70.128 Connecting to apl.chef-server.com (apl.chef-server.com)|223.194.70.126|:34512... failed: Connection refused.\n\nSTDERR from curl:\n\n\n\nSTDERR from perl:\n\nCan't locate LWP/Simple.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at -e line 1.
223.194.70.128 BEGIN failed--compilation aborted at -e line 1.\n\nSTDERR from python:\n\nTraceback (most recent call last):
223.194.70.128 File "<string>", line 1, in <module>
223.194.70.128 File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
223.194.70.128 return opener.open(url, data, timeout)
223.194.70.128 File "/usr/lib64/python2.7/urllib2.py", line 431, in open
223.194.70.128 response = self._open(req, data)
223.194.70.128 File "/usr/lib64/python2.7/urllib2.py", line 449, in _open
223.194.70.128 '_open', req)
223.194.70.128 File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
223.194.70.128 result = func(*args)
223.194.70.128 File "/usr/lib64/python2.7/urllib2.py", line 1244, in http_open
223.194.70.128 return self.do_open(httplib.HTTPConnection, req)
223.194.70.128 File "/usr/lib64/python2.7/urllib2.py", line 1214, in do_open
223.194.70.128 raise URLError(err)
223.194.70.128 urllib2.URLError: <urlopen error [Errno 111] Connection refused>\n
223.194.70.128 Starting the first Chef Client run...
223.194.70.128 sh: line 257: chef-client: command not found
我不知道为什么发生连接拒绝错误。 我的knife.rb是
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name 'apl'
client_key "#{current_dir}/apl.pem"
validation_client_name 'apl-validator'
validation_key "#{current_dir}/apl-validator.pem"
chef_server_url 'https://apl.chef-server.com/organizations/apl'
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path ["#{current_dir}/../cookbooks"]
knife[:bootstrap_template] = "#{current_dir}/../bootstrap/template.erb"
我看到了添加的解决方案
knife[:bootstrap_proxy] = "http://username:password@proxy:port"
在Unable to Bootstrap node using Chef中使用-chef ,但没有用。
我的/ etc / hosts是
127.0.0.1 apl.chef-server.com localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 apl.chef-server.com localhost localhost.localdomain localhost6 localhost6.localdomain6
223.194.70.126 apl.chef-server.com
223.194.70.128 pc128
请帮助我。
谢谢