码迷,mamicode.com
首页 > 其他好文 > 详细

高可用4层lvs——keepalived

时间:2019-08-05 13:38:37      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:type   real   label   span   keepaliv   协议   priority   path   虚拟   

搭建方式:

node01:

ipvsadm -C

ifconfig eth0:2 down

---------------------------------

node01,node04安装keepalived

配置:

node01

/etc/keepalived/keepalived.conf

做个bak备份,再修改

vrrp 虚拟路由冗余协议

vrrp_instance VI_1 {
state MASTER    //node04 BACKUP
interface eth0
virtual_router_id 51      
priority 100    //node04 50
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.118.100/24 dev eth0 label eth0:3
}
}

real_server 192.168.118.12 80 {
        weight 1
        HTTP_GET {
            url {
              path / 
              status_code 200
            }
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
        }
    }

    real_server 192.168.118.13 80 {
        weight 1
        HTTP_GET {
            url {
              path /
              status_code 200
            }
            connect_timeout 3
            nb_get_retry 3
            delay_before_retry 3
        }
    }

 

高可用4层lvs——keepalived

标签:type   real   label   span   keepaliv   协议   priority   path   虚拟   

原文地址:https://www.cnblogs.com/littlepage/p/11302421.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!