azureload-balancingalwayson

Azure Internet Facing Multi Region Load Balancer


I am creating a multi region AlwaysOn Sql Availabilty group. I have 2 VM's in the East and 1 VM in the West. I need to load balance these with a public facing load balancer. Is it possible to create an internet facing load balancer with VM's that exist in different VNET's and different Data Centers?

There is a VPN Tunnel between the two networks. This is not relevant to the public load balancer, but just in case someone asks.

UPDATE 3 YEARS LATER:

You should never really create something like this. If you absolutely to, you can but it's terrible terrible practice.


Solution

  • So I have developed the solution and I have successfully tested it. there are two options:

    Make sure you have VNET's in both regions. Make sure there is a VPN tunnel between the two VNETS that are in separate regions. Next create your Cluster and Availability Group as you normally would. Then in your both of your regions attach separate Internet Facing load balancers. So if you have 2 nodes on the East and 1 node in the west, your east internet facing load balancer will have 2 VMs behind it and the west have a different load balancer with just one. then, create listeners on your cluster for your public IP Addresses. ENSURE That the public IP address of your Internet Facing load balancer is associated with the proper subnet on the listener or you will have problems. Here are where your options come in to play

    Option 1: In your connection string specify a failover partner example

    DataSource=mydb.mydomain.com;FailoverPartner=mydb2.mydomain.com;MultiSubnetFailover=true; I may have mistype this connection, but this is the idea. you can lookup proper syntax

    Option 2: Do not specify a failover partner and in the event of a region failover redeploy your app with the new connection string. (this is the cloud people if you are not using a tool like octopus deploy you are doing it wrong)

    I opted for option 2 as our Disaster Recovery failover method is already very complex.

    I hope this helps someone else out!