! Configuration File for keepalived
global_defs {
script_user root
router_id mysql
}
vrrp_instance mysql {
state BACKUP
interface bond0
virtual_router_id 64
priority 100
advert_int 1
nopreempt
authentication {
auth_type PASS
auth_pass "xxxx@123" #根据实际需求设置密码
}
# 虚拟 IP 池
virtual_ipaddress {
172.16.220.16
}
}
virtual_server 172.16.220.16 3306 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.0
persistence_timeout 60
protocol TCP
real_server 172.16.220.11 3306 {
weight 1
notify_down /etc/keepalived/check_localkeepalived.sh
TCP_CHECK {
connect_timeout 3
retry 3
delay_before_retry 3
connect_port 3306
}
}
}
相关文档
评论