1.下载haproxy安装包haproxy-1.4.21.tar.gz
2.解压安装
#tar -zxvf haproxy-1.4.21.tar.gz
#cd haproxy-1.4.21
#more README ----查看与linux内核版本一致的参数
- linux22 for Linux 2.2
- linux24 for Linux 2.4 and above (default)
- linux24e for Linux 2.4 with support for a working epoll (> 0.21)
- linux26 for Linux 2.6 and above
- solaris for Solaris 8 or 10 (others untested)
- freebsd for FreeBSD 5 to 8.0 (others untested)
- openbsd for OpenBSD 3.1 to 4.6 (others untested)
- cygwin for Cygwin
- generic for any other OS.
- custom to manually adjust every setting
#make TARGET=linux26 PREFIX=/usr/local/haproxy
#make install PREFIX=/usr/local/haproxy
3.拷贝配置文件模板
#cp examples/haproxy.cfg /usr/local/haproxy/conf/
haproxy是http或tcp负载,调度算法也有好几种。后续会陆续更新完善。