Hi, Ryan
Sorry, I might not have explained this clearly. What I need is explained here:
http://agiletesting.blogspot.com/2009/02/load-balancing-in-amazon-ec2-with.html
However, I am having problem of acl Boolean statement:

          acl acl_domain1 url_sub domain1 -i
        acl acl_domain2 url_sub domain2 -i
        use_backend domain1_farm if acl_domain1
        use_backend domain2_farm if acl_domain2
          default_backend default_farm
it seems that those "url_sub domain*" statement will never be true. If I change 
it to "acl acl_domain1 always_true" it obviously hit domain1_farm. 
Is there a way to see the value of url?

BTW: are you the Ryan graduated from UCB and worked for a female professor in 
bioinformatics field?

Thanks
Xia
        
-----Original Message-----
From: randa...@bioinfo.wsu.edu [mailto:randa...@bioinfo.wsu.edu] 
Sent: Monday, October 12, 2009 3:39 PM
To: Ryan Schlesinger
Cc: haproxy@formilux.org; xji...@xignite.com
Subject: Re: multiple applications using HAproxy LB

I am using Nginx in front of HAProxy to provide similar functionality.  I 
personally like Nginx because it is a little lighter in terms of resources, but 
that is just my opinion.  Apache would work well to.   

Thanks,

Randall Svancara
Systems Administrator/DBA/Developer
Main Bioinformatics Laboratory



----- Original Message -----
From: "Ryan Schlesinger" <r...@instanceinc.com>
To: xji...@xignite.com
Cc: haproxy@formilux.org
Sent: Monday, October 12, 2009 2:42:20 PM
Subject: Re: multiple applications using HAproxy LB

It sounds like what you really want is to put apache (or some other web server) 
in front of haproxy to do name based virtual hosting. Requests for your two 
domains would work like this: 

client -> apache:80 (domain1 virtual host) -> haproxy:8080 
client -> apache:80 (domain2 virtual host) -> haproxy:8081 

I'm using mod_rewrite in different virtual hosts to proxy requests to haproxy 
in exactly this way. Also, in this setup, a request to 
http://ec2XXXXXXXXXX.compute-1.amazonaws.com /xhaproxy214591 would be caught by 
your first (default) virtual host and proxied correctly to haproxy. 

I hope I understood your question correctly. 

Ryan 

On 10/12/2009 02:30 PM, Xia Jiang wrote: 




Hello, 

I have a question regarding configuration for multiple applications using 
Haproxy. 

What I want: use Haproxy to handle LB among multiple instances, which each 
instance can have more than one servers. 

What I have: 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

# Configuration for one application: 

listen domain1 :8080 

mode http 

balance roundrobin 

option httpclose 

option forwardfor 

stats uri /xhaproxy214591 

option httpchk GET /healthcheck214591.php 



# Example server line (with optional cookie and check included) 

server i-41319a29 10.251.75.47:80 check inter 3000 rise 2 fall 3 maxconn 650 

server i-41319a29 10.251.75.48:80 check inter 3000 rise 2 fall 3 maxconn 650 



listen domain2 :8081 

mode http 

balance roundrobin 

option httpclose 

option forwardfor 

stats uri /xhaproxy214591 

option httpchk GET /healthcheck214591.php 



# Example server line (with optional cookie and check included) 

server i-71319a19 10.208.217.220:80 check inter 3000 rise 2 fall 3 maxconn 650 


server i-71319a19 10.208.218.220:80 check inter 3000 rise 2 fall 3 maxconn 650 



Question: 

1. Do I have to set the one of the application port numbers to be 80? Otherwise 
it won’t show me the status page. 

2. By setting one of the port number to be “80”, I can’t access the other 
application. 

i.e, by setting domain1 port number to be 80, by hitting 
http://ec2XXXXXXXXXX.compute-1.amazonaws.com , I can see the index page of 
“10.251.75.47” or “10.251.75.48” but I can’t view “10.208.217.220” or 
“10.208.218.220” by hitting http://ec2XXXXXXXXXX.compute-1.amazonaws.com :8081 



Thanks! 

Your answer will be greatly appreciated. 

Xia



Reply via email to