Posted at

AWS ElasticBeanstalk で Restart App Server と Rebuild Environmentすると何が起きるか

More than 3 years have passed since last update.


前提

この検証は下記の環境で実験しました。


  • 64bit Amazon Linux 2014.03 v1.0.2 running PHP 5.5


Restart App Server


結果


  • apacheが再起動される(apacheログから確認)

  • サーバーインスタンス自体は再起動しない。(サーバーのuptimeで確認)


実行ログ

2015-01-30 18:17:22 UTC+0900     INFO restartAppServer is starting.

2015-01-30 18:17:31 UTC+0900 INFO Restarted application server on all ec2 instances.


Rebuild Environment


結果



  • 下記が全部作りなおされた。


    • CloudWatch Alerm

    • EC2 Instance

    • Security Group

    • ELB

    • Auto Scaling group policy



  • OptionSettings で設定した、document_rootとか、ELBSubnets とかはそのまま残ってた。


  • アプリケーションももちろんzipからインスト−ルされたアプリ−ケーションが残ってた。



実行ログ

2015-01-30 18:37:19 UTC+0900    INFO    rebuildEnvironment is starting.

2015-01-30 18:37:29 UTC+0900 INFO Deleted CloudWatch alarm named: awseb-e-xxxx
2015-01-30 18:37:29 UTC+0900 INFO Deleted CloudWatch alarm named: awseb-e-xxxx
2015-01-30 18:37:32 UTC+0900 INFO Deleted Auto Scaling group policy named: arn:aws:autoscaling:xxx
2015-01-30 18:37:32 UTC+0900 INFO Deleted Auto Scaling group policy named: arn:aws:autoscaling:xxx
2015-01-30 18:37:34 UTC+0900 INFO Waiting for EC2 instances to terminate. This may take a few minutes.
2015-01-30 18:39:57 UTC+0900 INFO Deleted Auto Scaling group named: awseb-e-xxxx
2015-01-30 18:40:00 UTC+0900 INFO Deleted Auto Scaling launch configuration named: awseb-e-xxxx
2015-01-30 18:40:01 UTC+0900 INFO Deleted load balancer named: awseb-e-xxxx
2015-01-30 18:40:04 UTC+0900 INFO Deleted security group named: sg-xxxx
2015-01-30 18:40:38 UTC+0900 INFO Deleted security group named: sg-xxxx
2015-01-30 18:41:21 UTC+0900 INFO Created security group named: sg-xxxx
2015-01-30 18:41:26 UTC+0900 INFO Created load balancer named: awseb-e-xxxx
2015-01-30 18:41:41 UTC+0900 INFO Created security group named: sg-xxxx
2015-01-30 18:41:45 UTC+0900 INFO Created Auto Scaling launch configuration named: awseb-e-xxxx
2015-01-30 18:42:42 UTC+0900 INFO Created Auto Scaling group named: awseb-xxxx
2015-01-30 18:42:42 UTC+0900 INFO Waiting for EC2 instances to launch. This may take a few minutes.
2015-01-30 18:42:46 UTC+0900 INFO Created Auto Scaling group policy named: arn:aws:autoscaling:xxxx
2015-01-30 18:42:46 UTC+0900 INFO Created Auto Scaling group policy named: arn:aws:autoscaling:xxxx
2015-01-30 18:42:49 UTC+0900 INFO Created CloudWatch alarm named: awseb-e-xxxx
2015-01-30 18:42:50 UTC+0900 INFO Created CloudWatch alarm named: awseb-e-xxxx
2015-01-30 18:49:15 UTC+0900 INFO Added EC2 instance 'i-xxxx' to Auto Scaling Group 'awseb-xxxx'.
2015-01-30 18:49:28 UTC+0900 INFO Successfully rebuilt environment: xxxx```