对资源“ yum_package”执行操作“安装”时出错[apache2]

时间:2018-08-19 18:06:03

标签: chef yum

当我在节点上执行命令“ chef-client”时,出现错误“在资源'yum_package [apache2]上执行操作install时出错”。造成这种情况的主要原因是-无法尝试尝试CDS负载平衡器rhui2-cds01.us-east-1.aws.ce.redhat.com。该节点是Amazon Linux EC2实例。 Chef服务器由Chef托管。 请检查下面的日志。

启动Chef Client版本13.10.4 解决运行清单的菜谱:[“ apache”] 同步食谱:   -阿帕奇(0.1.0) 安装食谱宝石: 编写食谱... 融合2种资源 食谱:apache :: default   * yum_package [apache2]操作安装

================================================================================
Error executing action `install` on resource 'yum_package[apache2]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.10.4/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----
STDOUT: [option installonlypkgs] kernel kernel-bigmem installonlypkg(kernel) installonlypkg(kernel-module) installonlypkg(vm) kernel-enterprise kernel-smp kernel-debug kernel-unsupported kernel-source kernel-devel kernel-PAE kernel-PAE-debug
Could not contact CDS load balancer rhui2-cds01.us-east-1.aws.ce.redhat.com, trying others.
STDERR: Traceback (most recent call last):
  File "/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.10.4/lib/chef/provider/package/yum/yum-dump.py", line 299, in <module>
    status = main()
  File "/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.10.4/lib/chef/provider/package/yum/yum-dump.py", line 288, in main
    return yum_dump(options)
  File "/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.10.4/lib/chef/provider/package/yum/yum-dump.py", line 214, in yum_dump
    return dump_packages(yb, options.package_list, options.output_provides)
  File "/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.10.4/lib/chef/provider/package/yum/yum-dump.py", line 125, in dump_packages
    db = yb.doPackageLists(list)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 2964, in doPackageLists
    avail = self.pkgSack.returnPackages(repoid=repoid,
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1074, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 778, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 347, in populateSack
    self.doSetup()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 122, in doSetup
    self.ayum.plugins.run('prereposetup')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/rhui-lb.py", line 135, in prereposetup_hook
    ', '.join(cds_balancers))
yum.plugins.PluginYumExit: Could not contact any CDS load balancers: rhui2-cds01.us-east-1.aws.ce.redhat.com, rhui2-cds02.us-east-1.aws.ce.redhat.com.
---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.10.4/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----
Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.10.4/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 returned 1

Resource Declaration:
---------------------
# In /home/ec2-user/.chef/cache/cookbooks/apache/recipes/default.rb

  8: package 'apache2' do
  9:    package_name 'httpd'
 10:    action :install
 11: end
 12: 

Compiled Resource:
------------------
# Declared in /home/ec2-user/.chef/cache/cookbooks/apache/recipes/default.rb:8:in `from_file'

yum_package("apache2") do
  package_name "httpd"
  action [:install]
  default_guard_interpreter :default
  declared_type :package
  cookbook_name "apache"
  recipe_name "default"
end

System Info:
------------
chef_version=13.10.4
platform=redhat
platform_version=7.5
ruby=ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
program_name=chef-client worker: ppid=11667;start=18:00:05;
executable=/opt/chef/bin/chef-client

1 个答案:

答案 0 :(得分:0)

此错误与Chef没有关系,从消息yum无法访问软件包存储库服务器中可以看到。