gpt4 book ai didi

mysql - Chef Mysql 菜谱失败

转载 作者:行者123 更新时间:2023-11-29 12:44:53 25 4
gpt4 key购买 nike

我在 Centos7 上使用最新的 Chef 'MYSQL' 配方,需要像这样的标准角色

name "lamp"
description "A full lamp server"
run_list "recipe[apache2]",
"recipe[apache2::mod_php5]",
"recipe[apache2::logrotate]",
"recipe[yum]",
"recipe[yum-epel]",
"recipe[mysql::client]",
"recipe[mysql::server]"
override_attributes({
"starter_name" => "Jonathan Tizard",
"mysql" => {
"server_root_password" => 'iloverandompasswordsbutthiswilldo',
"server_repl_password" => 'iloverandompasswordsbutthiswilldo',
"server_debian_password" => 'iloverandompasswordsbutthiswilldo'
}
})

但是我收到以下错误,我是否在这里遗漏了一些明显的东西?我不明白为什么它失败了。我想我还没有定义变量或其他东西?

Recipe: mysql::server
* mysql_service[default] action create
Recipe: yum-mysql-community::mysql55
* yum_repository[mysql55-community] action create
* template[/etc/yum.repos.d/mysql55-community.repo] action create (up to date)
* execute[yum-makecache-mysql55-community] action nothing (skipped due to action :nothing)
* ruby_block[yum-cache-reload-mysql55-community] action nothing (skipped due to action :nothing)
(up to date)
- evaluate block and run any associated actions
================================================================================
Error executing action `create` on resource 'mysql_service[default]'
================================================================================

ArgumentError
-------------
You must supply a name when declaring a package resource

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_rhel.rb:168:in `block (2 levels) in <class:Rhel>'
/var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_rhel.rb:153:in `block in <class:Rhel>'

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/mysql/recipes/server.rb

20: mysql_service node['mysql']['service_name'] do
21: version node['mysql']['version']
22: port node['mysql']['port']
23: data_dir node['mysql']['data_dir']
24: server_root_password node['mysql']['server_root_password']
25: server_debian_password node['mysql']['server_debian_password']
26: server_repl_password node['mysql']['server_repl_password']
27: allow_remote_root node['mysql']['allow_remote_root']
28: remove_anonymous_users node['mysql']['remove_anonymous_users']
29: remove_test_database node['mysql']['remove_test_database']
30: root_network_acl node['mysql']['root_network_acl']
31: version node['mysql']['version']
32: action :create
33: end

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/mysql/recipes/server.rb:20:in `from_file'

mysql_service("default") do
action [:create]
retries 0
retry_delay 2
guard_interpreter :default
service_name "default"
version "5.5"
package_name "mysql55-server"
data_dir "/var/lib/mysql"
port "3306"
remove_anonymous_users true
remove_test_database true
server_root_password "iloverandompasswordsbutthiswilldo"
server_debian_password "iloverandompasswordsbutthiswilldo"
server_repl_password "iloverandompasswordsbutthiswilldo"
cookbook_name "mysql"
recipe_name "server"
end


Running handlers:
[2014-08-29T21:54:45+00:00] ERROR: Running exception handlers
Running handlers complete
[2014-08-29T21:54:45+00:00] ERROR: Exception handlers complete
[2014-08-29T21:54:45+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 1 resources updated in 9.218038398 seconds
[2014-08-29T21:54:46+00:00] ERROR: mysql_service[default] (mysql::server line 20) had an error: ArgumentError: You must supply a name when declaring a package resource
[2014-08-29T21:54:47+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

最佳答案

参见this

说明书定义了它应该安装的包,并在操作系统版本上使用大量的 if/then 选择。

我认为centos 7版本解析有问题导致了错误。也许您可以检查节点的 platform_version 值,以找出它无法确定正确包的原因。

关于mysql - Chef Mysql 菜谱失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25595993/

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