A target group is a group of instances to which the load balancer directs application traffic. Instances in this group work together to process the tasks required by the application.
Creating a Target Group
To create a target group:
Go to the main page > Load Balancing > Target Groups.
A list of currently defined target groups will be displayed.
To create a new target group, click "+ Create" on the top toolbar.
A dialog window titled "Create Target Group" will open.
In the "Details" tab, enter the following:
Name: The name of the new target group.
Description: An optional description for the new target group.
Protocol: Select the protocol used by the load balancer to access the target group.
HTTP: For an Application Load Balancer (ALB).
TCP: For a Network Load Balancer (NLB).
Default Port: The port used by the load balancer to connect to this target group.
Sticky Session: By default, the load balancer directs each request independently to the registered instance in the target group with the least load. However, you can use the sticky session feature to bind a user's session to a specific instance. This ensures that all requests from a user during a session are sent to the same instance.
Duration: If sticky sessions are selected, enter the session duration in seconds, during which the load balancer will consistently direct a user's requests to the same virtual machine instance.
Click Next.
The "Health Check" tab configurations are used by the load balancer to determine the health of the target.
Port:
Traffic Port: The connection for the health check will be established on the port where the target accepts incoming traffic.
Custom: The connection for the health check will be established on the specified port for all targets in the group.
Enter the custom port number.
Interval: The interval in seconds between health checks of an individual virtual machine instance.
Minimum: 5 seconds.
Maximum: 300 seconds.
Timeout: The time in seconds after which the absence of a response indicates a failed health check. The value should be less than the maximum interval value.
Minimum: 2 seconds.
Maximum: 60 seconds.
Health Threshold: The number of consecutive successful health checks required to transition the virtual machine instance to a healthy state.
Minimum: 2 seconds.
Maximum: 10 seconds.
Unhealthy Threshold: The number of consecutive failed health checks required to transition the virtual machine instance to an unhealthy state.
Minimum: 2 seconds.
Maximum: 10 seconds.
HTTP Health Check: To configure a health check using the HTTP protocol, set the following:
Path: The ping path used by the load balancer to check the health of virtual machine instances in the target group.
HTTP Code(s): The HTTP response codes for the health check that indicate a successful health check and, consequently, the health of the target.
The following formats are supported:
A single HTTP success code, e.g., 200.
Multiple HTTP success codes separated by commas, e.g., 200,301.
A range of HTTP success codes, specified with a “-” between the first and last code in the range, e.g., 200-399.
Click Next.
On the "Targets" tab, add targets to the group.
Target Type: Select the target type, click "Add", and enter the target parameters.
All targets in the target group must be of the same target type.
The following target types are supported:
Example:
Enter the parameters for an instance target type:
Select Target Virtual Machine: From the dropdown list, select the target virtual machine instance.
Port: Specify the port number on the target device for communication with the load balancer.
IP Address:
Enter the parameters for the IP target type:
IP: Enter the IP address of the target, which is within your region and accessible from the load balancer.
Port: Specify the port number on the target device for communication with the load balancer.
To configure additional targets in the target group, click "Add" and enter the target parameters according to the target type.
Click Done.
Get a consultation from a manager!
Do you need to clarify the details? Discuss the requirements? Do you have a difficult project? We will help you find the right solution.