【发布时间】:2015-05-23 04:56:24
【问题描述】:
我正在管理一个 rhel 服务器 6.x,它为应用程序安装了 Python-2.7.8。当厨师客户端执行以下厨师资源时。
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
python 2.7.8 是使用 Chef 安装的,如下所示:
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”用户。
知道为什么会出现此错误消息吗?
【问题讨论】:
-
看到我的问题被标记下来,我并不生气。但我想知道在一个问题中需要记录哪些研究工作。 Python 不是我处理的东西。我已尽力使问题尽可能详细和清晰。记下一个问题并给出提示是一种更好的方式来表明我们知道我们记下的内容和原因。
-
你的节点显然似乎没有使用代理。但我没有看到那里执行 get-pip 的行.. 它是
make altinstall的一部分吗? -
@Tensibai : chef 中的执行只是执行资源。执行 "/usr/local/bin/python2.7 #{node[:basedir]}/get-pip.py" 你建议在这个命令中附加代理信息吗?像这样:“/usr/local/bin/python2.7 #{node[:basedir]}/get-pip.py --proxy="[user:passwd@]proxy.server:port""
-
我会在执行资源的环境属性中添加代理信息。如果您可以编辑以显示您的完整食谱,我明天可能会给出更好的答案(不是现在通过电话,抱歉)
-
@Tensibai:在“执行”厨师资源中添加代理解决了这个问题。现在守护进程启动的 chef-client 运行成功。非常感谢。
标签: python chef-infra rhel