LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Load Balancing - ipvsadm with apache (mod_proxy) to another apache not working (https://www.linuxquestions.org/questions/linux-server-73/load-balancing-ipvsadm-with-apache-mod_proxy-to-another-apache-not-working-923219/)

romeo_tango 01-11-2012 04:30 AM

Load Balancing - ipvsadm with apache (mod_proxy) to another apache not working
 
Hi,

I have these kind of configuration :

Code:

user -> firewall -> Server 0 (Apache with mod_proxy) -> loadbalancer

loadbalancer -- Server 1
              \
                Server 2

Server 0 real IP : 10.10.10.10 ; Virtual IP 10.10.10.200
Server 1 IP : 10.10.10.11 ; local loopback lo:0 IP 10.10.10.200
Server 2 IP : 10.10.10.11 ; local loopback lo:0 IP 10.10.10.200

I have already succeeded in load balancing process. I created some test.php files in Server 1 will show "1" and in Server 2 if the page being hit will display "2" in the browser. Since I used round-robin algorithm, it will display "1" and "2" alternately.

But today, when I checked the page, it only showed "1" everytime I refresh the browser and realize that it actually bypass the loadbalancer and directly hit the Server 1 from the apache server 0 (in server 1 apache's log, the traffic come from the server 0 real IP).

If I somehow turned the local loopback in server 1, it will display error 503 (service currently unavailable).

So I wonder whats wrong with my configuration? Why it won't recognized the load balancer IP properly?

Please advise. Thanks.

romeo_tango 01-12-2012 03:21 AM

Hmm after a few checking, I noticed that the problem occured because :
- the mac address from local loopback in server 1 override the mac address in arp tables in the Server 0.
- that way, all request to the 10.10.10.200 is directly forwarded to Server 1 and not the loadbalancer.

- I then delete the arp entry and create a static one in the arptables of Server 0 so that all the request will be forwarded to the load balancer again and the server now back to normal.

Anyone know what might cause the overridden?

The problem is already been solved, it just that I don't know why it could happen in the first place.
Thanks


All times are GMT -5. The time now is 07:02 PM.