Forum Discussion

stevericks_2450's avatar
stevericks_2450
Icon for Nimbostratus rankNimbostratus
Jan 18, 2016

Load balancer help setup needed

Hi,

 

Im very new to LineRate (discovered it this morning) and I am trying to load balance between 2 Windows 2012 servers with web addresses. Its actually got IBMs Integration Broker on each and they listen on I have set up the Linerate device in our VMware environment. The device and the 2 servers are on the same subnet. I then do an xml POST to each individually and get a timestamp back. Then when I try to post to the Virtual IP I get xml rubbish back. What I cant figure out is I have set the real server addresses and ports to 7800. But how does it know to go to

 

PS all looks good in the gui. All looks online.

 

Any help greatly appreciated...

 

Steve.

 

  • Its definitely not load balancing. I have set different messages to respond from each server. If I set the admin status on server 1 to offline, then it gets a response from server 2. But when I bring server 1 back online it continues to only get responses from server 2. Then if I take server 2 offline it gets responses from server 1. Then when I bring server 2 back online it continues to get responses from server 1.

     

    So it only ever sends to one server. But it can obviously send to both, so why is it not load balancing using round robin?

     

    Steve.

     

    • Andrew_Ragone_2's avatar
      Andrew_Ragone_2
      Historic F5 Account
      Hi Steve, so the reason you are seeing the same response from one server is you have the "Source IP Persistence" enabled in your Virtual Server. It would be expected behavior that you see an intermittent 502 when you take the server offline until the persistence record expires and/or that you only get sent to one server. To ensure the system is actually load balancing, you can try 1 of 2 things: 1) turn off Source IP persistence, at least temporarily, for testing purposes 2) attempt to access the VIP from a different IP address on your system or another system
  • Thought I would post my interface config..

     

    interface em0
     mtu 1500
     ip address 10.224.100.200 255.255.255.0
    !
    interface em1
     mtu 1500
     ip address 10.224.100.201 255.255.255.0
    !
    interface em2
     mtu 1500
     ip address 10.224.100.202 255.255.255.0
    !
    ip route 0.0.0.0/0 10.224.100.1
    !
    health-monitor fghiib01uat
     type http
     admin-status online
    !
    health-monitor fghiib02uat
     type http
     admin-status online
    !
    ssl profile self-signed
     attach certificate self-signed
     attach key self-signed
    !
    real-server fghiib01uat
     ip address 10.224.100.103 7800
     base iib01uat_web
     admin-status online
    !
    real-server fghiib02uat
     ip address 10.224.100.104 7800
     base iib01uat_web
     admin-status online
    !
    virtual-ip vipiibuat
     ip address 10.224.100.201 7800
     base vipiibuat
     admin-status online
    !
    real-server group rsgroup_websilo1
     members by regex "fghiib.*"
     member fghiib02uat
     member fghiib01uat
    !
    virtual-server websilo1
     service http
      persist source-ip
     attach virtual-ip vipiibuat default
     attach real-server fghiib02uat weight 0
     attach real-server fghiib01uat weight 0
    
    
    Code
  • Problem now is that its not load balancing. If I shut down one of the Integration Servers, I get a 502 bad gateway error every time I POST xml. Or if I shut the other one I still get through every time.

     

    So its only going to one of the real servers??

     

    Its probably because its all on the same subnet.

     

    Any ideas?

     

    Steve.

     

  • Right...Think I have solved it..... I noticed that my Virtual IP status was UP but had no associated interface. So I googled that and found.. https://devcentral.f5.com/questions/linerate-version25-virtual-ip-status-up-but-no-associated-system-interface-routed-traffic-only

     

    I needed to create a virtual IP address that was associated with an interface. So I set my Virtual IP address to be the same as Interface em1.

     

    Then I got the response I was expecting.

     

    Now I just need to make sure that it is actually load balancing. And what happens if I switch one off?

     

    Steve.

     

  • Hi,

     

    Thanks for getting back Andrew. Just tried that and I get..

     

    504 Gateway Timeout

     

    504 Gateway Timeout Gateway timeout expired while waiting for server response

     

    Steve.

     

  • Andrew_Ragone_2's avatar
    Andrew_Ragone_2
    Historic F5 Account

    Good Morning, Steve.

     

    What URL are you using to do the XML POST to the LineRate VIP? Generally, you would want to craft your post to the VIP just the same as you would directly to the server. For example, with your above URL example, you might send the XML POST request to the following URL (presuming you configured your VIP to listen on port 7800):

     

    Essentially the LineRate proxy will then choose 1 of your 2 windows servers to relay the request to. One other thing that you may want to be conscious of here is persistence. If your web service requires authentication or saves any kind of state in the application, you likely will want persistence enabled on the Virtual Server in LineRate. What this does is ensures a given client talks to the same backend server so that he doesn't, for example, make a successful request to authenticate to Server 1 and then get his second request sent to Server 2 who doesn't know he exists. You can read more about this here: Virtual Server Persistence

     

    Hope this helps.

     

    -Andrew