lvs UDP端口负载均衡配置

! Configuration File for keepalived

global_defs {
notification_email {
[email protected]
}
notification_email_from [email protected]
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
#}
}
}

猜你喜欢

转载自www.cnblogs.com/uestc2007/p/10735005.html
今日推荐