简体   繁体   English

在环境中使用Chef&Knife在Amazon VPC中引导EC2实例

[英]Bootstrapping EC2 instances in an Amazon VPC using Chef & Knife in an environment

I got my Chef Server and Chef workstation configured on an AWS VM running Centos. 我在运行Centos的AWS VM上配置了Chef Server和Chef工作站。 I downloaded the chef-repo from GitHub as per the instructions. 我按照说明从GitHub下载了Chef-repo。 I downloaded the keys from my Chef Server. 我从Chef服务器下载了密钥。 I also had keys from Amazon to use their EC2 API (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY). 我还从Amazon获得了使用其EC2 API的密钥(AWS_ACCESS_KEY_ID和AWS_SECRET_ACCESS_KEY)。 I also created a key at Amazon for use with the instance (test.pem). 我还在亚马逊上创建了一个与实例一起使用的密钥(test.pem)。 All the keys are in ~chef-repo/.chef/ and in ~/.ssh/. 所有键都在〜chef-repo / .chef /和〜/ .ssh /中。 I am trying to bootstrap an existing ec2 instance in a specific environment and under a specific role. 我正在尝试在特定环境和特定角色下引导现有的ec2实例。

I have used the following command: 我使用了以下命令:

knife bootstrap Server_IP --ssh-user root --sudo --identity-file ~/.ssh/test.pem --environment testing --node-name Centos_Node --run-list 'role[web_server]'

This command adds the node to the default environment. 此命令将节点添加到默认环境。

Please help me to resolve the issue. 请帮助我解决问题。

NOTE: VPC does not have an internet gateway . 注意:VPC没有Internet网关

I am following this link : 我正在关注此链接:

http://clarkdave.net/2013/05/creating-ec2-instances-in-an-amazon-vpc-using-chef-and-knife/ http://clarkdave.net/2013/05/creating-ec2-instances-in-an-amazon-vpc-using-chef-and-knife/

An EC2 instance in a VPC requires more infrastructure than a standalone EC2 instance (one that is not contained within a VPC). 与独立EC2实例(VPC中不包含的EC2实例)相比,VPC中的EC2实例需要更多的基础结构。 For example, you will need subnets, routes, route tables, security groups, a gateway, and potentially one or more NAT servers. 例如,您将需要子网,路由,路由表,安全组,网关以及可能的一个或多个NAT服务器。

All EC2 instance weather you choose a VPC or not comes with a VPC the default VPC. 无论您选择VPC还是不选择VPC,所有EC2实例均随默认VPC一起提供。 I don't think there is a choice of creating a EC2 instance without a VPC 我不认为没有VPC可以创建EC2实例

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM