在AWS Elastic Beanstalk(EB)上玩环境时,我注意到
创建
不变部署
到相同的环境(使用完全相同的应用程序版本)。
3分钟
与
14分钟
,分别在环境卫生“还可以”之前
有人能解释一下吗?
-
使用EB(web)管理控制台创建一个新的单实例环境,使用默认的Python/amazonlinux和默认的示例应用程序。在开始创建环境之前,默认配置只更改为将部署策略设置为“不可变”,而不是“一次全部”。这需要大约。
3分钟
2018-10-17 12:14:17 UTC+0200 INFO Environment health has transitioned from Pending to Ok. Initialization completed 33 seconds ago and took 3 minutes.
2018-10-17 12:13:39 UTC+0200 INFO Successfully launched environment: create-vs-deploy
-
14分钟
:
2018-10-17 12:36:16 UTC+0200 INFO Environment health has transitioned from Info to Ok. Application update completed 67 seconds ago and took 14 minutes.
后续部署也是如此,定制应用程序版本的结果也类似。
eb-activity.log
两个实例的文件都有相同的命令和输出,以及从开始到结束的持续时间
Application deployment - Command CMD-Startup succeeded
也几乎相同:都略超过1分钟。
然后,不可变部署的日志会显示6分钟后开始的其他行:
[2018-10-17T10:22:10.227Z] INFO [2269] - [Initialization] : Starting activity...
...
[2018-10-17T10:23:21.610Z] INFO [2620] - [Application deployment Sample Application@2/AddonsAfter] : Completed activity.
[2018-10-17T10:23:21.610Z] INFO [2620] - [Application deployment Sample Application@2] : Completed activity. Result:
Application deployment - Command CMD-Startup succeeded
[2018-10-17T10:29:58.110Z] INFO [3055] - [Re-associating instance] : Starting activity...
...
[2018-10-17T10:29:58.115Z] INFO [3055] - [Re-associating instance] : Completed activity. Result:
Re-associating instance - Command CMD-ImmutableDeploymentFlip succeeded
你知道在6分钟的停顿中发生了什么吗?EB是否每次等待健康检查6分钟?
电子商务活动日志
,以及事件页面报告的14分钟。
不确定是否有用,但这是从
healthd/daemon.log
对于不可变部署:
# Logfile created on 2018-10-17 10:22:04 +0000 by logger.rb/47272
A, [2018-10-17T10:22:05.218449 #2186] ANY -- : healthd daemon 1.0.3 initialized
W, [2018-10-17T10:22:05.369315 #2186] WARN -- : log file "/var/log/httpd/healthd/application.log.2018-10-17-10" does not exist
...
W, [2018-10-17T10:23:16.646199 #2186] WARN -- : log file "/var/log/httpd/healthd/application.log.2018-10-17-10" does not exist
W, [2018-10-17T10:36:55.231184 #2186] WARN -- : discarding statistic item after validation error (Invalid timestamp): {:id=>"0", :namespace=>"application", :timestamp=>1539771800, :data=>"{\"duration\":10,\"latency_histogram\":[[0.213,1]],\"http_counters\":{\"status_200\":1,\"request_count\":1}}"}
新创建的环境文件的日志看起来与最后一行相同。
其他信息:
根据下面的事件(同一个应用程序在不同的时间部署),我假设新实例在应用程序更新开始后占用大约12分钟,然后旧实例被终止等等。
2018-10-17 14:29:07 UTC+0200 INFO Environment health has transitioned from Info to Ok. Application update completed 37 seconds ago and took 13 minutes.
2018-10-17 14:28:38 UTC+0200 INFO Environment update completed successfully.
2018-10-17 14:28:38 UTC+0200 INFO New application version was deployed to running EC2 instances.
2018-10-17 14:28:07 UTC+0200 INFO Removed instance [i-0*******] from your environment.
2018-10-17 14:26:25 UTC+0200 INFO Deployment succeeded. Terminating old instances and temporary Auto Scaling group.
2018-10-17 14:24:36 UTC+0200 INFO Waiting for post-deployment configuration to complete.
2018-10-17 14:24:31 UTC+0200 INFO Starting post-deployment configuration on new instances.
2018-10-17 14:23:31 UTC+0200 INFO Attached new instance(s) to the permanent auto scaling group awseb-e-******-stack-AWSEBAutoScalingGroup*****.
2018-10-17 14:23:29 UTC+0200 INFO Detached new instance(s) from temporary auto scaling group awseb-e-******-immutable-stack-AWSEBAutoScalingGroup*****.
2018-10-17 14:19:32 UTC+0200 INFO Waiting for instance(s) (i-0******) to pass health checks.
2018-10-17 14:17:08 UTC+0200 INFO Added instance [i-0******] to your environment.
2018-10-17 14:17:08 UTC+0200 INFO Environment health has transitioned from Ok to Info. Application update in progress on 1 instance. 0 out of 1 instance completed (running for 2 minutes).
2018-10-17 14:15:19 UTC+0200 INFO Created temporary auto scaling group awseb-e-*****-immutable-stack-AWSEBAutoScalingGroup-*******.
2018-10-17 14:14:33 UTC+0200 INFO Immutable deployment policy enabled. Launching one instance with the new settings to verify health.
2018-10-17 14:14:24 UTC+0200 INFO Environment update is starting.