Search code examples
load-balancingwindows-server-2012-r2nlb

Network Load Balance


I'm having an issue while accessing an NLB cluster from node that is part of the cluster.

Here is the scenario.

I have created a NLB clusters on IP 10.10.10.110\255.0.0.0 [Protocol: both with filtering Single Host] in unicast mode having three nodes

10.10.10.109\255.0.0.0 -> Priority 2
10.10.10.134\255.0.0.0 -> Priority 1
10.10.10.101\255.0.0.0 -> Priority 3

Now if i access the cluster [10.10.10.110] from any other node[forsay 10.10.10.105] it resolves 10.10.10.109 that is what is expected.

Now if i hit 10.10.10.110 from host 10.10.10.109 it resolves to 10.10.10.109 that is not what is expected from the cluster. Similarly, if i access it from host 10.10.10.101 it resolves 10.10.10.101 despite of the priority of cluster.

What i believe is that its a loopback since the NLB IP is also registered on the current node, it resolve itself instead of hitting a cluster.

As of the application design, application is to be hosted on nodes that are part of the cluster and will hitting NLB cluster ip. I want to resolve node based on the cluster priority and status.

Please suggest how we can resolve this situation.


Solution

  • The solution to this problem is simple. Just add a route to your default gateway against your cluster ip. Reason: We want to bypass local resolution and use Cluster based priority.

    First run Tracing route to 10.10.10.110 (NLB Cluster IP)

    PS C:\Users\Administrator> tracert 10.10.10.110
    

    you will see

      1    <1 ms    <1 ms    <1 ms  vm-xx.xxxx.local [10.10.10.110]
    

    Now we will add a route so that request in redirected from router. In my example my gateway is 10.10.10.99.

    PS C:\Users\Administrator> route add 10.10.10.110 mask 255.255.255.255 10.10.10.99
     OK!
    

    Now recheck trace route

    PS C:\Users\Administrator> tracert 10.10.10.110
    
    Tracing route to vm-xx.xxxx.local [10.10.10.110]
    over a maximum of 30 hops:
    
      1    <1 ms    <1 ms    <1 ms  10.10.10.99
      2     1 ms    <1 ms    <1 ms  vm-xx.xxxx.local [10.10.10.110]
    

    Now the request will be routed with gateway and resolution will be done as expected from NLB cluster even from the host that is part of the cluster.

    Note: Route needs to be added on all hosts that are part of the cluster that need resolution of address from cluster.