简体   繁体   中英

Elastic Beanstalk checking health too soon after launching instance

I'm having problems with the configuration of an Elastic Beanstalk environment. Almost immediately, within maybe 20 seconds of launching a new instance, it's starts showing warning status and reporting that the health checks are failing with 500 errors.

I don't want it to even attempt to do a health check on the instance until it's been running for at least a couple of minutes. It's a Spring Boot application and needs more time to start.

I have an.ebextensions/autoscaling.config declared like so...

Resources:
  AWSEBAutoScalingGroup:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      HealthCheckType: ELB
      HealthCheckGracePeriod: 200
      DefaultInstanceWarmup: 200
      NewInstancesProtectedFromScaleIn: false
      TerminationPolicies:
        - OldestInstance

I thought the HealthCheckGracePeriod should do what I need, but it doesn't seem to help. EB immediately starts trying to get a healthy response from the instance.

Is there something else I need to do, to get EB to back off and leave the instance alone for a while until it's ready?

The HealthCheckGracePeriod is the correct approach. The service will not be considered unhealthy during the grace period. However, this does not stop the ELB from sending the healthchecks according to the defined (or default) health check interval . So you will still see failing healthchecks, but they won't make the service be considered "unhealthy".

There is no setting to prevent the healthcheck requests from being sent at all during an initial period, but there should be no harm in the checks failing during the grace period.

You can make the HealthCheckIntervalSeconds longer, but that will apply for all healthcheck intervals, not just during startup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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