通过keepalive配置高可用

keepalive 配置

! Configuration File for keepalived

global_defs {
   notification_email {
     [email protected]
   }
   notification_email_from [email protected]
   smtp_server 192.168.2.1
   smtp_connect_timeout 30
   router_id LVS_DEVEL
}


vrrp_script check_mysql {
   script "/root/check_cobar.sh"
   interval 2
   weight 10 
}


vrrp_instance  VI_mysql2 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100
    nopreempt 
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    track_script {

       check_mysql

   }    
    virtual_ipaddress {
	192.168.2.67
    }
}
 

猜你喜欢

转载自418684644-qq-com.iteye.com/blog/1664125