2014-12-31 65 views
0

我正在使用小廚師github.com/tobami/littlechef在ubuntu 14.04 vm上使用virtualbox和vagrant安裝石墨。在Ubuntu上找不到食譜yum?

描述Ubuntu的服務器節點看起來像這樣

{ 
    "chef_environment": "_default", 
    "name": "local_monitoring", 
    "platform": "debian", 
    "run_list": [ 
     "recipe[graphite]" 
    ] 
} 

當我試圖運行下面的命令

fix node:local_monitoring 

...我收到以下錯誤消息。

== Configuring local_monitoring == 
Synchronizing nodes, environments, roles, cookbooks and data bags... 

Cooking... 
[2014-12-31T01:40:58+00:00] INFO: Forking chef instance to converge... 
[2014-12-31T01:40:58+00:00] INFO: *** Chef 11.12.8 *** 
[2014-12-31T01:40:58+00:00] INFO: Chef-client pid: 19967 
[2014-12-31T01:41:04+00:00] INFO: Setting the run_list to ["recipe[graphite]"] from CLI options 
[2014-12-31T01:41:04+00:00] INFO: Run List is [recipe[graphite]] 
[2014-12-31T01:41:04+00:00] INFO: Run List expands to [graphite] 
[2014-12-31T01:41:04+00:00] INFO: Starting Chef Run for local-monitoring 
[2014-12-31T01:41:04+00:00] INFO: Running start handlers 
[2014-12-31T01:41:04+00:00] INFO: Start handlers complete. 
[2014-12-31T01:41:04+00:00] ERROR: Running exception handlers 
[2014-12-31T01:41:04+00:00] ERROR: Exception handlers complete 
[2014-12-31T01:41:04+00:00] FATAL: Stacktrace dumped to /tmp/chef-solo/cache/chef-stacktrace.out 
[2014-12-31T01:41:04+00:00] ERROR: Cookbook yum not found. If you're loading yum from another cookbook, make sure you configure the dependency in your metadata 
[2014-12-31T01:41:04+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 

FAILED: chef-solo could not finish configuring the node 

Disconnecting from [email protected]:2001... done. 

我有石墨食譜這裏github.com/hw-cookbooks/graphite發現裝在我coobooks目錄。

我在這裏閱讀了一個類似的問題lists.opscode.com/sympa/arc/chef/2013-02/msg00409.html,所以我從這裏下載了yum食譜https://github.com/opscode-cookbooks/yum並將它添加到我的運行列表中,但是當我運行fix node:local_monitoring,我得到以下輸出。

== Configuring local_monitoring == 
Synchronizing nodes, environments, roles, cookbooks and data bags... 

Cooking... 
[2014-12-31T01:47:18+00:00] INFO: Forking chef instance to converge... 
[2014-12-31T01:47:18+00:00] INFO: *** Chef 11.12.8 *** 
[2014-12-31T01:47:18+00:00] INFO: Chef-client pid: 20308 
[2014-12-31T01:47:24+00:00] INFO: Setting the run_list to ["recipe[yum]", "recipe[graphite]"] from CLI options 
[2014-12-31T01:47:24+00:00] INFO: Run List is [recipe[yum], recipe[graphite]] 
[2014-12-31T01:47:24+00:00] INFO: Run List expands to [yum, graphite] 
[2014-12-31T01:47:24+00:00] INFO: Starting Chef Run for local-monitoring 
[2014-12-31T01:47:24+00:00] INFO: Running start handlers 
[2014-12-31T01:47:24+00:00] INFO: Start handlers complete. 
[2014-12-31T01:47:24+00:00] ERROR: Running exception handlers 
[2014-12-31T01:47:24+00:00] ERROR: Exception handlers complete 
[2014-12-31T01:47:24+00:00] FATAL: Stacktrace dumped to /tmp/chef-solo/cache/chef-stacktrace.out 
[2014-12-31T01:47:24+00:00] ERROR: Cookbook yum not found. If you're loading yum from another cookbook, make sure you configure the dependency in your metadata 
[2014-12-31T01:47:24+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 

FAILED: chef-solo could not finish configuring the node 

Disconnecting from [email protected]:2001... done. 

我真的不知道該在這裏做什麼,或者是什麼可能導致這個問題。任何幫助,將不勝感激 。如果我需要澄清某事讓我知道。非常感謝你!

+0

cookbook需要更新才能支持ubuntu,IE使用'package'來做安裝。這將使它使用'apt-get install'而不是'yum' – abc123

+0

以上評論是不正確的,並且與此問題無關。 – coderanger

回答

0

The graphite cookbook depends on yum。因爲廚師菜譜依賴性必須是純靜態的,所以它們不能是每個平臺,所以即使在平臺上它也不需要實際使用。這就是爲什麼像Berkshelf這樣的工具很受管理下載和依賴關係的原因。

+0

謝謝您的評論!爲什麼Chef在我將它列入運行列表後仍然無法找到yum食譜? – PaulM

+0

你真的下載和解包yum cookbook到你的cookbooks文件夾(以及所有其他依賴項)嗎? – coderanger

+0

我從這裏https://github.com/opscode-cookbooks/yum和https://github.com/opscode-cookbooks/yum-epel克隆版本庫。我把它放在我的食譜目錄中。 – PaulM