xiayu 发表于 2018-11-15 11:00:19

nginx迁移

!Configuration File for keepalived  

  
global_defs{
  
    notification_email{
  
      liuhx@xinfushe.com
  
}
  
   notification_email_fromAlexandre.Cassen@firewall.loc
  
   smtp_server 192.168.0.109
  
   smtp_connect_timeout 30
  
   router_id LVS_02
  
}
  

  
vrrp_instanceVI_1 {
  
    state BACKUP
  
    interface eth1
  
    virtual_router_id 199
  
    priority 100
  
    advert_int 1
  
    authentication {
  
      auth_type PASS
  
      auth_pass 1098
  
    }
  
    virtual_ipaddress {
  
      124.205.3.180/29dev eth1 label eth1:2
  
    }
  
}
  

  
vrrp_instanceVI_2 {
  
    state BACKUP
  
    interface eth0
  
    virtual_router_id 198
  
    priority 100
  
    advert_int 1
  
    authentication {
  
      auth_type PASS
  
      auth_pass 1098
  
    }
  
    virtual_ipaddress {
  
       192.168.0.21/22 dev eth0 label eth0:1
  
    }
  
}
  

  
#ipvsadm-A -t 10.0.1.31:80 -s rr -p 300
  
virtual_server124.205.3.18080 {
  
    delay_loop 6
  
    lb_algo rr
  
    lb_kind NAT
  
    nat_mask 255.255.255.248
  
    persistence_timeout 50
  
    protocol TCP
  

  
#ipvsadm-a -t 10.0.1.31:80 -r 10.0.1.6:80 -g
  
    real_server 192.168.0.106 80 {
  
      weight 1
  
      TCP_CHECK {
  
      connect_timeout 8
  
      nb_get_retry 3
  
      delay_before_retry 3
  
      connect_port 80
  
      }
  
    }
  

  
    real_server 192.168.0.108 80 {
  
      weight 1
  
      TCP_CHECK {
  
      connect_timeout 8
  
      nb_get_retry 3
  
      delay_before_retry 3
  
      connect_port 80
  
      }
  
    }
  
}
  

  

  
virtual_server124.205.3.180443 {
  
    delay_loop 6
  
    lb_algo rr
  
    lb_kind NAT
  
    nat_mask 255.255.255.248
  
    persistence_timeout 0
  
    protocol TCP
  

  
    real_server 192.168.0.106 443 {
  
      weight 1
  
      TCP_CHECK {
  
                connect_timeout 8
  
                nb_get_retry 3
  
                delay_before_retry 3
  
                connect_port 443
  
                }
  
      }
  

  
    real_server 192.168.0.108 443 {
  
      weight 1
  
      TCP_CHECK {
  
                connect_timeout 8
  
                nb_get_retry 3
  
                delay_before_retry 3
  
                connect_port 443
  
                }
  
      }
  
}


页: [1]
查看完整版本: nginx迁移