Given I have healthy working production enviroment set up via AWS Elastic Beanstalk running 3 EC2 instances load balanced by ELB. (EC2 instances are Docker containers)

When I clone the EB environment to new EB environment newproduction-2

Then new environment is successfully cloned, all EC2 instances are working (if I access EC2 public IP/DNS page is rendered the page I need)

BUT the load balancer url is returning blank page AND production-2 Load Balancer is complaining that 0 of 3 instances are healthy (Severe instances)

AWS EB load balancer is only forwarding requests to the instances that it consider as "healthy" (in order to avoid to returning 500 pages when EC2 instance dies).

The way how load balancer achieves this is that it pings your server instances agreed path, whether they respond with 2xx (200, 201, ...)

By default each time you clone Elastic Beanstalk environment the default is something like /healcheck.html. So if your EC2 instance server doesn't respond to this path (e.g. doesn't have that file) it consider the EC2 server instance un-healthy

Therefore either create this file (so that my-ec2-public-dns.elasticbeanstalk.com/healthcheck.html exist)

...or (better) change this path to / or something that is valuable for your business. in AWS console go to EC2 > Load Balancer (in left panel menu) > click on your load-balancer > health check > edit and change the Ping Target HTTP:80/healthcheck to Ping Target HTTP:80/

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.