سؤال

I've spent a few days just going over Elastic Beanstalk trying to identify the benefits of using this. I'm new to this service but also don't have much experience with EC2, so I'm really just trying to make sense of everything. My main objective is to have auto-scaling and Elastic seemed to make sense.

Last night, suddenly my existing instance terminated a new one was spun-up (automatically). Upon SSH'ing to this new instance, all my files were gone. I expected the volume to be replicated over?

I'm just not understanding what took place and why a instance was spun up and my other terminated - or more importantly, why the new instance didn't have my files.

Here is a log of what happened:

2013-12-26 23:03:23 UTC-0800    WARN    Environment health has transitioned from YELLOW to RED
2013-12-26 23:01:21 UTC-0800    WARN    Environment health has transitioned from GREEN to YELLOW
2013-12-26 23:01:21 UTC-0800    WARN    Elastic Load Balancer awseb-e-i-AWSEBLoa-K5TNOB5OZNKU has zero healthy instances.

2013-12-26 23:00:36 UTC-0800    INFO    Removed instance 'i-c75df99a' from your environment. (Reason: Instance is in 'shutting-down' state)

2013-12-26 22:55:14 UTC-0800    INFO    Adding instance 'i-4d46d010' to your environment.

2013-12-26 22:54:14 UTC-0800    INFO    Added EC2 instance 'i-4d46d010' to Auto Scaling Group 'awseb-e-ikszmdzite-stack-AWSEBAutoScalingGroup-TC41QI6DT3O0'.

Is this because I have 2 availability zones? I'm really confused.

Update

When I developed my Elastic Environment, I indicated that I wanted to use multiple availability zones. I then identified 2 zones to use. I indicated to use a minimum of 1 instance. I feel that this is where the problem happened -- I should have set the minimum to the same number of zones I identified. But I can't confirm except continued testing... Still looking for insight.

هل كانت مفيدة؟

المحلول

The storage on an EC2 instance is ephemeral, and is gone when that instance terminates. Rather than uploading your codebase to that specific instance manually, you should let Elastic Beanstalk do it for you. That way, you application's code base, including previous versions of it, are stored with Elastic Beanstalk, which is automatically deployed to new instances when they are spun up.

For example, for a PHP application, this link explains how it can be deployed using Elastic Beanstalk: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP_eb.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top