berkshelf + chef:找不到cookbook mysql的配方服务器

时间:2016-06-18 06:40:26

标签: mysql vagrant berkshelf

我正在使用带有Bookshelf的vagrant(1.8.4)。

我也安装了插件:

vagrant plugin install vagrant-omnibus
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-cachier

运行vagrant up后,我得到:

==> default: ================================================================================
==> default: Recipe Compile Error
==> default: ================================================================================
==> default: 
==> default: Chef::Exceptions::RecipeNotFound
==> default: --------------------------------
==> default: could not find recipe server for cookbook mysql

Vagrantfile chunk:

  config.vm.provision "chef_solo" do |chef|
      chef.add_recipe "java"
      chef.add_recipe "maven"
      chef.add_recipe "postgresql::server"
      chef.add_recipe "mysql::server"
      chef.add_recipe "sqlite"
      chef.add_recipe "groovy"

Berksfile内容:

source "https://supermarket.getchef.com"

cookbook "java"
cookbook "postgresql"
cookbook "mysql"
cookbook "sqlite"
cookbook "maven"
cookbook "groovy"

我见过这个:Chef mysql opscode-cookbooks desn't work: "could not find recipe ruby for cookbook mysql"但是我还不清楚如何在我的用例中修复它。

有关完整的Vagrantfile内容,请参阅:https://github.com/p6spy/p6spy/blob/master/Vagrantfile

我该如何解决?

1 个答案:

答案 0 :(得分:1)

我克隆了repo的副本并进行了以下更改:

Berksfile:

source 'https://supermarket.getchef.com'

cookbook 'java',       '= 1.29.0'
cookbook 'postgresql', '= 3.4.12'
cookbook 'mysql',      '= 5.6.3'
cookbook 'sqlite',     '= 1.1.0'
cookbook 'maven',      '= 1.2.0'
cookbook 'groovy',     '= 0.0.1'

我将厨师烹饪书的版本固定在2014年11月左右的版本中。这是基于您Vagrantfile的提交。

由于您没有指定版本,因此您将始终获得每个烹饪书的最新版本。如果您想使用更高版本,则需要在Vagrantfile中更改配方声明以匹配每个cookbook提供的当前配方。如前所述,mysql自那时起已经更新,也是maven cookbook。事实上,除了groovy和sqlite之外,其中大多数现在都是deprecated

Vagrantfile片段:

"groovy" => {
  "version"  => "2.1.9",
  "url"      => "https://dl.bintray.com/groovy/maven/groovy-binary-2.1.9.zip",
  "checksum" => "d9cb8d54680d508ac1eb928f8d0cfb1fb1bec7843bb405ea9a7d18f512b10ba6"
}

自2014年以来,获取groovy的URL已更改,因此我添加了新位置和校验和以进行匹配。