This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangzhihan-device-manageme…/roles/ha_backup/templates/keepalived_backup.conf.j2

39 lines
922 B
Django/Jinja
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 OAMHA
}
#监控服务httpd, mysql等
vrrp_script check_service_health {
script "/etc/keepalived/check_service_health.sh"
#每2s检查一次
interval 3
#每次检查-10
weight -10
fail 3
#失败次数如果请求失败2次就认为此节点资源发生故障将进行切换
rise 1
#监测成功就立即成功,如果请求一次成功就默认此节点资源恢复正常
}
vrrp_instance VI_1 {
state {{ ha_backup.instance_state }}
interface {{ ha_backup.ethname }}
virtual_router_id {{ ha_backup.oam_virtual_router_id }}
priority 10
advert_int 1
authentication {
auth_type PASS
auth_pass oamha
}
virtual_ipaddress {
{{ ha_backup.virtual_ip }}
}
#触发的脚本
track_script {
check_service_health #检测脚本,上面配置的
}
}