无法使用redisio cookbook安装redis.安装sensu服务器,sensu :: redis cookbook正在尝试安装redis并因以下错误而失败.这里有什么遗漏
Chef::Exceptions::ResourceNotFound
----------------------------------
Cannot find a resource matching service[redis6379] (did you define it first?)
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/redisio/recipes/enable.rb:25:in `block in from_file'
/var/chef/cache/cookbooks/redisio/recipes/enable.rb:23:in `each'
/var/chef/cache/cookbooks/redisio/recipes/enable.rb:23:in `from_file'
/var/chef/cache/cookbooks/sensu/recipes/redis.rb:23:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/redisio/recipes/enable.rb:
18: # limitations under the License.
19: #
20:
21: redis = node['redisio']
22:
23: redis['servers'].each do |current_server|
24: server_name = current_server["name"] || current_server["port"]
25>> resource = resources("service[redis#{server_name}]")
26: resource.action Array(resource.action)
27: resource.action << :start
28: resource.action << :enable
29: end
30:
Run Code Online (Sandbox Code Playgroud)
小智 5
我遇到了同样的问题.我不确定它是否是同一个原因,但我只是分享我的解决方案并希望它会有所帮助.
我的问题是当我升级redisio repo但没有升级我的运行列表时,在我的情况下,redis.json
我的旧运行列表如下所示:
"recipe[redisio::install]",
"recipe[redisio::enable]",
Run Code Online (Sandbox Code Playgroud)
我的新运行列表看起来像
"recipe[redisio]",
"recipe[redisio::enable]",
Run Code Online (Sandbox Code Playgroud)
从错误中我们的问题似乎在enable.rb中.并且它似乎recipe[redisio]将为启用阶段正确设置缺少的资源.我希望只是改变你的运行列表也会为你修复erorr.
PS我也不得不补充一下
"install_dir" : "/opt/redis/",
Run Code Online (Sandbox Code Playgroud)
在我的运行列表中.似乎下载和安装步骤将被空跳过install_dir
| 归档时间: |
|
| 查看次数: |
1059 次 |
| 最近记录: |