This topic shows you how to configure a listener for an AlwaysOn Availability Group by using an Internal Load Balancer (ILB) with Azure Virtual machine provisioned using the new Azure Resource Manager.
Summary Steps
- Create ARM Load balancer using Power Shell Script
- Configure Load Balancer's Backend pool
- Configure Load Balancer's Probe
- Configure Load Balancer's Load Balancing Rules
- Create Availability Group Listener from FCI
- Configure AlwaysOn Listener IP Resource
- Configure AlwaysOn AG role dependency
- Test the Availability Group Listener
Steps to create Azure Load balancer for Alwayson with ARM
Create an Internal Load Balance (ILB) with minimum parameter using the below script. The rest of the configuration would be done through Azure Ibiza Portal
- Open an Azure Power shell ISE windows with Administrative Permission
- Copy the below Script
#switching to Resource Manager mode
Switch-AzureMode-NameAzureResourceManager
#select the required subscription.
Select-AzureSubscription-SubscriptionName"Microsoft Azure "# Need to change the subscription Name
#Replace the values for the below listed variables
$ResourceGroupName='SQLARMTEST'# Resource Group Name in which the SQL nodes are deployed
$FrontEndConfigurationName='fe_TENNIS_SOCCER'#You can provide any name to this parameter.
$BackendConfiguratioName='be_TENNIS_SOCCER'#You can provide any name to this parameter.
$LoadBalancerName='ILB_TENNIS_SOCCER'#Provide a Name for the Internal Local balance object
$Location='westeurope'# Input the data center location of the SQL Deployements
$subname='sqlsubnet' # Provide the Subnet name in which the SQL Nodes are placed
$ILBIP='10.10.0.14'# Provide the IP address for the Listener or Load Balancer
$subnet=Get-AzureVirtualNetwork-ResourceGroupName$ResourceGroupName|Get-AzureVirtualNetworkSubnetConfig–name$subname
$FEConfig=New-AzureLoadBalancerFrontendIpConfig-Name$FrontEndConfigurationName-PrivateIpAddress$ILBIP-SubnetId$subnet.Id
$BackendConfig=New-AzureLoadBalancerBackendAddressPoolConfig-Name$BackendConfiguratioName
New-AzureLoadBalancer-Name$LoadBalancerName-ResourceGroupName$ResourceGroupName-Location$Location-FrontendIpConfiguration$FEConfig-BackendAddressPool$BackendConfig
Configure other Load Balancer Properties
- Browse to new Ibiza portal (http://Portal.azure.com).
- Browse All objects
- Select Resource Groups
- Selected the Resource Group used to deploy the Environment from list all the resource
- The list would have the Load Balancer (ILB) created using the script
- Click All Setting for the ILB
Configure Load Balancer's Backend Pool
- Click Backend Pool setting tab
- Will list the backend Pool created using the script i.e. 'be_TENNIS_SOCCER'
- selects the backend pool to update the below setting
- Availability setting - choose the Availability Setting object for the SQL nodes
- Select Virtual Machine - Add the two SQL nodes
- Save the setting
Configure Load Balancer's Probe
- Click Probe Tab
- Click Add to add a new probe
- Name the probe
- Protocol - TCP
- Port - 59999
- Save
Configure Load Balancer's Load Balancing Rules
- Click Load Balancing Rule Tab
- Click add to add a new rule
- Name the rule
- Protocol - TCP
- Port – 1433
- Backend Port - 1433
- Backend pool–mapped to the backend pool 'be_TENNIS_SOCCER' (created earlier)
- Probe - mapped to the probe
- Session persistence - none
- Floating IP (Direct Server Return) - Enabled
Create the Availability Group Listener from FCI (Refer Create the availability group listener)
Configure Alwayson Listener IP Resource
- Run the below script on both the SQL Nodes (Regular steps)
$ClusterNetworkName = "Cluster Network 1" # the cluster network name (Use Get-ClusterNetwork on Windows Server 2012 of higher to find the name)
$IPResourceName = "IP Address 10.10.0.0" # the IP Address resource name
$ILBIP = "10.10.0.14" # the IP Address of the Internal Load Balancer (ILB)
Get-ClusterResource $IPResourceName | Set-ClusterParameter -Multiple @{"Address"="$ILBIP";"ProbePort"="59999";"SubnetMask"="255.255.255.255";"Network"="$ClusterNetworkName";"OverrideAddressMatch"=1;"EnableDhcp"=0}
Configure the Dependency for AG Role (Refer Bring the listener online)
Test the availability group listener (within the same VNet)