You can add a server pool to manage and share back-end servers flexibly and efficiently. A server pool manages load balancer distribution methods and has a service monitor attached to it for health check parameters.
Procedure
- Log in to the vSphere Web Client.
- Click Networking & Security > NSX Edges.
- Double-click an NSX Edge.
- Click Manage > Load Balancer > Pools.
- Click Add.
- Type a name and description for the load balancer pool.
- Select the algorithm balancing method for each enabled service.
Option Description IP-HASH Selects a server based on a hash of the source IP address and the total weight of all the running servers.
Algorithm parameters are disabled for this option.
LEASTCONN Distributes client requests to multiple servers based on the number of connections already on the server.
New connections are sent to the server with the fewest connections.
Algorithm parameters are disabled for this option.
ROUND_ROBIN Each server is used in turn according to the weight assigned to it.
This is the smoothest and fairest algorithm when the server's processing time remains equally distributed.
Algorithm parameters are disabled for this option.
URI The left part of the URI (before the question mark) is hashed and divided by the total weight of the running servers.
The result designates which server receives the request. This ensures that a URI is always directed to the same server if no server goes up or down.
The URI algorithm parameter has two options uriLength=<len> and uriDepth=<dep>. The length parameter range should be 1<=len<256. The depth parameter range should be 1<=dep<10.
Length and depth parameters are followed by a positive integer number. These options can balance servers based on the beginning of the URI only. The length parameter indicates that the algorithm should only consider the defined characters at the beginning of the URI to compute the hash.
The depth parameter indicates the maximum directory depth to be used to compute the hash. One level is counted for each slash in the request. If both parameters are specified, the evaluation stops when either is reached.
HTTPHEADER HTTP header name is looked up in each HTTP request.
The header name in parentheses is not case-sensitive, which is similar to the ACL 'hdr()' function. If the header is absent or does not contain any value, the round robin algorithm is applied.
The HTTPHEADER algorithm parameter has one option headerName=<name>. For example, you can use host as the HTTPHEADER algorithm parameter.
URL URL parameter specified in the argument is looked up in the query string of each HTTP GET request.
If the parameter is followed by an equal sign = and a value, then the value is hashed and divided by the total weight of the running servers. The result designates which server receives the request. This process is used to track user identifiers in requests and ensure that a same user ID is always sent to the same server as long as no server goes up or down.
If no value or parameter is found, then a round robin algorithm is applied.
The URL algorithm parameter has one option urlParam=<url>.
- (Optional) Select an existing default or custom monitor from the Monitors drop-down menu.
- (Optional) Select the type of IP traffic for the pool. Default is any IP traffic.
- To make client IP addresses visible to the back-end servers, enable the Transparent option. For more details, see Logical Load Balancer.
If Transparent is not selected (default value), back-end servers see the traffic source IP address as a load balancer internal IP address. If Transparent is selected, the source IP address is the real client IP address and NSX Edge must be set as the default gateway to ensure that return packets go through the NSX Edge device.
- Add members to the pool.
- Click Add.
- Enter the name and IP address of the server member or click Select to assign grouping objects.
Note: VMware Tools must be installed on each VM, or an enabled IP discovery method (DHCP snooping or ARP snooping, or both) must be available when using grouping objects instead of IP addresses. For more details, see IP Discovery for Virtual Machines.The grouping objects can either be vCenter Server or NSX.
- Select the member state as Enable, Disable, or Drain.
- Drain - Forces the server to shut down gracefully for maintenance. Setting the pool member as "drain" removes the back-end server from load balancing, while allowing it to be used for exiting connections and new connections from clients with persistence to that server. The persistence methods that work with a drain state are source IP persistence, cookie insert, and cookie prefix.
Note: Drain state cannot be enabled on an NSX Edge load balancer that has been configured with Enable Acceleration. See Configure Load Balancer Service for more information.Note: Enabling and disabling High Availability configuration on the NSX Edge can break the persistence and drain state with source IP persistence method.
- Enable - Removes the server from maintenance mode and brings it back into operation. The pool member state should either be Drain or Disabled.
- Disable - The server remains in maintenance mode.
Note: You cannot change the pool member state from Disabled to Drain.
- Drain - Forces the server to shut down gracefully for maintenance. Setting the pool member as "drain" removes the back-end server from load balancing, while allowing it to be used for exiting connections and new connections from clients with persistence to that server. The persistence methods that work with a drain state are source IP persistence, cookie insert, and cookie prefix.
- Enter the port where the member is to receive traffic, and the monitor port where the member is to receive health monitor pings.
Port value should be null if the related virtual server is configured with a port range.
- In Weight, enter the proportion of traffic this member can handle .
- Enter the maximum number of concurrent connections that the member can handle.
If the incoming requests go higher than the maximum, they are queued and wait for a connection to be released.
- Enter the minimum number of concurrent connections that a member must always accept.
- Click OK.
- Click Add or OK.