Lsyncd – Syncronizing Folder Master to Slave

Environment Centos 5.7 (Final) Server Requirement, I use 3 server Master Server : 192.168.1.51 Slave1 Server : 192.168.1.52 Slave2 Server : 192.168.1.53 Master Server : Install repository for lsyncd wget http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm Install lsyncd yum install lsyncd Set connection SSH without password between server ssh-keygen scp ~/.ssh/id_rsa.pub root@192.168.1.52:/tmp …

HAProxy – High Availability Load Balance

Environment

  • Centos 5.7 (Final)
  • Minimum Architecture requirement

  • Load Balance : 192.168.1.39
  • Web Server 01 : 192.168.1.41
  • Web Server 02 : 192.168.1.42
  • Load Balance Server
    Install repository

    wget http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
    rpm -ivh epel-release-5-4.noarch.rpm
    

    Install haproxy

    yum install haproxy
    

    Configure haproxy

    nano /etc/haproxy/haproxy.cfg
    global
    maxconn     4096 # Total Max Connections. This is dependent on ulimit
    daemon
    nbproc      4 # Number of processing cores. Dual Dual-core Opteron is 4 cores for example.
    defaults
    mode        http
    clitimeout  60000
    srvtimeout  30000
    contimeout  4000
    option      httpclose # Disable Keepalive
    
    listen  http_proxy *:80
    mode http
    stats enable
    stats auth admin:123456
    balance roundrobin
    cookie JSESSIONID prefix
    option httpclose
    option httpchk HEAD /check.txt HTTP/1.0
    option forwardfor # This sets X-Forwarded-For
    
    ## Define your servers to balance
    server Apps01 192.168.1.41:80 cookie Apps01 maxconn 300 check inter 3000 rise 3 fall 2
    server Apps02 192.168.1.42:80 cookie Apps02 maxconn 300 check inter 3000 rise 3 fall 2
    

    Client Server