1

When you set up a stack in OpsWorks, does it lock in the current built-in cookbooks version or will it use the most up-to-date version each time a lifecycle event is triggered?

For custom cookbooks, I understand that OpsWorks caches the provided recipes when they are provided rather than fetching the newest version each time, but I wonder if the same is true for the built-in cookbooks.

I'm concerned about this for a few reasons. What if the cookbooks are updated to install a different version of Apache or PHP or slightly vary their default configuration? What if I then setup a new instance in a layer in which the old recipe was used and end up with multiple servers with slightly different configurations?

Also there doesn't appear to be a way to customize which PHP5 version gets installed, so am I just at the mercy of the ubuntu package managers' decision to use the latest stable version?

I do want to continue using the latest and greatest software versions, but I would like to deploy them on my own time after I have been able to test that my application works in the new version.

4

1 回答 1

1

当您在 OpsWorks 中设置堆栈时,它会锁定当前的内置说明书版本,还是会在每次触发生命周期事件时使用最新版本?

当您配置新机器时,会同时向服务器请求内置说明书 + 自定义说明书。它仅在请求自定义食谱更新时才会更新。这就是为什么不建议将整个 AWS 说明书复制到您的自定义说明书中的原因。只有您正在修改的内容才能从标准社区食谱更新中受益。

我担心这个有几个原因。如果更新说明书以安装不同版本的 Apache 或 PHP 或稍微改变其默认配置怎么办?如果我然后在使用旧配方的层中设置一个新实例并最终得到多个配置略有不同的服务器怎么办?

这不仅仅是一个祸根,也是一个好处。这取决于你如何看待这一点。可以做些什么可能会提高性能,也可以引入错误。这需要由您的操作人员保持同步。

您可以通过将重复(或自定义)版本放置在食谱中的同一位置来覆盖内置食谱的部分内容。收敛选项

或者更复杂但可靠的方法:

  1. 实施自定义食谱食谱。
  2. 将 opsworks 食谱作为子模块导入到您的食谱文件夹中的文件夹中。
  3. 现在将您需要版本控制的食谱符号链接到主文件夹
  4. 根据需要评估和更新特定的

IE :

cd cookbook
git submodule add https://github.com/aws/opsworks-cookbooks external-cookbooks/opsworks-cookbooks
ln -s external-cookbooks/opsworks-cookbooks/rails rails 

通过这种方式,您可以更新并保持对基础架构代码的版本控制。进行并评估更改,并且仅在您完成后导入更改

我仍然建议使用收敛模式,只需进行硬编码所需的微小更改。这将意味着更少的重复,并且您将受益于可能在食谱的社区版本中的更新。

如果您使用的是使用 UBUNTU 方式安装 PHP 的食谱 - 那么您将对 repo 中的内容感到怜悯。如果您使用的是另一个自定义编译版本,那么您可以编译特定版本。您可能必须自己编写或找到一个可以构建它并让您通过说明书上的属性指定版本的方法。

于 2014-04-13T08:55:44.263 回答