编写一段配置,实现keepalived+lvs配置多个vip代理多个后端怎么配置 
时间: 2023-03-10 19:25:25 浏览: 51
下面是一段实现keepalived lvs多个vip代理多个后端配置的示例:global_defs {
router_id LVS_DEVEL
}vrrp_script chk_httpd {
script "/etc/keepalived/check_httpd.sh"
interval 5
weight -2
}vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
xxx.xxx.xxx.xxx/xx
xxx.xxx.xxx.xxx/xx
xxx.xxx.xxx.xxx/xx
}
track_script {
chk_httpd
}
}virtual_server xxx.xxx.xxx.xxx 80 {
delay_loop 6
lb_algo wrr
lb_kind DR
persistent_timeout 30
protocol TCP
real_server xxx.xxx.xxx.xxx 80 {
weight 10
TCP_CHECK {
connect_timeout 10
connect_port 80
connect_timeout 10
}
}
real_server xxx.xxx.xxx.xxx 80 {
weight 10
TCP_CHECK {
connect_timeout 10
connect_port 80
connect_timeout 10
}
}
}
相关推荐


















