keepalived_LVS的配置

配置

! Configuration File for keepalived

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

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        192.168.57.100 dev eth0 label eth0:vip
    }
}
virtual_server 192.168.57.100 80 { 
    delay_loop 6 
    lb_algo rr                             #轮询调度算法 
    lb_kind DR 
    nat_mask 255.255.255.0 
    protocol TCP 

    real_server 192.168.57.4 80 { 
        weight 1 
        TCP_CHECK { 
            connect_timeout 3 
            nb_get_retry 3 
            delay_before_retry 3 
            connect_port 80 
        } 
    } 
    
   real_server 192.168.57.5 80 { 
        weight 1 
        TCP_CHECK { 
            connect_timeout 3 
            nb_get_retry 3 
            delay_before_retry 3 
            connect_port 80 
        } 
    } 
}

你可能感兴趣的:(keepalived_LVS的配置)