我正在管理一个安装了Python-2.7.8的RHEL服务器6.x,用于运行一个应用程序。当下面的Chef资源被Chef客户端执行时。
execute "/usr/local/bin/python2.7 #{node[:base_dir]}/get-pip.py"
我在chef-client日志中看到了以下错误。
[2015-02-24T17:42:27+00:00] ERROR: execute[/usr/local/bin/python2.7 /opt/mount/get-pip.py] (python_app::default line 105) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/bin/python2.7 /opt/mount1/get-pip.py ----
STDOUT: Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee268d0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee269d0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee26ad0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee26bd0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee26cd0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee26f50>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152efc4150>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152efc4250>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152efc4350>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152efc4450>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Could not find any downloads that satisfy the requirement pip in /usr/local/lib/python2.7/site-packages
Collecting pip
No distributions at all found for pip in /usr/local/lib/python2.7/site-packages
STDERR:
---- End output of /usr/local/bin/python2.7 /opt/mount1/get-pip.py ----
我在查找有关此问题的Python信息。我注意到还有另一个版本的Python,我认为这是随RHEL安装的。
Python 2.6.6
以下是使用Chef安装Python 2.7.8的步骤:
ark 'python' do
url 'https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz'
path "/opt/mount/"
owner 'python'
action :put
end
execute "cd #{node[:base_dir]}/python && ./configure && make && make altinstall" do
not_if { File.exists?('/usr/local/bin/python2.7') }
end
我观察到的一件事是'/opt/mount/python'的所有者是'root'而不是'python'用户。有任何想法为什么会出现这个错误信息?
make altinstall
的一部分吗? - Tensibai