Sunday, August 22, 2010

Configure Heartbeat and Haproxy

  • ha.cf:
    #
    # keepalive: how many seconds between heartbeats
    #
    keepalive 2
    #
    # deadtime: seconds-to-declare-host-dead
    #
    deadtime 10
    #
    # What UDP port to use for udp or ppp-udp communication?
  • #
  • udpport 694
    bcast eth0
    mcast eth0 225.0.0.1 694 1 0
    ucast eth0 172.16.0.12# What interfaces to heartbeat over?
    udp eth0
    #
    # Facility to use for syslog()/logger (alternative to log/debugfile)
    #
    logfacility local0
    #
    # Tell what machines are in the cluster
    # node nodename … — must match uname -n
    node vpn-solusi
    #node lb2.mydomain.com
haresources:
vpn-solusi IPaddr::172.16.32.10/16/eth0/172.16.255.255
vpn-solusi IPaddr::172.16.32.11/16/eth0/172.16.255.255
#vpn-solusi IPaddr::172.16.32.13/16/eth0

authkeys:
auth 3
3 md5 somerandomstring

i haproxy.cfg:
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#debug
#quiet
user haproxy
group haproxydefaults
log global
mode http
option httplog
option dontlognull
retries 3
redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000

listen webfarm 172.16.32.10:80
mode http
stats enable
stats auth admin:admin
balance roundrobin
cookie JSESSIONID prefix
# cookie SERVERID insert nocache indirect
option httpclose
option forwardfor
option httpchk HEAD /index.php HTTP/1.0
server webA 172.16.0.10:80 cookie webA check maxconn 2 rise 1
server webB 172.16.0.130:80 cookie webB check maxconn 2 rise 1

Command IBM AIX

Chek Device:

  • lsdev –Cc adapter = untuk mengecek device seperti: fc, eth, dll
  • lscfg –vp fcs0|grep net = untuk mengecek fc
  • lsattr –El hdisk* = untuk mengecek spesifik hardisk
  • chdev –l hdisk* -a reverse_policy=no_reverse = kasih policy no reverse pada hardisk
  • lspv = untuk mengecek hardisk

Create Volume Group, Logical Volume, Format jfs2:

  • smit vg = membuat volume group
  • smit lv = membuat logical volume
  • smit jfs2 = format hardisk dengan fs jfs2