Setting up an Application Load Balancer to 2 Tomcats on EC2

0

Good morning, I have 2 Tomcats running on an EC2 (Windows Server 2022). They are serving requests on the Private IP of the EC2 via ports 8080 and 8081 and I can get to both the Healthy Target URL and App from the EC2 instance itself. I have 2 Target groups created. One accepts HTTP inbound and the other accepts HTTPS inbound. The Healthy Target check is sent to <EC2 Host><8080> and <8081> (index.jsp) via HTTP for both LBs The app resides at <EC2 Host><8080>/myapp/index and <8081> <EC2 Host><8081>/myapp/index

I try to create a Load Balancer (listening on port 80) and when I try to select a Target, the list is empty and refresh doesn't populate the list. What am I missing? Does the subnet of the target group have anything to do with it? please advise. thanks Charlie D

已提问 7 个月前204 查看次数
1 回答
1
已接受的回答

Are you creating a new load balancer (ALB) and trying to configure it to the same target group that is already used for another ALB? If this is the case, you need to create a new target group (you can use the same targets as in other groups)

You can specify the same target group in multiple listeners, but these listeners must belong to the same Application Load Balancer. See https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-target-group.html

profile picture
专家
Kallu
已回答 7 个月前
profile picture
专家
已审核 8 天前
profile picture
专家
已审核 7 个月前
  • I have successfully created the LB listening on HTTP to redirect to the EC2 Tomcats at 8080 and 8081. My end goal is to listen on HTTPS on the LB and terminate the HTTPS at the LB and forward HTTP to the EC2. Do I need two LBs (one with a CERT) or can I do it with one LB listing on both 80 and 443? And if only 1 LB how do I import the CERT? thanks Charlie D

  • You can have multiple listeners (one for HTTP:80 and another for HTTPS:443) on the same load balancer. Cert is attached to listener so that is not a problem. ALB can also do HTTP->HTTPS redirect, so if any of your clients try to connect with HTTP, you can redirect them to HTTPS. This doesn't affect ALB-EC2 connection that can still be HTTP. https://aws.amazon.com/about-aws/whats-new/2018/07/elastic-load-balancing-announces-support-for-redirects-and-fixed-responses-for-application-load-balancer/

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则