1、haproxy +keepalived 部署
- 准备工作
- 准备安装包 haproxy-1.7.8.tar.gz 与 keepalived-2.0.18.tar.gz 包
- 准备服务器两台 192.168.20.112,192.168.20.113
- 准备浮动ip(同网段) 192.168.20.114
2、Harpoxy安装
- 解压 :命令: tar zxvf haproxy-1.7.8.tar.gz
- # cd haproxy-1.7.8
命令:# make PREFIX=/data/haproxy/configureHaproxy TARGET=linux2628
3、安装
命令: make install PREFIX=/data/harpoxy/configureHaproxy
执行完这一步/data/haproxy/ 路劲下面将会有个configureHaproxy 文件夹
PREFIX 为指定的安装路径
TARGET则根据当前操作系统内核版本指定
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
- linux2628 for Linux 2.6.28, 3.x, and above (enables splice and tproxy)
本文的操作系统内核版本为3.10.0,TARGET指定为 linux2628。
4、haproxy 配置
创建修改配置文件
命令: c