Need help ! Issue with Auto Scaling for Application Load Balancer with 2 different instances for target groups

0

Hi All, I currently have an Application Load Balancer that has two rules :

If the request is coming from a specific path Example: /forum/, use a target group that points to an instance For any other request use this target group ( another instance ) In the autoscaling settings I have added these two target groups so that if autoscaling occurs and terminates the instances, they will be re-registered. This works correctly, however, I noticed that when termination happens the target group registers two instances instead of one and therefore my site looks broken. Is there a setting that I’m missing?

Thank you

1 Answer
0

If I understand your design correctly you should have two autoscaling groups and each autoscaling group use the same load balancer but different target groups. You'll also want to check your AutoScaling Policy (if you have set one) as this controls how the desired count is updated.....its possible you have enabled a policy which increments your count by 2

AWS
EXPERT
Peter_G
answered 2 years ago
  • Hello Peter, Thanks so much for your reply. I do have 2 ASGs, one for the main site and one for another forum site. However, I mostly use the main site Load balancer as the rules are located there ( if the path of /forum/* it uses the forum instance ( target group ). The reason this was set like this is that the forum site is accessed by the main site domain. ( For example www.example.com/forum ) The desired count is set to 1. Since I'm using the ALB of the main site only when the ASG terminates the instance, a new target is registered for the main site in the target group of the forum. My issue is that this target group should only register one instance and not 2 ( main site and forum )

  • Using Path based routing on an ALB is fine. Each ASG will have it's own instances. Do you want 1 instance total or 2 (1 for main site, 1 for forum)?

  • Hi Peter, my apologies for the late reply, didn't receive an email notification I want 2 instances, one for the main and one for the forum. Is there a setting in the ASG that when it terminates the instance it has pre-defined target instances ? Because my issue is that one of the target groups ( forum ) always reinstates the main site instead.

  • The desired count is always respected ie each ASG will need 1 healthy instance if your desired count is one. The next thing to check is the health check configured on your targetgroup if ELB healthchecks are enabled. It's possible the healthcheck is triggering on the main site but isn't specific to the forum targetgroup. See here

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions