Posts Tagged “haproxy”:

HAProxy::Instalação e Configuração

Pessoal, nesse post irei demonstrar com instalar o HAProxy – TCP/HTTP Load Balance. Source Download `[lmascarenhas@myserver ~]# cd /usr/local/myapps/programs [lmascarenhas@myserver ~]# wget http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.26.tar.gz` Instalação `[lmascarenhas@myserver ~]# tar -vzxf haproxy-1.3.26.tar.gz [lmascarenhas@myserver ~]# cd haproxy-1.3.26 [lmascarenhas@myserver ~]# make TARGET=linux26 ARCH=i386 [lmascarenhas@myserver ~]# mkdir -p /usr/local/myapps/haproxy-1.3.26/sbin [lmascarenhas@myserver ~]# cd /opt/ [lmascarenhas@myserver ~]# ln -s /usr/local/myapps/haproxy-1.3.26 haproxy [lmascarenhas@myserver ~]# cd /usr/sbin/ [lmascarenhas@myserver ~]# ln -s /opt/haproxy/sbin/haproxy haproxy` Configuração `[lmascarenhas@myserver ~]# vim /etc/haproxy/haproxy.cfg` `global maxconn 20000 uid 0 gid 0 daemon nopoll noepoll pidfile /var/run/haproxy.pid quiet` defaults mode http option httplog option dontlognull retries 3 stats enable redispatch maxconn 20000 timeout client 300000 timeout connect 10000 timeout server 300000 #LOAD HTTP listen MyLOAD :80 mode http balance roundrobin log local1 option httplog option dontlognull option httpclose option forwardfor option httpchk HEAD /index_myload.html HTTP/1.0 server server01MyLoad :80 check inter 5000 weight 1 server server01MyLoad :80 check inter 5000 weight 1 stats uri /_stats stats realm Statistics\ for\ My\ LOAD\ HTTP stats auth admin:admin stats scope . stats scope MyLOAD Script de inicialização `[lmascarenhas@myserver ~]# vim /etc/init.d/haproxy #!/bin/sh # # chkconfig: - 85 15 # description: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited \ # for high availability environments. # processname: haproxy # config:... [Leia Mais]