An Edge Gateway
can provide load-balancing services that allow you to distribute incoming
requests to a specific external IP address across multiple internal IP
addresses. Several load-balancing algorithms are supported.
A load balancer service
provides load balancing for TCP, HTTP, and HTTPS traffic. The load balancer
accepts incoming IP requests on an external or internal interface, and uses the
algorithm you specify to distribute requests across a pool of servers.
To add a load-balancer service
to an Edge Gateway, include a
LoadBalancerService
element in the Edge Gateway's
EdgeGatewayServiceConfiguration.
Example: Load Balancer
Service
This fragment of an
EdgeGatewayServiceConfiguration
defines a
LoadBalancerService
that accepts incoming requests at external address
https://192.168.1.100 and balances them across two
servers at internal addresses
10.200.100.10 and
10.200.100.11. The following elements define a
LoadBalancerService:
■
|
A
Pool that contains
ServicePort and
Member elements. A
LoadBalancerService
must include a
Pool that defines a
ServicePort for each
protocol on which the load balancer handles incoming requests. You can define
up to three
ServicePort elements,
one for each supported protocol (HTTP, HTTPS, TCP). This load balancer handles
only HTTPS requests, so it requires only one
ServicePort element in
its
Pool.
You must specify one of
the following load-balancing algorithms in the
Algorithm element of
the
ServicePort.
IP_HASH
|
Selects a server
based on a hash of the source and destination IP address of each packet.
|
LEAST_CONN
|
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.
|
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.
|
URI
|
The request URL is
hashed and divided by the total weight of the running servers. (If the request
URL includes a query, it is discarded, and only the fragment of the URL to the
left of the ? is considered.) The result designates which server receives the
request, ensuring that a request is always directed to the same server as long
as all servers remain available.
|
The
Pool in this example
also defines an optional
HealthCheck element
that specifies parameters used for periodic verification that all pool members
are responding to requests.
Each
Member element in the
Pool specifies the
IpAddress of a virtual
machine that provides the service being requested. Incoming requests are
balanced across all members of the pool. Because the
Algorithm specified for
this Pool is
ROUND_ROBIN, each
Member must be assigned
a
Weight.
|
■
|
A
VirtualServer element
that defines the
Interface, an internal
or external interface defined by the containing
EdgeGateway, on which
requests are accepted. The network referenced in the
Interface element must
be configured with an IP sub-allocation.
|
Note
Each
Member of a load
balancer
Pool
can contain its own
ServicePort element. If
this element is present in a
Member, its contents
override the
ServicePort element of
the Pool.
For more information about
LoadBalancerService
elements and attributes, see the schema reference.
<LoadBalancerService>
<IsEnabled>true</IsEnabled>
<Pool>
<Name>HTTPS_pool</Name>
<ServicePort>
<IsEnabled>true</IsEnabled>
<Protocol>HTTPS</Protocol>
<Algorithm>ROUND_ROBIN</Algorithm>
<Port>443</Port>
<HealthCheck>
<Mode>TCP</Mode>
<HealthThreshold>2</HealthThreshold>
<UnhealthThreshold>3</UnhealthThreshold>
<Interval>5</Interval>
<Timeout>15</Timeout>
</HealthCheck>
</ServicePort>
<Member>
<IpAddress>10.200.100.10</IpAddress>
<Weight>1</Weight>
</Member>
<Member>
<IpAddress>10.200.100.11</IpAddress>
<Weight>1</Weight>
</Member>
</Pool>
<VirtualServer>
<IsEnabled>true</IsEnabled>
<Name>Example Virtual Server</Name>
<Description>Incoming LoadBalancerService Requests</Description>
<Interface
type="application/vnd.vmware.vcloud.orgVdcNetwork+xml"
href="https://vcloud.example.com/api/admin/network/199" />
<IpAddress>192.168.1.100</IpAddress>
<ServiceProfile>
<IsEnabled>true</IsEnabled>
<Protocol>HTTPS</Protocol>
<Port>443</Port>
<Persistence>
<Method>SSL_SESSION_ID</Method>
</Persistence>
</ServiceProfile>
<Logging>true</Logging>
<Pool>HTTPS_pool</Pool>
</VirtualServer>
</LoadBalancerService>
To add this service to an Edge
Gateway, include it in an
EdgeGatewayServiceConfiguration.
See
Example: Configure Services on
an Edge Gateway.