我正在按照教程http://gettingstartedwithchef.com/的第1章进行操作,并下载了第1章中列出的所有依赖项。命令“chef-solo -c solo.rb -j web.json”应该正常工作,但我收到以下错误。
我搜索了如下所示的错误,发现有人建议在任何其他人之前运行资源(比如配置包管理器,apt / yum / etc)。但是怎么做呢?所有链接都重定向到厨师主页...
任何建议都将不胜感激。
yum_package[mysql] action install
* No candidate version available for mysql
================================================================================
Error executing action `install` on resource 'yum_package[mysql]'
================================================================================
Chef::Exceptions::Package
-------------------------
No candidate version available for mysql
Resource Declaration:
---------------------
# In /root/chef-repo/cookbooks/mysql/recipes/client.rb
47: package name
48: end
Compiled Resource:
------------------
# Declared in /root/chef-repo/cookbooks/mysql/recipes/client.rb:47:in `block in from_file'
yum_package("mysql") do
action :install
retries 0
retry_delay 2
default_guard_interpreter :default
package_name "mysql"
timeout 900
flush_cache {:before=>false, :after=>false}
declared_type :package
cookbook_name :mysql
recipe_name "client"
end
运行处理程序:
[2015-05-15T10:28:13-04:00] ERROR: Running exception handlers
Running handlers complete
[2015-05-15T10:28:13-04:00] ERROR: Exception handlers complete
[2015-05-15T10:28:13-04:00] FATAL: Stacktrace dumped to /root/chef-solo/chef-stacktrace.out
Chef Client failed. 0 resources updated in 4.248307605 seconds
[2015-05-15T10:28:13-04:00] ERROR: yum_package[mysql] (mysql::client line 47) had an error: Chef::Exceptions::Package: No candidate version available for mysql
[2015-05-15T10:28:13-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
答案 0 :(得分:0)
MySQL通过“mysql-server”和“mysql-client”软件包进行分发。
您可以使用其中一个来满足您的依赖。
yum_package("mysql-server") do
...
package_name "mysql-server"
或
yum_package("mysql-client") do
...
package_name "mysql-client"
这些包是(当前)分别指向'mysql-server-5.6'和'mysql-client-5.6'的包装器。如果您需要不同的版本(例如:mysql-client-5.1),则可以指定它。
yum_package("mysql-client-5.1") do
...
package_name "mysql-client-5.1"