Thanks Igor, you pointed me to the correct answer. I removed the check.txt. I am not sure how the file got missing, my systems were down for a few days and I moved to KVM last night.
Regards, - KK On Tue, Apr 7, 2015 at 11:56 AM, Igor Cicimov < [email protected]> wrote: > Forgot to cc the list. > > ---------- Forwarded message ---------- > From: Igor Cicimov <[email protected]> > Date: Tue, Apr 7, 2015 at 4:25 PM > Subject: Re: "proxy haproxy has no server available!" > To: "Krishna Kumar Unnikrishnan (Engineering)" <[email protected]> > > > > > On Tue, Apr 7, 2015 at 3:58 PM, Krishna Kumar Unnikrishnan (Engineering) < > [email protected]> wrote: > >> Thanks Igor for the suggestion. I get: >> >> root@haproxy-2:/var/www# curl --http1.0 -X HEAD >> 192.168.122.101:80/check.txt >> curl: (18) transfer closed with 168 bytes remaining to read >> root@haproxy-2:/var/www# curl --http1.0 -X HEAD >> 192.168.122.102:80/check.txt >> curl: (18) transfer closed with 168 bytes remaining to read >> >> And without the flags: >> >> root@haproxy-2:/var/www# curl 192.168.122.102:80/check.txt >> <html> >> <head><title>404 Not Found</title></head> >> <body bgcolor="white"> >> <center><h1>404 Not Found</h1></center> >> <hr><center>nginx/1.6.2</center> >> </body> >> </html> >> >> Is this the problem? I am not sure how to fix it. >> >> > Obviously the given txt file does not exist in your nginx document root > directory. You said you are migrating the setup so wonder how did this use > to work till now? > > >> Thanks, >> - KK >> >> On Tue, Apr 7, 2015 at 11:10 AM, Igor Cicimov < >> [email protected]> wrote: >> >>> >>> >>> On Tue, Apr 7, 2015 at 3:24 PM, Krishna Kumar Unnikrishnan (Engineering) >>> <[email protected]> wrote: >>> >>>> Sorry, forgot to mention, this is haproxy version 1.5.11 >>>> >>>> >>>> On Tue, Apr 7, 2015 at 10:52 AM, Krishna Kumar Unnikrishnan >>>> (Engineering) <[email protected]> wrote: >>>> >>>>> Hi all, >>>>> >>>>> I am moving from using LXC to KVM for haproxy on my Debian 7 system. >>>>> When I >>>>> start haproxy, I get this error: >>>>> _________________________________________ >>>>> Apr 7 10:38:22 localhost haproxy[3418]: Proxy haproxy started. >>>>> Apr 7 10:38:24 localhost haproxy[3420]: Server haproxy/nginx-1 is >>>>> DOWN, reason Layer4 timeout, check duration: 2000ms. 1 active and 0 backup >>>>> servers left. 0 essions active, 0 requeued, 0 remaining in queue. >>>>> Apr 7 10:38:24 localhost haproxy[3419]: Server haproxy/nginx-1 is >>>>> DOWN, reason Layer4 timeout, check duration: 2001ms. 1 active and 0 backup >>>>> servers left. 0 essions active, 0 requeued, 0 remaining in queue. >>>>> Apr 7 10:38:25 localhost haproxy[3420]: Server haproxy/nginx-2 is >>>>> DOWN, reason Layer4 timeout, check duration: 2001ms. 0 active and 0 backup >>>>> servers left. 0 essions active, 0 requeued, 0 remaining in queue. >>>>> Apr 7 10:38:25 localhost haproxy[3420]: proxy haproxy has no server >>>>> available! >>>>> Apr 7 10:38:25 localhost haproxy[3419]: Server haproxy/nginx-2 is >>>>> DOWN, reason Layer4 timeout, check duration: 2001ms. 0 active and 0 backup >>>>> servers left. 0 essions active, 0 requeued, 0 remaining in queue. >>>>> Apr 7 10:38:25 localhost haproxy[3419]: proxy haproxy has no server >>>>> available! >>>>> >>>>> From outside the haproxy, I get the error: >>>>> # wget 192.168.122.112:80 >>>>> --2015-04-07 10:48:47-- http://192.168.122.112/ >>>>> Connecting to 192.168.122.112:80... connected. >>>>> HTTP request sent, awaiting response... 503 Service Unavailable >>>>> 2015-04-07 10:48:47 ERROR 503: Service Unavailable. >>>>> _______________________________________________________________ >>>>> >>>>> The config file is: >>>>> global >>>>> log 127.0.0.1 local0 >>>>> log 127.0.0.1 local1 notice >>>>> maxconn 65536 >>>>> daemon >>>>> quiet >>>>> nbproc 2 >>>>> debug >>>>> user haproxy >>>>> group haproxy >>>>> >>>>> defaults >>>>> log global >>>>> mode http >>>>> option dontlognull >>>>> retries 3 >>>>> option redispatch >>>>> maxconn 65536 >>>>> timeout connect 5000 >>>>> timeout client 50000 >>>>> timeout server 50000 >>>>> >>>>> #listen haproxy 192.168.122.112:80 >>>>> listen haproxy *:80 >>>>> mode http >>>>> stats enable >>>>> stats auth someuser:somepassword >>>>> balance roundrobin >>>>> option prefer-last-server >>>>> option forwardfor >>>>> option httpchk HEAD /check.txt HTTP/1.0 >>>>> >>>> >>> Check if the above health check is really working, you show that >>> requesting the root page works but we don't see you checking the /check.txt >>> file (does it exist at all?). Run: >>> >>> $ curl --http1.0 -X HEAD 192.168.122.101:80 <http://192.168.122.101/> >>> /check.txt >>> $ curl --http1.0 -X HEAD 192.168.122.102:80 <http://192.168.122.101/> >>> /check.txt >>> >>> from the HAP server. >>> >>> server nginx-1 192.168.122.101:80 check >>>>> server nginx-2 192.168.122.102:80 check >>>>> >>>>> BTW, I could not use "listen haproxy 192.168.122.112:80", but had to >>>>> use *:80 >>>>> as haproxy does not start up with the former. It seems like haproxy >>>>> startup is >>>>> happening ahead of networking. >>>>> ______________________________________________________ >>>>> >>>>> I also stopped/restarted haproxy, but I still get the same error at >>>>> start. >>>>> >>>>> root@haproxy-2:~# netstat -apn | grep :80 >>>>> tcp 0 0 0.0.0.0:80 0.0.0.0:* >>>>> LISTEN 3558/haproxy >>>>> _______________________________________________________________ >>>>> From outside haproxy, I can do a wget/curl" to either of the two >>>>> servers: >>>>> >>>>> # wget 192.168.122.101:80 >>>>> --2015-04-07 10:42:28-- http://192.168.122.101/ >>>>> Connecting to 192.168.122.101:80... connected. >>>>> HTTP request sent, awaiting response... 200 OK >>>>> Length: 867 [text/html] >>>>> Saving to: `index.html' >>>>> >>>>> 100%[======================================>] 867 --.-K/s in >>>>> 0s >>>>> >>>>> 2015-04-07 10:42:28 (104 MB/s) - `index.html' saved [867/867] >>>>> _______________________________________________________________ >>>>> >>>>> And I can do the same from haproxy: >>>>> root@haproxy-2:~# wget 192.168.122.101 >>>>> --2015-04-07 10:43:48-- http://192.168.122.101/ >>>>> Connecting to 192.168.122.101:80... connected. >>>>> HTTP request sent, awaiting response... 200 OK >>>>> Length: 867 [text/html] >>>>> Saving to: `index.html' >>>>> >>>>> 100%[======================================>] 867 --.-K/s in >>>>> 0s >>>>> >>>>> 2015-04-07 10:43:48 (80.3 MB/s) - `index.html' saved [867/867] >>>>> _______________________________________________________________ >>>>> >>>>> How do I fix this problem? >>>>> >>>>> Thank you, >>>>> - KK >>>>> >>>> >>>> >>> >> > > > -- > Igor Cicimov | DevOps > > > p. +61 (0) 433 078 728 > e. [email protected] <http://encompasscorporation.com/> > w*.* encompasscorporation.com > a. Level 4, 65 York Street, Sydney 2000 > > > > -- > Igor Cicimov | DevOps > > > p. +61 (0) 433 078 728 > e. [email protected] <http://encompasscorporation.com/> > w*.* encompasscorporation.com > a. Level 4, 65 York Street, Sydney 2000 >

