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
專家
已審閱 7 天前
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/

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南