首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Chef:在资源'package[httpd]‘上执行操作`install`时出错

Chef:在资源'package[httpd]‘上执行操作`install`时出错
EN

Stack Overflow用户
提问于 2014-06-24 14:37:31
回答 1查看 928关注 0票数 0

我正在使用chef在亚马逊亚马逊环境中使用刀子ec2插件创建一个服务器。

我已经使用以下命令创建了EC2服务器:

代码语言:javascript
复制
knife ec2 server create --image ami-7c807d14 --flavor t1.micro --region us-east-1 --security-group-ids sg-ID --ebs-size 10 --ebs-no-delete-on-term --tags Name=Test_Server --server-connect-attribute private_ip_address  --subnet subnet-ID --ssh-user ec2-user --identity-file ~/.ssh/key.pem --environment Testing --node-name Redhat-Server

当我ssh到Chef node并运行以下命令sudo chef-client在该节点上安装apache时,它给我一个错误:

代码语言:javascript
复制
[2014-06-24T07:44:55+00:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

验证所有HTTPS连接(推荐)

ssl_verify_mode :verify_peer

或者,仅验证与chef-server的连接

verify_api_cert true

代码语言:javascript
复制
To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

knife ssl check -c /etc/chef/client.rb

代码语言:javascript
复制
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Starting Chef Client, version 11.12.8
resolving cookbooks for run list: ["apache-tutorial-1"]
Synchronizing Cookbooks:
  - apache-tutorial-1
Compiling Cookbooks...
Converging 4 resources
Recipe: apache-tutorial-1::default
  * package[httpd] action install
================================================================================
Error executing action `install` on resource 'package[httpd]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
STDOUT: [option installonlypkgs] kernel kernel-devel kernel-source installonlypkg(kernel) installonlypkg(kernel-module) installonlypkg(vm)
STDERR: yum-dump Repository Error: failure: repodata/repomd.xml from amzn-main: [Errno 256] No more mirrors to try.
---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides returned 1


Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/apache-tutorial-1/recipes/default.rb

 11: package 'httpd' do
 12:   action :install
 13: end
 14:



Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/apache-tutorial-1/recipes/default.rb:11:in `from_file'

package("httpd") do
  action [:install]
  retries 0
  retry_delay 2
  guard_interpreter :default
  package_name "httpd"
  cookbook_name "apache-tutorial-1"
  recipe_name "default"
end




Running handlers:
[2014-06-24T07:45:04+00:00] ERROR: Running exception handlers
Running handlers complete

[2014-06-24T07:45:04+00:00] ERROR: Exception handlers complete
[2014-06-24T07:45:04+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 9.101137934 seconds
[2014-06-24T07:45:04+00:00] ERROR: package[httpd] (apache-tutorial-1::default line 11) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
STDOUT: [option installonlypkgs] kernel kernel-devel kernel-source installonlypkg(kernel) installonlypkg(kernel-module) installonlypkg(vm)
STDERR: yum-dump Repository Error: failure: repodata/repomd.xml from amzn-main: [Errno 256] No more mirrors to try.
---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides returned 1
[2014-06-24T07:45:05+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

请帮我解决这个问题。

EN

回答 1

Stack Overflow用户

发布于 2014-06-24 17:00:19

在我的例子中,Linux AMI上的yum出现了一些问题。

我用来创建centos机器的相同命令起作用了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24379879

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档