AWS Elastic Beanstalk Degrades every time I update – Stays down

amazon-web-servicesaws-clielastic-beanstalk

When I update my instance, I use the EB Command Line Tools. I push my instance to my CodeCommit git, and then deploy my code using the eb deploy command. Nearly every time I do this, my envronment status changes to degraded/severe with the instance that is running giving the error Following services are not running: proxy. It will spin up more instances based on my auto scaling policy (tied to health), and sometimes after 2-3 new instances, I will get one that is "OK"

My environment is configured as 64bit Amazon Linux 2016.09 v2.2.0 running PHP 7.0. It is auto load balancing and auto scaling on average netowrk out. It is running t1.micro in Any availability zone, and the software configuration is as follows: Log publication: On;
Allow URL fopen: On;
Display errors: Off;
Document root: /http/;
Max execution time: 60;
Memory limit: 256M;
Zlib output compression: Off;

What could cause this?

Best Answer

Check in your /opt/elasticbeanstalk/hooks/appdeploy/post/01_monitor_httpd_pid.sh. Note that 01_monitor_httpd_pid.sh might have a different name for you.

In there you need to change your proxy check if you're not using apache/httpd to nginx, like so:

#!/bin/bash
set -xe
/opt/elasticbeanstalk/bin/healthd-track-pidfile --proxy nginx

If you are using apache/httpd, it means that there's something wrong with your apache runtime instance or process. Make sure the pid file is where is should be for the health check.

Related Topic