A development team is using Java/Tomcat to build up a new feature for an IOT project.
They decided to create a new autoscaling group using a launch configuration that contained the latest AMI.
And then they attached the new autoscaling group to the existing Classic ELB with a HTTP health check.
After ELB passed the health check, they removed the old autoscaling group.
Using this way, they were trying to implement the Blue/Green deployment.
However, they found that the new autoscaling did not service properly and there were lots of Tomcat errors.
Which below action should be done to reduce Tomcat errors?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer -
Option A.
We should use ELB health check to know when we should start sending traffic to a new set of instances.
For Java apps running on Tomcat, even when the EC2 instance has finished its boot sequence, there is so much that can happen at the application level before the app is ready for traffic - initializing data structures, reading configuration, configuring logging, warming a cache.
The user should create an endpoint/page in the application and let it tell you when it is ready to receive traffic.
The classic HTTP health check is able to ping this new page and understand when the new instances are truly ready to service traffic.
Option B is incorrect: because classic HTTP ELB health check is able to meet the need.
Option C is incorrect: because classic HTTP ELB health check is able to meet the need.
Option D is incorrect because ELB health check should be used to avoid any manual check on the instance status.
The issue described in the question is related to a Blue/Green deployment strategy that the development team is trying to implement. In this strategy, a new autoscaling group is created with the updated application code and attached to an existing Classic ELB using a HTTP health check. Once the health check passes, the old autoscaling group is removed to complete the deployment.
However, the new autoscaling group is not servicing properly, and there are Tomcat errors reported. To reduce these errors, the following actions can be taken:
A. The health check is not accurate. The Classic ELB health check should point to an endpoint or a webpage in the application to indicate when the instances are ready to receive traffic.
The Classic ELB health check used by the development team is checking if the instance is responding to a simple HTTP request. This approach may not be accurate enough to determine if the application is ready to receive traffic. It is recommended to use a health check that checks the endpoint or a webpage in the application that indicates if the application is ready.
B. The health check is not configured properly. The Classic ELB should be replaced using an application load balancer, and the HTTPS health check is required.
The Classic ELB is a basic load balancer that may not be suitable for more complex applications. An application load balancer (ALB) provides advanced features and can check the application status, which can reduce errors during deployment. Additionally, using HTTPS for the health check can improve security and provide better results.
C. The Classic ELB or network ELB cannot meet the need. The application load balancer should be used as it is able to check the application status. In this case, the application is not ready yet when the ELB health check passed.
If the Classic ELB or Network Load Balancer (NLB) cannot meet the requirements of the application, an ALB should be used instead. The ALB can check the application status and ensure that the application is ready before traffic is sent to the new autoscaling group.
D. After the new autoscaling group is created, wait for a longer time firstly so that the instances are ready to service the traffic. Then attach the autoscaling group to the ELB.
Waiting for a longer time before attaching the new autoscaling group to the ELB can help ensure that the instances are ready to receive traffic. This can reduce Tomcat errors and improve the overall deployment process.
In summary, to reduce Tomcat errors during a Blue/Green deployment using Java/Tomcat, it is recommended to use a more accurate and reliable health check, such as an ALB with an HTTPS health check, that checks the application status. Additionally, waiting for a sufficient time after creating the new autoscaling group can also help ensure that the instances are ready to receive traffic.