主配置文件:
! Configuration File for keepalived
global_defs {
router_id HA_MySQL_1}vrrp_script check_mysql{ script "/etc/keepalived/bin/mysql.sh" interval 10 weight -50 fall 3 rise 3}vrrp_instance VI_1 { state MASTER interface br0 virtual_router_id 51 priority 150 advert_int 1 nopreempt authentication { auth_type PASS auth_pass 1111 }track_script { check_mysql } virtual_ipaddress { 145.4.1.10/16 }}从配置文件:
! Configuration File for keepalived
global_defs {
router_id HA_MySQL_1}vrrp_script check_mysql{ script "/etc/keepalived/bin/mysql.sh" interval 10 weight -50 fall 3 rise 3}vrrp_instance VI_1 { state BACKUP interface br0 virtual_router_id 51 priority 100 advert_int 1 nopreempt authentication { auth_type PASS auth_pass 1111 }track_script { check_mysql } virtual_ipaddress { 145.4.1.10/16 }}