lvs UDP端口负载均衡配置

本文详细介绍了Keepalived的配置文件结构,包括全局定义、实例设置、虚拟IP地址及服务器集群配置。通过具体参数说明了如何实现高可用的负载均衡方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

! Configuration File for keepalived

global_defs {
notification_email {
test@163.com
}
notification_email_from test@163.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
# LVS+Keepalived-B上更改为MHA-B
router_id MHA-A
}
vrrp_instance VI_1 {
# LVS+Keepalived-B上更改为BACKUP
state MASTER
interface eth0
virtual_router_id 51
# LVS+Keepalived-B上更改为100
priority 150
advert_int 5
authentication {
auth_type PASS
auth_pass 123456
}
virtual_ipaddress {
10.0.0.163/24
}
}

virtual_server 10.0.0.163 9997 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.0
persistence_timeout 500
protocol UDP
real_server 10.0.0.221 9997 {
weight 1
# TCP_CHECK {
# connect_port 9997
# connect_timeout 5
# nb_get_retry 3
# delay_before_retry 3
# }
}
real_server 10.0.0.223 9997 {
weight 1
#TCP_CHECK {
# connect_port 9997
# connect_timeout 5
# nb_get_retry 3
# delay_before_retry 3
#}
}
}

转载于:https://www.cnblogs.com/uestc2007/p/10735005.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值