Re: HAproxy and detect split-brain (network failures)

2012-11-29 Thread Owen MArinas

we have exactly that setup with heartbeat, and 2 floating IPs.
Working in production for 3 years now

Owen



On 29/11/2012 3:26 PM, David Coulson wrote:


On 11/29/12 3:11 PM, Hermes Flying wrote:

I see now!
One last question since you are using Pacemaker. Do you recommend it 
for splitbrain so that I look into that direction?


Any two node cluster has risk of split brain. if you implement 
fencing/STONITH, you are in a better place. If you have a third node, 
that's even better, even if it does not actually run any services 
beyond the cluster software
I mean when you say that pacemaker restart HAProxy, does it detect 
network failures as well? Or only SW crashes?
I assume pacemaker will be aware of both HAProxy1 and HAProxy2 in my 
described deployment
You can have pacemaker ping an IP (gateway for example) and migrate 
the VIP based on that. In my config I have haproxy configured as a 
cloned resource in pacemaker, so all nodes have the same pacemaker 
config for haproxy and it keeps haproxy running on all nodes all of 
the time.




Re: help with option httpchk - http-check expect

2012-11-23 Thread Owen Marinas


Thx for the advice Jonathan
Willy's advice from an old post was to make it work  with printf+nc in 
bash first. So I did.


the issue is after I added the lines to the backend(below), the server 
still resported UP eben if the expected string is not there.


regards
Owen


---
backend neo4j-stg
option httpchk POST /db/data/ext/feed/graphdb/userFeed 
HTTP/1.1\r\nHost: 172.23.10.61:7474\r\nAccept: */*\r\nContent-Type: 
application/json\r\nContent-Length: 35\r\n\r\n{userId:8, offset:0, 
limit:1}

http-check disable-on-404 expect string userId
server neo4j-stg-01 172.23.10.61:7474
server neo4j-stg-02 172.23.10.62:7474
balance roundrobin




On 12-11-23 05:01 AM, Jonathan Matthews wrote:

On 22 November 2012 22:14, Owen Marinas omari...@woozworld.com wrote:

option httpchk POST /db/data/ext/feed/graphdb/userFeed
HTTP/1.1\r\nContent-Type: application/json\r\nContent-Length:
35\r\n{userId:8, offset:0, limit:1}\r\n

It might not be related to your original question, but I think you're
missing an extra \r\n that should represent the blank line between
the POST's headers and its body.

Also, I think the length of 35 might be wrong, as it doesn't take into
account the last \r\n (which might be superfluous anyway).

HTH,
Jonathan





Re: help with option httpchk - http-check expect

2012-11-23 Thread Owen Marinas


I hate myself for this
my production LB is running haproxy-1.4.15-1 but the Staging haproxy-1.4.8-1
after upgrade its all working now, the POST, and http-check expect  
works fine.

thx all
Owen



On 12-11-23 12:50 PM, Jonathan Matthews wrote:

On 23 November 2012 17:10, Owen Marinas omari...@woozworld.com wrote:

Thx for the advice Jonathan
Willy's advice from an old post was to make it work  with printf+nc in bash
first. So I did.

I think your back-end may be being lenient, then :-)


the issue is after I added the lines to the backend(below), the server still
resported UP eben if the expected string is not there.

That's initially because your server lines lack the requisite check
flag to enable health checks. The UP represents layer-3 connectivity
to the host working.

I can't speak as for any problems you see after you fix that - I've
never seen POSTs and request bodies being used in a health check
before!

HTH,
Jonathan