2

我正在尝试我的第一个 Elastic Beanstalk 配置,但它失败了这就是我所做的:

mkdir .ebextensions
vi 01installation.config

配置:

packages:
    apt:
        apache2: []
        libapache2-mod-wsgi: []
        git: []
        apache2-threaded-dev: []

commands:
  01_download_apache_mod_dumpost:
      command: sudo git clone https://github.com/danghvu/mod_dumpost.git
  02_command:
      command: alias apxs2=apxs
  03_change_log_level:
      command: sudo sed -i 's/LogLevel warn/LogLevel debug/' /etc/apache2/apache2.conf
  04a_install_mod_dumpost:
      command: sudo make
  04b_install_mod_dumpost:
      command: sudo make install

接下来我下载AWS-Elastic-Beanstalk-CLI并创建了一个别名 eb:

alias eb="python2.7 ~/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python2.7/eb"

比在我的工作目录中所做的:

git init .
git add .
git commit -m "Initital setup"

比没有:

eb init
eb start

在 CLI 中回答了所有问题后,我得到了这个:

Waiting for environment "workerbeanstalk-env" to launch.
2013-07-31 10:25:27 INFO    createEnvironment is starting.
2013-07-31 10:25:33 INFO    Using elasticbeanstalk-us-east-xxxxxxxxxxx as Amazon S3 storage bucket for environment data.
2013-07-31 10:25:52 INFO    Created load balancer named: xxxxxxxxxxxxxxxx
2013-07-31 10:26:13 INFO    Created security group named: xxxxxxxxxxx4
2013-07-31 10:26:17 INFO    Created Auto Scaling launch configuration named: xxxxxxxxxxxxxxx
2013-07-31 10:27:15 INFO    Created Auto Scaling group named: xxxxxxxxxxxxxxxxx
2013-07-31 10:27:15 INFO    Waiting for EC2 instances to launch. This may take a few minutes.
2013-07-31 10:27:19 INFO    Created Auto Scaling group policy named: arn:aws:autoscaling:us-east-xxxxxxxxxxxxxxx:scalingPolicy:xxxxxxxxxxxxxxxxxx:autoScalingGroupName/xxxxxxxxxxxxxx-AWSEBAutoScalingGroup-xxxxxxxxxxxxx:policyName/xxxxxxxxxxxxk-AWSEBAutoScalingScaleDownPolicy-xxxxxxxxx
2013-07-31 10:27:19 INFO    Created Auto Scaling group policy named: arn:aws:autoscaling:us-east-1:xxxxxxxxxx:scalingPolicy:xxxxxxxxxxxxxxx:autoScalingGroupName/xxxxxxxxxx-stack-AWSEBAutoScalingGroupxxxxxxxxxxxxxxxxx:policyName/awseb-xxxxxxxxxxx-stack-AWSEBAutoScalingScaleUpPolicyxxxxxxxxxxxxxxxx
2013-07-31 10:27:23 INFO    Created CloudWatch alarm named: awsebxxxxxxxxxx-AWSEBCloudwatchAlarmLow-xxxxxxxxxxxx
2013-07-31 10:27:23 INFO    Created CloudWatch alarm named: awseb-xxxxxxxxxxk-AWSEBCloudwatchAlarmHigh-xxxxxxxxxxxxxxxxxxx
2013-07-31 10:29:32 ERROR   Responses from [i-32xxxxx3] were received, but the commands failed.
2013-07-31 10:30:39 INFO    Successfully launched environment: workerbeanstalk-env

最后一行显示它已启动,但 Helath 检查显示为红色。我尝试通过 SSH 连接到实例以检查已安装或下载的内容,但显然没有运气,因为我没有提供密钥对,(如果有人能帮我弄清楚在哪里指定密钥对也会很棒)所以主要问题我做错了什么,为什么它没有启动?

4

1 回答 1

1

关于您的问题-如果有人可以帮助我弄清楚在哪里指定密钥对也会很棒

当您使用 Elastic Beanstalk 时,最简单的方法是通过 EBS 控制台 - “配置”屏幕。

在“Instances”的设置下(单击右侧的齿轮),有“EC2 Key pair”字段。
如果没有列出,您必须在 EC2 菜单 - 网络和安全 -> 密钥对中创建一对

于 2013-08-05T15:42:38.020 回答