In many LOB scenarios, in addition to load balancing the Web and the app, in many cases the database needs to be load balanced in order to further improve the customer experience while ensuring system database availability.
Then, when the database is load balanced, but also to ensure the security of access and data, it is necessary to implement load balancing internally. Currently Azure provides an internal load balancer (ILB) that works with Nsgs (previous articles) to load traffic while fully secure.
1 Introduction to the scene
An ILB topology with 2 cloud services:
650) this.width=650; "title=" clip_image002[7] "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; margin:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image002[7] "src=" http://s3.51cto.com/wyfs02/M01/78/53/ Wkiol1z6tqngoua9aac_yjt41nq348.jpg "width=" 458 "height=" 553 "/>
An ILB topology with 1 cloud services:
650) this.width=650; "title=" clip_image004[4] "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; margin:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image004[4] "src=" http://s3.51cto.com/wyfs02/M01/78/53/ Wkiol1z6tquztt7taactxxdcgzm519.jpg "width=" 420 "height=" 475 "/>
For intranet LOB applications running on azure virtual machines in a cross-premises azure virtual network, the ILB can load balance traffic from intranet clients.
650) this.width=650; "title=" clip_image006[4] "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; margin:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image006[4] "src=" http://s3.51cto.com/wyfs02/M01/78/54/ Wkiom1z6tpqrmvbwaabeqpvbchk408.jpg "width=" 558 "height="/>
2 Configuring the ILB
The database IP configuration is as follows:
650) this.width=650; "title=" clip_image008[4] "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; margin:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image008[4] "src=" http://s3.51cto.com/wyfs02/M01/78/54/ Wkiom1z6tpyzh2ajaaaq0dfwc-q175.jpg "width=" 560 "height=" 102 "/>
2.1 Creating an instance of the ILB
The instance obtains the assigned virtual IP (VIP) address from the address pool of the cloud service or virtual network.
Command format:
$svc = "<cloud Service name>"
$ILB = "<name of your ILB instance>"
$subnet = "<name of the subnet within your virtual network-optional>"
$IP = "<the IPv4 address to use on the subnet-optional>"
Add-azureinternalloadbalancer-servicename $svc-internalloadbalancername $ilb –subnetname $subnet – Staticvnetipaddress $IP
650) this.width=650; "title=" clip_image010[4] "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; margin:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image010[4] "src=" http://s3.51cto.com/wyfs02/M02/78/54/ Wkiom1z6tp3gp38faabnjuczw4y054.jpg "width=" 558 "height="/>
2. Add the endpoint that corresponds to the virtual machine that will receive load-balanced traffic.
$svc = "<cloud service name>"
$vmname = "<name of the Vm>"
$epname = "<name of the Endpoint>"
$prot = "TCP" or "UDP"
$locport =<local Port Number>
$pubport =<public Port Number>
$ILB = "<name of your ILB instance>"
Get-azurevm–servicename $svc –Name $vmname | Add-azureendpoint-name $epname-protocol $prot-localport $locport-publicport $pubport –defaultprobe- Internalloadbalancername $ILB | Update-azurevm
650) this.width=650; "title=" clip_image012[4] "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; margin:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image012[4] "src=" http://s3.51cto.com/wyfs02/M02/78/53/ Wkiol1z6trljohcsaab4lbamznm541.jpg "width=" 558 "height=" 174 "/>
Add a second instance
650) this.width=650; "title=" clip_image014[4] "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; margin:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image014[4] "src=" http://s3.51cto.com/wyfs02/M01/78/58/ Wkiol1z6wfcjyd-0aabkojt0-ms407.jpg "width=" 558 "height=" 137 "/>
View Load Balancer
650) this.width=650; "title=" clip_image016[4] "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image016[4] "src=" http://s3.51cto.com/wyfs02/M02/78/58/ Wkiol1z6wfkh2n18aaboj-knmwm786.jpg "width=" 557 "height=" "/>
Azure Internal Load Balance