ycvodzf 发表于 2018-11-10 12:54:31

keepalived实现nginx的高可用

# cat/etc/keepalived/keepalived.conf  
! Configuration File for keepalived
  

  
global_defs {
  
   notification_email {
  
   acassen@firewall.loc
  
   failover@firewall.loc
  
   sysadmin@firewall.loc
  
   }
  
   notification_email_from Alexandre.Cassen@firewall.loc
  
   smtp_server 127.0.0.1
  
   smtp_connect_timeout 30
  
   router_id LVS_DEVEL
  
}
  

  
vrrp_script check_nginx {
  
    script "/opt/check_nginx.sh"
  
    interval 2
  
}
  

  
vrrp_instance VI_2 {
  
    state MASTER
  
    interface eth0
  
    virtual_router_id 52
  
    priority 100
  
    advert_int 1
  
    authentication {
  
      auth_type PASS
  
      auth_pass 1111
  
    }
  

  
    virtual_ipaddress {
  
      192.168.0.207
  
    }
  

  
    track_script {
  
      check_nginx
  
    }
  
}


页: [1]
查看完整版本: keepalived实现nginx的高可用