我正在使用chef在亚马逊亚马逊环境中使用刀子ec2插件创建一个服务器。
我已经使用以下命令创建了EC2服务器:
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时,它给我一个错误:
[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
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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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)请帮我解决这个问题。
发布于 2014-06-24 17:00:19
在我的例子中,Linux AMI上的yum出现了一些问题。
我用来创建centos机器的相同命令起作用了。
https://stackoverflow.com/questions/24379879
复制相似问题