HAProxyCTL
This is a simple wrapper to make life with HAProxy a little more convenient.
- Acts as an init script for start, stop, reload, restart, etc
- Leverages 'socket' to enable and disable servers on the fly
- Formats server weight and backends in a readable way
- Provides Nagios and Cloudkick health checks
- chkconfig/service-able for Redhat folk
Here is a presentation about it. Hit space to advance slides.
Installation
On most UNIX, assuming HAProxy is in the $PATH:
For chkconfig/RedHat/Centos, add:
Or if have RubyGems, just gem install it!
Or if you are on Debian, just install haproxy with apt-get!
There is also an HAProxy source installation script. This installs not only the steps above but also HAProxy itself.
Options
Examples
Status check
Errors to the backend servers
Human readable health check
Disable servers on the fly
Graceful reloads
Cloudkick/Nagios checks with graph-friendly output for queue size, total connections, etc
does normal things like checks if a process is running before starting it...
keeps all the regular UNIX socket stuff
Extends stat command to print only counters supplied as arguments
Enable or disable a target server from every backend it appears.
Has an EXCEPT flag, too
Contributors
- flores aka
flores
- Scott Gonyea aka
sgonyea
- Ben Lovett aka
blovett
- John A. Barbuto aka
jbarbuto
- Till Klampaeckel aka
till
- Erik Osterman aka
osterman
- Martin Hald aka
mhald
- deniedboarding
- Aaron Blew aka
blewa
- Nick Griffiths aka
nicobrevin
- Florian Holzhauer aka
fh
- Jonas Genannt aka
hggh
- Grant Shively aka
gshively11
Non-current HAProxy versions
Be aware that HAProxy below version 1.4 does not support many of the
options of haproxyctl.
License
This code is released under the MIT License. You should feel free to do whatever you want with it.