Quick example of a simple HAProxy setup on Solaris 11.
Create a suitable home and download the binary:
# pwd/usr/local/haproxy
# wget http://haproxy.1wt.eu/download/1.4/bin/haproxy-1.4.24-pcre-solaris-sparc.notstripped.gz
# gzip -d haproxy-1.4.24-pcre-solaris-sparc.notstripped.gz# chmod +x haproxy-1.4.24-pcre-solaris-sparc.notstripped# file haproxy-1.4.24-pcre-solaris-sparc.notstrippedhaproxy-1.4.24-pcre-solaris-sparc.notstripped: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped
# ./haproxy-1.4.24-pcre-solaris-sparc.notstrippedHA-Proxy version 1.4.24 2011/03/09Copyright 2000-2010 Willy Tarreau <w@1wt.eu>Usage : ./haproxy-1.4.24-pcre-solaris-sparc.notstripped [-f ]* [ -vdVD ] [ -n ] [ -N ][ -p ] [ -m ]-v displays version ; -vv shows known build options.-d enters debug mode ; -db only disables background mode.-V enters verbose mode (disables quiet mode)-D goes daemon-q quiet mode : don't display messages-c check mode : only check config files and exit-n sets the maximum total # of connections (2000)-m limits the usable amount of memory (in MB)-N sets the default, per-proxy maximum # of connections (2000)-p writes pids of all children to this file-dp disables poll() usage even when available-sf/-st [pid ]* finishes/terminates old pids. Must be last arguments.Setup a small config file:
# cat haproxy.cfgglobaldaemonmaxconn 256
defaultsmode httptimeout connect 5000mstimeout client 50000mstimeout server 50000ms
frontend http-inbind *:80default_backend app1
backend app1server s1 10.0.1.10:80 maxconn 32server s2 10.0.1.11:80 maxconn 32server s3 10.0.1.12:80 maxconn 32
listen adminbind *:8080stats enableStop anything running on the ports you want to listen on:
# svcs -a | grep apachedisabled Oct_10 svc:/network/http:apache22Run the HAProxy binary and config:
# ./haproxy-1.4.24-pcre-solaris-sparc.notstripped -f ./haproxy.cfg# ps -ef | grep haproxyroot 20765 1 0 08:31:46 ? 0:00 ./haproxy-1.4.24-pcre-solaris-sparc.notstripped -f ./haproxy.cfgTest the stats page and the load balanced page you configured: