Instalar HA Proxy en CentOS 7:
yum -q -y install wget gcc pcre-static pcre-devel
cd /usr/src wget http://www.haproxy.org/download/1.6/src/haproxy-1.6.11.tar.gz tar xzf haproxy-1.6.11.tar.gz cd haproxy-1.6.11 make TARGET=custom CPU=native USE_PCRE=1 USE_LIBCRYPT=1 USE_LINUX_SPLICE=1
make install cp /usr/local/sbin/haproxy /usr/sbin/
cp examples/haproxy.init /etc/init.d/haproxy chmod 755 /etc/init.d/haproxy mkdir -p /etc/haproxy mkdir -p /run/haproxy mkdir -p /var/lib/haproxy touch /var/lib/haproxy/stats useradd -r haproxy
haproxy -v
service haproxy start chkconfig haproxy on
Configuración para encapsular Netdata o cualquier otro backend con HAProxy, usuario: myuser password: mypassword
/etc/haproxy/haproxy.cfg
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
defaults
mode http
log global
option dontlognull
option httpclose
option httplog
option forwardfor
option redispatch
timeout connect 10000 # default 10 second time out if a backend is not found
timeout client 300000
timeout server 300000
maxconn 60000
retries 3
userlist netdata_users
group admin users myuser
user myuser insecure-password mypassword
frontend http-netdata
bind *:19998
default_backend netdata-server
acl auth_ok http_auth(netdata_users)
http-request auth unless auth_ok
backend netdata-server
server serverhttpd 127.0.0.1:19999 maxconn 64