2 Answers
- Newest
- Most votes
- Most comments
1
I updated the configuration this way: Switched from network LB to app LB. Configured the health check properly for ALB so that it is the same as the check for autoscaling. See the documentation about ALB configuration.
This way now my autoscaling removes an unhealthy instance and starts a new healthy one.
1
The behavior you're experiencing with your Elastic Beanstalk (EB) environment is not typical, and there are several steps you can take to address this issue:
1. Auto Scaling: Elastic Beanstalk uses Auto Scaling to maintain application availability. By default, it should replace unhealthy instances. Check your Auto Scaling group settings to ensure they're configured correctly.
2. Health Checks: Verify that your application's health check URL is properly configured. If the health check is not set up correctly, EB may not accurately detect when an instance is unhealthy.
3. Instance Recovery: In cases where an instance becomes unresponsive, EB should typically attempt to recover or replace it. The fact that this isn't happening suggests there might be an underlying issue with your environment's configuration.
4. Manual Intervention: While EB is designed to handle many scenarios automatically, there are times when manual intervention is necessary. In your case, you may need to terminate the unhealthy instance manually and allow EB to launch a new one.
5. Environment Rebuild: If the issue persists, consider rebuilding your environment. This process terminates all resources and replaces them with new ones while preserving the same configuration.
6. Monitoring and Logs: Check the EB console for any error messages or events that might explain why the environment isn't behaving as expected. The environment's logs can provide valuable insights into what's happening behind the scenes.
7. AWS Support: If you've tried these steps and are still experiencing issues, it may be worth contacting AWS Support for further assistance.
Elastic Beanstalk is generally a reliable service, but like any complex system, it can sometimes encounter issues. The key is to ensure proper configuration and to have monitoring and alerting in place to catch and respond to problems quickly.
To improve your environment's resilience in the future, consider:
- Implementing custom CloudWatch alarms to alert you of issues
- Using multiple Availability Zones for high availability
- Regularly testing your application's ability to scale and recover from instance failures
Remember, while EB aims to automate many aspects of application deployment and scaling, it's still important to understand its behavior and be prepared to troubleshoot when necessary.
Sources
Troubleshooting Elastic Beanstalk - Categories and FAQs - AWS Elastic Beanstalk
Rebuilding Elastic Beanstalk environments - AWS Elastic Beanstalk
AWS Elastic Beanstalk Product Details - Amazon Web Services (AWS)
Relevant content
asked 2 years ago
asked 2 years ago
