在资源'包[mysql-devel]上执行操作`install`时出错

时间:2014-11-26 11:32:10

标签: mysql chef chef-recipe chef-solo

我运行了一个配方,在我的rhel6 linux机器上安装mysql-client和mysql-server。使用的食谱是使用刀具从超市下载的。 我正在逐步关注this教程。 执行此命令:

chef-solo -c solo.rb -j web.json

====

我收到了以下错误。

Recipe: mysql::client
  * package[mysql] action install (up to date)
  * package[mysql-devel] action install

================================================================================
**Error executing action `install` on resource 'package[mysql-devel]'**
================================================================================

Chef::Exceptions::Exec
----------------------
 returned 1, expected 0


Resource Declaration:
---------------------
# In /home/subham/chef-repo/chef-repo/cookbooks/mysql/recipes/client.rb

 47:   package name
 48: end

Compiled Resource:
------------------
# Declared in /home/subham/chef-repo/chef-repo/cookbooks/mysql/recipes/client.rb:47:in `block in from_file'

package("mysql-devel") do
  action :install
  retries 0
  retry_delay 2
  guard_interpreter :default
  package_name "mysql-devel"
  version "5.1.61-4.el6"
  timeout 900
  cookbook_name :mysql
  recipe_name "client"
end


Running handlers:
[2014-11-26T06:22:23-05:00] ERROR: Running exception handlers
Running handlers complete
[2014-11-26T06:22:23-05:00] ERROR: Exception handlers complete
[2014-11-26T06:22:23-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 1 resources updated in 29.10138575 seconds
[2014-11-26T06:22:24-05:00] ERROR: package[mysql-devel] (mysql::client line 47) had an error: Chef::Exceptions::Exec:  returned 1, expected 0
[2014-11-26T06:22:24-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Stacktrace at /var/chef/cache/chef-stacktrace.out

Generated at 2014-11-26 06:22:23 -0500
Chef::Exceptions::Exec: package[mysql-devel] (mysql::client line 47) had an error: Chef::Exceptions::Exec:  returned 1, expected 0
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/command.rb:158:in `handle_command_failures'
/opt/chefdk/embedded/apps/chef/lib/chef/provider/package/yum.rb:1021:in `yum_command'
/opt/chefdk/embedded/apps/chef/lib/chef/provider/package/yum.rb:1136:in `install_package'
/opt/chefdk/embedded/apps/chef/lib/chef/provider/package.rb:82:in `block in action_install'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `call'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:156:in `converge_by'
/opt/chefdk/embedded/apps/chef/lib/chef/provider/package.rb:80:in `action_install'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:121:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:345:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:431:in `do_run'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:213:in `block in run'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:207:in `fork'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:207:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/application.rb:236:in `run_chef_client'
/opt/chefdk/embedded/apps/chef/lib/chef/application/solo.rb:226:in `block in run_application'
/opt/chefdk/embedded/apps/chef/lib/chef/application/solo.rb:218:in `loop'
/opt/chefdk/embedded/apps/chef/lib/chef/application/solo.rb:218:in `run_application'
/opt/chefdk/embedded/apps/chef/lib/chef/application.rb:55:in `run'
/opt/chefdk/embedded/apps/chef/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:33:in `load'
/usr/bin/chef-solo:33:in `<main>'

文件位于/home/subham/chef-repo/chef-repo/cookbooks/mysql/recipes/client.rb

line 46 : node['mysql']['client']['packages'].each do |name|
line 47 :   package name
line 48 : end

在同一档案的标题评论部分

# Include Opscode helper in Recipe class to get access
# to debian_before_squeeze? and ubuntu_before_lucid?

这是否意味着此配方仅适用于基于debian系列的系统,如ubuntu,而不适用于RHEL或fedora / Cent OS? 如果是,那么我需要做些什么改变?

0 个答案:

没有答案