gpt4 book ai didi

mysql 运行 Chef 入门第一章时出错

转载 作者:行者123 更新时间:2023-11-29 22:26:01 25 4
gpt4 key购买 nike

我正在关注教程http://gettingstartedwithchef.com/的第一章并下载了第一章中列出的所有依赖项。命令“chef-solo -c alone.rb -j web.json”应该可以工作,但出现以下错误。

我用谷歌搜索了如下所示的错误,发现有人建议先运行一个资源(比如配置包管理器、apt/yum/等)。但如何做到这一点呢?所有链接都重定向到 Chef 主页...

如有任何建议,我们将不胜感激。

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)

最佳答案

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"

关于mysql 运行 Chef 入门第一章时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30265632/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com