
VMware, Inc. 51
Chapter 5 vShield Edge Management
Configure Load Balancer
ThevShieldEdgeprovidesloadbalancingforHTTPtraffic.Loadbalancing(uptoLayer7)enablesWeb
applicationauto‐scaling.Toimplementloadbalancing,youmapanexternal(orpublic)IPaddresstoasetof
internalservers.TheloadbalanceracceptsHTTPrequestsontheexternalIPaddressanddecides
which
internalservertouse.Port80isthedefaultlisteningportforloadbalancerservice.
AllLoadBalancersettingsconfig uredbyusingRESTrequestsappearunderthevShieldEdge>LoadBalancer
tabfortheappropriatevShieldEdgeinthevShieldManageruserinterfaceandinthevSphereClientplug
‐in.
Fortheloadbalancerschema,see“vShieldEdgeSchemas”onpage 116.SampleXMLrequestbody:
Example 5-20. Configure load balancer
POST https://<vsm-ip>/api/2.0/networks/<internal-portgroup-vc-moref-id>/edge
<vshieldEdgeConfig xmlns="vmware.vshield.edge.2.0">
<loadbalancerConfig>
<listener>
<externalIpAddress>10.112.2.148</externalIpAddress>
<backEndServerConfig>
<ipAddress>192.168.10.11</ipAddress>
<port>80</port>
</backEndServerConfig>
<algorithm>ip-hash</algorithm>
<enableLog>false</enableLog>
</listener>
</loadbalancerConfig>
</vshieldEdgeConfig>
Forthedatapathtowork,youneedtochangethedefaultfirewallpolicytoALLOW,orpunchFirewallrules
toallowdatatrafficonexternalandinternalinterfaces.Rules:
YoucanmapaglobalorpublicIPaddresstoasetofinternalserversforloadbalancing.Theloadbalancer
acceptsHTTPrequestsonthe<ipAddress>specified.If<port>isnotgiven,80isthedefaultport.
The<backEndServerConfig>isalistofoneormoreIPaddressesrepresentingserverstouseforload
balancing.
vShieldManagerprocessesthepostedXMLfileasacompletesetofloadbalancingserversforthenetwork
specified.Thecurrentsetofloadbalancingserversforanetworkisreplacedwiththisnewsetofservers.
Youcanaddmultipleserversaslistenersbyenteringmultiple<listener>sectionsinthebody.
Youcanconfigurethealgorithmthatisusedtodetermineloadbalancing.Theoptional<algorithm>
elementcanbesettoround-robin(thedefault)orip-hash.
Loggingisdisabledbydefault.Toenablelogging,adda<enableLog>elementsettotrue.
Manage Load Balancer Service
Example 5-21. Start load balancer
POST https://<vsm-ip>/api/2.0/networks/<internal-portgroup-vc-moref-id>/edge
<vshieldEdgeConfig xmlns="vmware.vshield.edge.2.0">
<loadbalancerService>up</loadbalancerService>
</vshieldEdgeConfig>
Example 5-22. Stop load balancer
POST https://<vsm-ip>/api/2.0/networks/<internal-portgroup-vc-moref-id>/edge
<vshieldEdgeConfig xmlns="vmware.vshield.edge.2.0">
<loadbalancerService>down</loadbalancerService>
</vshieldEdgeConfig>
Comentarios a estos manuales