QubitProducts / bamboo

HAProxy auto configuration and auto service discovery for Mesos Marathon
Apache License 2.0
794 stars 215 forks source link

HAProxy Load Balancer Configuration #199

Open parker20121 opened 8 years ago

parker20121 commented 8 years ago

I have bamboo/haproxy deployed on a set of mesos worker nodes using Marathon.

What I can figure out is how to put a haproxy server in front of them as a load balanacer.

The one I have will forward onto a haproxy on the work node, but I keep getting 400 (bad request) errors, and I'm not sure if there is something I'm missing on the haproxy load balancer configuration. Does anyone have a example haproxy configuration file used as a load balancer that I could compare mine too?

gvenka008c commented 8 years ago

@parker20121 @Zariel @rasputnik @MiLk @activars

I am getting the below error repeatedly while connecting to the URL. I have bamboo/haproxy deployed on a set of mesos worker nodes using Marathon. Any thoughts? Lost connection to server at couchbase.xxx.com. Repeating in 1 seconds.

#curl -IS couchbase.xxx.com
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

While accessing the URL in browser throws the error as below

503 Service Unavailable

No server is available to handle this request.
parker20121 commented 8 years ago

Can you run curl in verbose mode?

Did it forward to the right machine? Looks like it can find the right port.

gvenka008c commented 8 years ago

@parker20121 Here is the verbose mode output. When we it the URL on browser it is forwarding to the correct haproxy. The webpage loads, and I am able to login but within couple of seconds it throws out "503 Service Unavailable" error.

curl -vIS http://couchbase.xxx.com/index.html
* Hostname was NOT found in DNS cache
*   Trying xx.xxx.x.xx...
* Connected to couchbase.xxx.com (xx.xxx.x.xx) port 80 (#0)
> HEAD /index.html HTTP/1.1
> User-Agent: curl/7.37.1
> Host: couchbase.xxx.com
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
* Server Couchbase Server is not blacklisted
< Server: Couchbase Server
Server: Couchbase Server
< Pragma: no-cache
Pragma: no-cache
< last-modified: Tue, 01 Dec 2015 17:06:47 GMT
last-modified: Tue, 01 Dec 2015 17:06:47 GMT
< Date: Sat, 16 Apr 2016 18:31:09 GMT
Date: Sat, 16 Apr 2016 18:31:09 GMT
< Content-Type: text/html; charset=utf8
Content-Type: text/html; charset=utf8
< Content-Length: 204441
Content-Length: 204441
< Cache-Control: must-revalidate
Cache-Control: must-revalidate
< Connection: close
Connection: close
parker20121 commented 8 years ago

I'm not a coachbase expert. After you login, is it forwarding onto another machine through haproxy?