运行 厨师客户时无法从食谱中找到食谱
Could not find recipe from cookbook when running chef-client
我正在尝试使用 chef-client 在独立系统上测试食谱,但在执行以下命令时一直出现错误。
我可以 运行 default.rb 使用
sudo chef-client -z -o "recipe[kafkaSetup]"
但是当我 运行 另一个食谱时,我得到如下命令的错误。
sudo chef-client -z -o "recipe[kafkaSetup::reBalanceCluster.rb]"
[2016-10-18T06:09:33-04:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 12.12.15
[2016-10-18T06:09:37-04:00] WARN: Run List override has been provided.
[2016-10-18T06:09:37-04:00] WARN: Original Run List: []
[2016-10-18T06:09:37-04:00] WARN: Overridden Run List: [recipe[kafkaSetup::reBalanceCluster.rb]]
resolving cookbooks for run list: ["kafkaSetup::reBalanceCluster.rb"]
Synchronizing Cookbooks:
- kafkaSetup (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
================================================================================
Recipe Compile Error
================================================================================
Chef::Exceptions::RecipeNotFound
--------------------------------
could not find recipe reBalanceCluster.rb for cookbook kafkaSetup
Platform:
---------
x86_64-linux
Running handlers:
[2016-10-18T06:09:37-04:00] ERROR: Running exception handlers
Running handlers complete
[2016-10-18T06:09:37-04:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 04 seconds
[2016-10-18T06:09:37-04:00] FATAL: Stacktrace dumped to /root/.chef/local-mode-cache/cache/chef-stacktrace.out
[2016-10-18T06:09:37-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-10-18T06:09:37-04:00] ERROR: could not find recipe reBalanceCluster.rb for cookbook kafkaSetup
[2016-10-18T06:09:39-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)
我做错了什么?任何帮助将不胜感激。
配方名称不包括文件扩展名(.rb
),因此在指定运行列表时必须省略它:
sudo chef-client -z -o "recipe[kafkaSetup::reBalanceCluster]"
这假设有一个文件recipes/reBalanceCluster.rb
。为了节省,我还建议在所有地方都使用小写字母。那可能根本行不通。所以最好将文件重命名为 rebalancecluster.rb
并使用:
sudo chef-client -z -o "recipe[kafkaSetup::rebalancecluster]"
我正在尝试使用 chef-client 在独立系统上测试食谱,但在执行以下命令时一直出现错误。
我可以 运行 default.rb 使用
sudo chef-client -z -o "recipe[kafkaSetup]"
但是当我 运行 另一个食谱时,我得到如下命令的错误。
sudo chef-client -z -o "recipe[kafkaSetup::reBalanceCluster.rb]"
[2016-10-18T06:09:33-04:00] WARN: No config file found or specified on command line, using command line options. Starting Chef Client, version 12.12.15 [2016-10-18T06:09:37-04:00] WARN: Run List override has been provided. [2016-10-18T06:09:37-04:00] WARN: Original Run List: [] [2016-10-18T06:09:37-04:00] WARN: Overridden Run List: [recipe[kafkaSetup::reBalanceCluster.rb]] resolving cookbooks for run list: ["kafkaSetup::reBalanceCluster.rb"] Synchronizing Cookbooks: - kafkaSetup (0.1.0) Installing Cookbook Gems: Compiling Cookbooks... ================================================================================ Recipe Compile Error ================================================================================ Chef::Exceptions::RecipeNotFound -------------------------------- could not find recipe reBalanceCluster.rb for cookbook kafkaSetup Platform: --------- x86_64-linux Running handlers: [2016-10-18T06:09:37-04:00] ERROR: Running exception handlers Running handlers complete [2016-10-18T06:09:37-04:00] ERROR: Exception handlers complete Chef Client failed. 0 resources updated in 04 seconds [2016-10-18T06:09:37-04:00] FATAL: Stacktrace dumped to /root/.chef/local-mode-cache/cache/chef-stacktrace.out [2016-10-18T06:09:37-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2016-10-18T06:09:37-04:00] ERROR: could not find recipe reBalanceCluster.rb for cookbook kafkaSetup [2016-10-18T06:09:39-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
我做错了什么?任何帮助将不胜感激。
配方名称不包括文件扩展名(.rb
),因此在指定运行列表时必须省略它:
sudo chef-client -z -o "recipe[kafkaSetup::reBalanceCluster]"
这假设有一个文件recipes/reBalanceCluster.rb
。为了节省,我还建议在所有地方都使用小写字母。那可能根本行不通。所以最好将文件重命名为 rebalancecluster.rb
并使用:
sudo chef-client -z -o "recipe[kafkaSetup::rebalancecluster]"