keepalived+lvs配置多个vip代理多个后端怎么配置 
时间: 2023-03-10 14:34:31 浏览: 68
可以使用keepalived来配置LVS,并将多个VIP代理到多个后端服务器。首先,需要在每个服务器上安装keepalived,然后在每个服务器上编辑keepalived.conf文件,配置VIP地址,网关地址和路由策略,然后启动keepalived服务即可。
相关问题
编写一段配置,实现keepalived+lvs配置多个vip代理多个后端怎么配置
下面是一段实现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
}
}
}
keepalived+lvs配置多个vip代理多个后端怎么配置,给我写个示例
首先,您需要在keepalived配置文件中添加一个virtual_server节点,其中包含虚拟IP(VIP)和服务器端口,如下所示:virtual_server 192.168.0.1 80 {# VIP和服务器端口delay_loop 6# 延迟时间lb_algo wrr # 负载均衡算法lb_kind DR # 负载均衡方式protocol TCP # 协议real_server 192.168.0.2 80 { # 后端服务器IP和端口weight 10 # 权重delay_loop 6 # 延迟时间}real_server 192.168.0.3 80 { # 后端服务器IP和端口weight 10 # 权重delay_loop 6 # 延迟时间}}
相关推荐














