1.Haproxy下载地址:
http://www.haproxy.org/ 截止目前最新版本为1.5.12
2、准备安装环境:
两个前端服务器安装HA和keepalived:
192.168.10.204
192.168.10.205
解决依赖关系:
yum install openssl
3、安装haproxyt:
解压安装包:
[[email protected] haproxy]#tar xvf haproxy-1.5.12.tar.gz
进入到解压路径:
[[email protected] haproxy]#cd haproxy-1.5.12
指定编译内核版本和安装路径:
[[email protected] haproxy]#make TARGET=linux26 PREFIX=/opt/haproxy
复制配置文件到安装路径下:
[[email protected] haproxy]#cp examples/haproxy.cfg /opt/haproxy/
启动服务:
[[email protected] haproxy]#/usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg
4.验证是否启动成功:
时间: 2024-11-04 17:14:53