haproxy + keepalived

haproxy:

#tar xzf haproxy-1.5.11.tar.gz
#cd haproxy-1.5.11
#make TARGET=linux2628
#cp examples/haproxy.init /etc/init.d/haproxy
#chmod +x /etc/init.d/haproxy
#mkdir /etc/haproxy
#cp examples/haproxy.cfg /etc/haproxy/
#cp haproxy /usr/sbin/
#mkdir /usr/share/haproxy
#vim /etc/haproxy/haproxy.cfg #配置
#/etc/init.d/haproxy start

keepalived:

#tar xzf keepalived-1.2.15.tar.gz
#cd keepalived-1.2.15
#./configure && make && make install
#cp keepalived/etc/init.d/keepalived.sysconfig /etc/sysconfig/keepalived
#cp keepalived/etc/init.d/keepalived.init /etc/init.d/keepalived
#chmod +x /etc/init.d/keepalived
#mkdir /etc/keepalived/
#cp keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
#vim /etc/keepalived/keepalived.conf #配置# state的值:主(MASTER)、备(BACKUP),priority的值:主(100)、备(99)
#ln -s /usr/local/sbin/keepalived /usr/sbin/keepalived # Starting keepalived: /bin/bash: keepalived: command not found
#/etc/init.d/keepalived start