简体   繁体   English

如何将Chef Opscode与AWS自动缩放配合使用

[英]How to use Chef Opscode with AWS autoscaling

I have been facing issues with integrating chef with AWS autoscale. 我在将Chef与AWS autoscale集成时遇到了问题。

In most of my searches it tells about bootstrapping an instance and then using it's AMI to launch other instance in just the same way. 在我的大多数搜索中,它讲述了如何引导实例,然后使用AMI以相同的方式启动其他实例。

Basic issue is, Chef recognises each host with it's hostname, which in the above case is all going to be same. 基本问题是,Chef可以识别具有其主机名的每个主机,在上述情况下,它们都是相同的。 However, I was hoping for something like a Role which integrates in to AWS and does the thing better for me. 但是,我希望可以将诸如Role之类的东西集成到AWS中并对我做得更好。 Any help/Ideas will be appreciated. 任何帮助/想法将不胜感激。 I just hope someone has done it already. 我只是希望有人已经做到了。

Regards, 问候,

There are a lot of options but the general flow looks like this: 有很多选项,但是总体流程如下:

  1. Create an AMI with Chef pre-installed and with your org validator key and a client.rb with the server URL set. 创建一个预先安装了Chef的AMI,并使用您的组织验证器密钥和一个设置了服务器URL的client.rb Packer is great for this. Packer对此非常有用。 Technically optional, you could do this from the user-data script, but it saves a few seconds on each server launch. 从技术上讲是可选的,您可以从用户数据脚本中执行此操作,但是在每次启动服务器时都可以节省几秒钟。
  2. Configure the UserData field on the ASG to be a script (or cloud-init config if you want to get fancy but we'll ignore that option for now) that launches chef-client -r 'role[myrole] where myrole is usually based on the type of ASG you are building. 将ASG上的UserData字段配置为脚本(如果想要,可以使用cloud-init配置,但现在我们将忽略该选项),该脚本将启动chef-client -r 'role[myrole] ,其中myrole通常基于根据您要构建的ASG的类型。 This will use the validator key to register with the Chef Server automatically and set the run list based on the command line you give. 这将使用验证键自动向Chef Server注册,并根据您提供的命令行设置运行列表。 You can use similar arguments to set the environment or policy name if you are using those features. 如果使用这些功能,则可以使用类似的参数来设置环境或策略名称。
  3. Include the chef-client cookbook/recipe in that role to install Chef as a daemon on the machine and to remove the validator key. 包括chef-client cookbook / recipe,以将Chef作为守护程序安装在计算机上并删除验证程序密钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在opscode Chef中创建AWS vpc,子网,安全组? - How can I create AWS vpc, subnets, security groups in opscode chef? 如何有效地使用 AWS Autoscaling - How to use AWS Autoscaling Effectively 如何在Chef Opscode中使用idempotency来执行一次mount资源? - How can I use idempotency in Chef Opscode to execute a mount resource only once? 如何使用aws autoscaling根据自动扩展组的单个实例进行扩展? - How to use aws autoscaling to scale based on a single instance of a autoscaling group? 如何限制 AWS 自动缩放以不允许使用特定角色? - How to limit AWS autoscaling to not allow the use of a specific role? opscode AWS Cookbook IAM角色 - opscode aws cookbook iam role 我在哪里使用AWS :: AutoScaling :: LaunchConfiguration? - Where do I use AWS::AutoScaling::LaunchConfiguration? 如何使用 aws 自动缩放(ecs 或 beanstalk 或简单的自动缩放)在 django 中收集日志 - how to gather logs in django with aws autoscaling (ecs or beanstalk or simple autoscaling) AWS-获取与Capistrano一起使用的自动缩放名称 - AWS - get autoscaling names for use with Capistrano 配置munin服务器以用于AWS自动扩展? - Configuring munin server for use with AWS autoscaling?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM