Load Balancer with primary/secondary routing

Category: azure virtualnetwork


rao.kumbha on Wed, 26 Oct 2016 07:05:45


We have Two Applications servers (APPVM1 and APPVM2) running in an Availability set ASet1. The connections to these application servers are directed thourgh a load balancer APPLB. On the other hand, we have two database servers DBVM1 (primary) and DBVM2 (secondary) running in an Availability set ASet2. Both the database servers are connected to a Database Load Balancer DBLB. All the connections hit the application server via application load balancer in round robin fashion and further hit the database via database load balancer in round robin fashion.Our requirement is that the connections to the database should go only to DBVM1. (The DBVM1 and DBVM2 are having replication in place). If and only if the DBVM1 goes down the connections should be redirected from the Database load balancer to DBVM2. Few things to note

1. We do not want to expose the VMs to public. 

2. Traffic Manager does not meet our requirement.

3. Session Affinity does not completely address the issue. 

4. We do not want to create a seperate VM for broker/monitor processes for keeping the VM in ready/busy state under the load balancer.

Let me know if you have any questions or clarifications on my question. 

Thanks & Regards



Loydon Mendonca on Wed, 26 Oct 2016 14:32:41

Hello Venu,

Thank you for posting on the Azure forums!

If I understand correctly, you want to use a load balancer above your DB VMs but don’t want load balancing! If this is true, then I am not quite sure what purpose a LB would serve here since its job is to load balance traffic between VMs available in the Load Balanced set.

If we look at availability set for your VMs then you need to have both of them ON in order to ensure high availability but again, the traffic will be load balanced between the instances since there is no such feature to do priority routing using an Azure Load Balancer.

You could setup NAT rules for your LB to guide the traffic originating from a particular port to a specific port of the primary VM but this assignment would be static and there will not be a dynamic failover to the secondary VM if the primary goes down.

You did mention that traffic manager would not serve the purpose for you but I would want you to take a look at enabling Priority routing profile using traffic Manager. Using this you can make sure that traffic is by default routed to the primary endpoint (DBVM1) and will failover to DBVM2 if DBVM1 goes down. Please check Priority traffic-routing method for more details.

Let me know if this helps.





When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer so that other customers can benefit from it.

rao.kumbha on Fri, 28 Oct 2016 14:35:58

Thank you so much Loydon. Will do some more research on this. 

Thanks & Regards