How to add more instances (scale up) ElasticBeanStalk environment programmatically within a running application (Spring Boot) ?
I thought of using AWSElasticBeanstalkClient, but couldn't find any method to add instances using the client.
http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/elasticbeanstalk/AWSElasticBeanstalkClient.html
Any hints?
I need this because the design of my applications is that each App node needs to communicate with each other to perform some image-recognition tasks.
If this is not possible with EBS, I was thinking of creating EC2 programmatically as mentioned below, my problem is how to deploy my application to newly created EC2 instance.
http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/run-instance.html
You can configure Amazon EC2 Auto Scaling to monitor and automatically respond to changes that affect the availability of your Spot Instances by enabling Capacity Rebalancing. Auto Scaling monitors the health of each Amazon EC2 instance that it launches.
Use option settings You can use Elastic Beanstalk configuration files to set environment properties and configuration options in your source code. To define environment properties, use the aws:elasticbeanstalk:application:environment namespace.
The Auto Scaling group in your Elastic Beanstalk environment uses two Amazon CloudWatch alarms to trigger scaling operations. The default triggers scale when the average outbound network traffic from each instance is higher than 6 MB or lower than 2 MB over a period of five minutes.
Cloudwatch alarms + AutoScaling is the AWS Reference architecture for scaling your ElasticBeanstalk applications.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.as.html
You can have each app node publish custom cloudwatch metrics and scale your ASG based on that.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With