keepalived高可用双主配置文件
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了keepalived高可用双主配置文件相关的知识,希望对你有一定的参考价值。
###########################lb01
cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived_lb01
global_defs {
# notification_email {
# }
router_id LB01
}
vrrp_script check_lb {
script "/server/scripts/check_lb.sh"
interval 2
weight 2
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.3/24 dev eth0 label eth0:1
}
track_script {
check_lb
}
}
vrrp_instance VI_2 {
state MASTER
interface eth0
virtual_router_id 52
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.4/24 dev eth0 label eth0:2
}
}
#######################lb02
cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived_lb01
global_defs {
# notification_email {
# }
router_id LB01
}
vrrp_script check_lb {
script "/server/scripts/check_lb.sh"
interval 2
weight 2
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.3/24 dev eth0 label eth0:1
}
track_script {
check_lb
}
}
vrrp_instance VI_2 {
state BACKUP
interface eth0
virtual_router_id 52
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.4/24 dev eth0 label eth0:2
}
}
以上是关于keepalived高可用双主配置文件的主要内容,如果未能解决你的问题,请参考以下文章
Mysql5.7.22+Keepalived双主互备高可用集群