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개 답변
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
전문가
Peter_G
답변함 2년 전
  • 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

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠