logo
Published on

Load Balancer Port

Authors
  • avatar
    Name
    Bowen Y
    Twitter

QUESTION

There are four ports can be configured in load-balancer related settings.

  1. The port of the listener
  2. The port of the target group
  3. The port of the target group health checking
  4. The port of the instance in the target group

So what is the meaning of the port of the target group?

ANSWER

  1. The port of the listener is used to receive all the incoming requests and data sent to the load-balancer through that port.

  2. The port of the target group health checking is used to send health checking request to the instances in that target group.

  3. The port of the instance is used to receive all the incoming requests sent to the instance from the target group(transmitted by the listener rule)

So, it seems like the port of the target group is meaningless. Yes and no, the target group is required during the target group initilization process and cannot be omitted. But it only serves as the default value of all the instances attached to that target group, which means you can omit the port of the instance when it is added to the target group. Once you set the port of the instance explicitly, the port of the target group for that instance is overwritten and ignored, but still useful for all other instances without explict ports.

Reference

https://stackoverflow.com/questions/42715647/whats-the-target-group-port-for-when-using-application-load-balancer-ec2-con