I have HAProxy, 1.3.15, on the frontend of a few Ubuntu 9.04 instances with the
following haproxy.cfg that are distributing to a couple apache/passenger
instances. My problem is that if I...
curl http://localhost/
It sits for awhile then returns a 504 Gateway Timeout. However if I...
curl http://localhost:7000/
Which passenger is listening on, it returns fairly quickly with the page I
would expect to see.
I've also included the lsof results and hosts file on web01, everything is the
same on web02. Anyone have any guess as to why my haproxy and passenger setup
aren't talking to each other? Is my haproxy.cfg file misconfigured somehow?
Thanks,
Nick
HAProxy version ######################
######################################
r...@web01:/etc# dpkg -l | grep haproxy
ii haproxy 1.3.15.2-2~lenny1 fast
and reliable load balancing reverse pro
lsof results on web01 ################
######################################
r...@web01:/etc# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
haproxy 8695 root 6u IPv4 231736 TCP *:www (LISTEN)
r...@web01:/etc# lsof -i :7000
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
apache2 8422 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8423 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8424 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8425 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8426 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8521 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8522 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8525 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8528 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 8530 www-data 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
apache2 12693 root 4u IPv4 78214 TCP *:afs3-fileserver (LISTEN)
haproxy.cfg on web01 ################
#####################################
global
log 127.0.0.1 local0 warning
maxconn 1024
defaults
log global
mode http
retries 3
balance roundrobin
option abortonclose
option redispatch
contimeout 4000
clitimeout 150000
srvtimeout 30000
# Admin interface for proxy stats
listen admin 0.0.0.0:9100
stats uri /haproxy
# So monit can check on haproxy
# simple response : 'OK'
listen health_check 0.0.0.0:60001
mode health
listen passenger_proxy 0.0.0.0:80
option forwardfor
option httpchk GET /httpchk.txt
server web02 web02:7000 maxconn 20 check
server web01 web01:7000 maxconn 20 check
listen passenger_proxy 0.0.0.0:443
mode tcp
option forwardfor
# server check below is on the http port so we can check a specific http path
for httpchk
option httpchk GET /httpchk.txt
server web02 web02:7001 maxconn 20 check port 7000
server web01 web01:7001 maxconn 20 check port 7000
/etc/hosts on web01 ################
####################################
127.0.0.1 localhost.localdomain localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
10.202.197.103 web02 web02.mydomain.com
10.208.202.70 web01 web01.mydomain.com