Files
CmiiDeploy/4-广西移动项目/高可用配置/master高可用/keepalived-3.conf
zeaslity 437acbeb63 add
2024-10-30 16:30:51 +08:00

29 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

! Configuration File for keepalived
global_defs {
router_id master-3 ##标识节点的字符串通常为本机hostname
}
vrrp_script chk_apiserver {
script "/etc/keepalived/apiserver_check.sh" ##执行脚本位置
interval 2 ##检测时间间隔
weight -20 ##如果条件成立则权重减20
}
vrrp_instance VI_1 {
state BACKUP ## 主节点为MASTER备份节点为BACKUP-该配置非常重要
interface ens5 ## 绑定虚拟IP的网络接口网卡可以使用ifconfig查看
virtual_router_id 100 ## 虚拟路由ID号主备节点一定要相同-该配置非常重要
mcast_src_ip 10.165.81.70 ## 本机ip地址
priority 150 ##优先级配置0-254的值,一般主节点的权重大于备份节点
nopreempt
advert_int 2 ## 组播信息发送间隔俩个节点必须配置一致默认1s
authentication { ## 认证匹配
auth_type PASS
auth_pass woshinibaba
}
track_script {
chk_apiserver
}
virtual_ipaddress {
10.165.81.89 ## 虚拟ip
}
}