5d6d网 发表于 2018-10-8 09:01:51

How-to setup MySQL HA by using keepalived

! Configuration File for keepalived  
global_defs {
  
      notification_email {
  
      alexzeng@wordpress.com
  
      }
  
      notification_email_from alexzeng@wordpress.com
  
      smtp_server mx.wordpress.com
  
      smtp_connect_timeout 30
  
      router_id mysql-ha
  
      }
  

  
vrrp_script check_mysql {
  
   script "/mysql/keepalived_check.sh db02.wordpress.com"
  
   interval 2
  
   weight 2
  
}
  

  
vrrp_instance VI_1 {
  
      state BACKUP
  
      interface eth1
  
      virtual_router_id 51
  
      priority 100
  
      advert_int 1
  
      nopreempt# only needed on higher priority node
  
      authentication {
  
      auth_type PASS
  
      auth_pass 1111
  
      }
  

  
      track_script {
  
      check_mysql
  
      }
  
      virtual_ipaddress {
  
      10.0.0.1/24 dev eth1 label eth1:1
  
      }
  
      notify_master /mysql/keepalived_master.sh
  
      notify_backup /mysql/keepalived_backup.sh
  
}


页: [1]
查看完整版本: How-to setup MySQL HA by using keepalived