LVS知识搬运

本来想自己写一下的,奈何别人的blog写的太好了,再当一次搬运工

https://blog.51cto.com/13043516/2309505

https://blog.csdn.net/weixin_40470303/article/details/80541639

https://blog.csdn.net/Ki8Qzvka6Gz4n450m/article/details/79119665

https://www.cnblogs.com/liwei0526vip/p/6370103.html

http://www.it165.net/admin/html/201401/2248.html

https://blog.csdn.net/lupengfei1009/article/details/86514445

 

LVS负责调度,keepalved负责检查rs是否存活以及负载主备切换,只对keepalived配置即可,单独部署lvs需要手动添加规则

问题及解决:关于lvs+keepalived只加入一台realserver问题

https://www.cnblogs.com/LD-linux/p/lvs.html

就因为一个空格的事,搞这么半天

LVS性能优化及问题总结

http://blog.chinaunix.net/uid-25723371-id-4835004.html

keepalived配置文件

! 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 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.9.224
    }
}

virtual_server 192.168.9.224 443 {
    delay_loop 6
    lb_algo rr
    lb_kind NAT
    nat_mask 255.255.255.0
    protocol TCP

    real_server 192.168.12.127 443 {
        weight 1
	TCP_CHECK {
	connect_timeout 10
	nb_get_retry 3
	delay_before_retry 3
	connect_port 443
	}
    }
     real_server 192.168.12.72 443 {
        weight 1
	TCP_CHECK {
        connect_timeout 10
        nb_get_retry 3
        delay_before_retry 3
        connect_port 443
        }

    }
}

virtual_server 192.168.9.224 9443 {
    delay_loop 6
    lb_algo rr 
    lb_kind NAT
    protocol TCP

    real_server 192.168.12.127 9443 {
        weight 1
        TCP_CHECK {
        connect_timeout 10
        nb_get_retry 3
        delay_before_retry 3
        connect_port 9443
        }

    }

    real_server 192.168.12.72 9443 {
        weight 1
	TCP_CHECK {
        connect_timeout 10
        nb_get_retry 3
        delay_before_retry 3
        connect_port 9443
        }
               
    }
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值