- yum -y install kernel-devel openssl-devel popt-devel
- rpm -ivh /mnt/Packgets/ipvsadm-1.25-9.el6.i686.rpm
- tar zxvf keepalived-1.2.2.tar.gz -C /usr/src/
- cd /usr/src/keepalived-1.2.2/
- ./configure --prefix=/ --with-kernel-dir=/usr/src/kernels/2.6.32-131.0.15.el6.i686
- make &&make install
- chkconfig --add keepalived
- chkconfig keepalived on
2. 配置调度器 (主: 192.168.13.95, 备: 192.168.13.96, 漂移 ip:192.168.13.100)web 服务器池 (节点 1:192.168.13.41, 节点 2:192.168.13.47)
1), 配置主 HA 调度服务器
- cd /etc/keepalived/
- cp keepalived.conf keepalived.conf.bak
- vi /etc/keepalived/keepalived.conf
- ################# 全局配置 #################33
- global_defs {
- router_id LVS_HA_R1
- }
- ################## 高可用 HA 的设置 ##############
- vrrp_instance VI_1 {
- state MASTER
- interface eth0
- virtual_route_id 1
- priority 100
- advert_int 1
- authentication {
- auth_type PASS
- auth_pass 123123
- }
- virtual_ipaddress {
- 192.168.13.100
- }
- }
- ################### 服务器池的配置 ######################
- virtual_server 192.168.13.100 80 {
- delay_loop 15
- lb_algo rr
- lb_kind DR
- protocol TCP
- real_server 192.168.13.41 80 {
- weight 1
- TCP_CHECK {
- connect_port 80
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 4
- }
- }
- real_server 192.168.13.41 80 {
- weight 1
- TCP_CHECK {
- connect_port 80
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 4
- }
- }
- }
来源: http://www.bubuko.com/infodetail-3091167.html