Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scale up ElasticBeanStalk environment programmatically

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

like image 428
Ashika Umanga Umagiliya Avatar asked Oct 14 '17 05:10

Ashika Umanga Umagiliya


People also ask

Does Elastic Beanstalk automatically scale?

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.

How do you update environment variables in Elastic Beanstalk?

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.

How do you trigger Auto Scaling?

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.


1 Answers

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

like image 67
strongjz Avatar answered Oct 07 '22 23:10

strongjz