LVS-DR+keepalived实现高可用负载均衡

注意 在做这一步前提时要吧 lvs-DR 这一步实现

参考我上一篇 博客

! Configuration File for keepalived


global_defs {
   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 {
      10.0.0.9
    }
}


virtual_server 10.0.0.9 80 {
    delay_loop 6
    lb_algo rr
    lb_kind DR
    persistence_timeout 50
    protocol TCP
    real_server 10.0.0.7 80 {
       weight 3                    
        TCP_CHECK {                 
            connect_timeout 10      
            nb_get_retry 3          
            delay_before_retry 3    
            connect_port 80
        }
        }
        real_server 10.0.0.8 80 {       weight 3                 
        TCP_CHECK {                 
            connect_timeout 10      
            nb_get_retry 3          
            delay_before_retry 3    
            connect_port 80
        }
        }


}



注意  10.0.0.4 只需要更该maste-->backup

权重调小就行

猜你喜欢

转载自blog.csdn.net/qq_39583463/article/details/80849042
今日推荐