【问题标题】:Mcollective Chef service agent failed to runMcollective Chef 服务代理无法运行
【发布时间】:2015-01-27 08:07:23
【问题描述】:

我已配置mcollective 并安装以下service 代理到start/stop 服务

https://github.com/rottenbytes/mcollective/blob/master/plugins/agents/chef-service.rb

但是当我运行它时,它在client.build_node 失败,我看到错误undefined method reset_defaults_and_overrides for nil:NilClass (NoMethodError)

require 'chef'
require 'chef/client'
require 'chef/run_context'
begin

Chef::Config[:solo] = true
Chef::Config[:log_level] = :debug
Chef::Log.level(:debug)
client = Chef::Client.new
client.run_ohai
client.build_node   <-- its failing here 

如果我尝试在我的 shell 上运行,我会得到关注

[root@node1 agent]# ruby /tmp/foo.rb 
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.2/lib/chef/policy_builder/expand_node_object.rb:117:in `build_node': undefined method `reset_defaults_and_overrides' for nil:NilClass (NoMethodError)
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.2/lib/chef/client.rb:259:in `build_node'
    from /tmp/foo.rb:11:in `<main>'

我不是红宝石专家,所以我不知道如何解决它。我只需要知道发生了什么

【问题讨论】:

    标签: ruby chef-infra mcollective


    【解决方案1】:

    从外观上看,chef 客户端的内部 API 已经发生了很大变化,mcollective 插件将不再工作。尝试旧版本的 chef gem。

    【讨论】:

    • 我也试过 '1.8' 和 '1.9' 但同样的错误,我从哪里获得新的 API?
    • 这些是 Ruby 版本,而不是 Chef 版本。基本上在这个和你过去的问题之间,你不能使用这个软件。如果不深入研究代码就无法使用它,而且您似乎不愿意自己这样做。要么聘请顾问,要么找到其他选择:-/ 抱歉回答太苛刻了。
    猜你喜欢
    • 1970-01-01
    • 2015-03-20
    • 1970-01-01
    • 1970-01-01
    • 2021-10-18
    • 2015-01-01
    • 2020-02-14
    • 2014-06-06
    • 2016-04-29
    相关资源
    最近更新 更多