Amazon web services Chef和Redisio错误
也许有人面临同样的情况 我们在redis上有一个干净的例子,他试图让一个厨师 默认配方只有 包括“redisio::install” 当我做饭时,会出现以下错误 Environment AWS ec2.micro ubuntu 12.04 当我运行cook接收错误时Amazon web services Chef和Redisio错误,amazon-web-services,chef-solo,Amazon Web Services,Chef Solo,也许有人面临同样的情况 我们在redis上有一个干净的例子,他试图让一个厨师 默认配方只有 包括“redisio::install” 当我做饭时,会出现以下错误 Environment AWS ec2.micro ubuntu 12.04 当我运行cook接收错误时 ================================================================================ Recipe Compile Error in /tmp/chef-s
================================================================================
Recipe Compile Error in /tmp/chef-solo/cookbooks/main/recipes/default.rb
================================================================================
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Cookbook Trace:
---------------
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:13:in `block in from_file'
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:12:in `from_file'
/tmp/chef-solo/cookbooks/redisio/recipes/install.rb:20:in `from_file'
/tmp/chef-solo/cookbooks/main/recipes/default.rb:11:in `from_file'
Relevant File Content:
----------------------
/tmp/chef-solo/cookbooks/ulimit/recipes/default.rb:
6: # All rights reserved - Do Not Redistribute
7: #
8: ulimit = node['ulimit']
9:
10: case node[:platform]
11: when "debian", "ubuntu"
12: template "/etc/pam.d/su" do
13>> cookbook ulimit['pam_su_template_cookbook']
14: end
15: end
16:
[2013-04-06T14:09:50+00:00] ERROR: Running exception handlers
[2013-04-06T14:09:50+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated
[2013-04-06T14:09:50+00:00] FATAL: Stacktrace dumped to /tmp/chef-solo/chef-stacktrace.out
[2013-04-06T14:09:50+00:00] FATAL: NoMethodError: undefined method `[]' for nil:NilClass
ERROR: RuntimeError: chef-solo failed. See output above.
参考资料我也遇到了这个问题。我有一个办法来解决这个问题,但我也刚刚开始研究厨师 问题是redisio依赖于ulimit,并且当您没有定义ulimit的任何属性时,配方似乎无法处理
ulimit = node['ulimit']
尝试获取属性的散列,但结果为零。因此,如果您定义了一些属性,它应该会起作用
自您下载该配方后,可能会有一个更新版本。如果不在ulimit/attributes/default.rb
中,我有default['ulimit']['pam\u su\u template\u cookbook']=nil
并且它对我有效
ulimit允许您限制资源。我认为它可以用来限制redis的资源。(同样,我也是新手。)因此,更好的方法可能是了解如何配置ulimit并设置正确的属性,而不是nil