! Configuration File for keepalived

global_defs {
   router_id MYSQL_MHA
}

vrrp_script chk_mysql_port {
    script "{$SERVER_PATH}/scripts/chk.sh mysql"
    interval 2
    weight –5            
    fall 2
    rise 1
}

vrrp_instance VI_MYSQL {
    state 这里所有节点定义为BACKUP
    interface {$ETH_XX}
    virtual_router_id 51
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        192.168.10.10
    }

    track_script {
       chk_mysql_port
    }
}