linux - Having HAProxy check back-end server status? -


haproxy able load balance mysql/tomcat/cassandra/ldap/web server etc....perfectly. main issue how make sure backend mysql/tomcat/cassandra etc server forward request , running (i mean not establish connection port 3306 mysql,8080 tomcat,389 ldap etc. mean more “complete”, performs little operation against back-end servers).

my use case :
=============

there numerous back-end tomcat working behind haproxy , tomcat serving through haproxy , 1 of tomcat gone outofmemory. apparently haproxy, tomcat server , request routed tomcat failing tomcat running oom.

is possible make haproxy check status of back-end server using small shell script?

what script performs basic operation against tomcat returns http status 200 if operation successful or http status 500 if there error (i.e. tomcat not available).

are there other ways configure haproxy check status "complete" rather connection check on server-ip : port ?

the solution i'm using available @ link: http://sysbible.org/2008/12/04/having-haproxy-check-mysql-status-through-a-xinetd-script/

it's little long paste inline here, summarize, there small shell script executes simple query against mysql server on localhost , outputs http 200 or 500 response on success/failure respectively. there variety of ways run this, simplicity linked solution registers shell script directly xinetd service. port ideally should open haproxy server, , not open internet!

haproxy's built in http monitoring, intended monitoring web backends, can consume output of service , use determine if server up.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -