zoukankan      html  css  js  c++  java
  • lvs+dr模式(关键操作)

    1)  IP配置(配置回环接口添加虚拟ip,让他代为转发)

    /sbin/ifconfig lo:0 192.168.1.96 broadcast 192.168.1.96 netmask 255.255.255.255 up

    /sbin/ifconfig lo:1 192.168.1.97 broadcast 192.168.1.97 netmask 255.255.255.255 up

    /sbin/route add -host 192.168.1.96 dev lo:0

    /sbin/route add -host 192.168.1.97 dev lo:1

    写入配置文件,开机自动执行 /etc/rc.local

    1)  ARP(arp)抑制配置,让当客户端发送广播的时候,realserver闭嘴

    /etc/sysctl.conf

    net.ipv4.conf.lo.arp_ignore=1

    net.ipv4.conf.lo.arp_announce=2

    net.ipv4.conf.all.arp_ignore=1

    net.ipv4.conf.all.arp_announce=2

    Director配置1.101.98

    1)  keepalived配置

    #给出部分参考配置

    1.10

    ! Configuration File for keepalived

    global_defs {

      lvs_id BACKUP

    }

    vrrp_sync_group MAIL {

        group {

           VI_1_500

        }

    }

    vrrp_instance VI_1_500 {

             state BACKUP

        interface eth0

        virtual_router_id 95

      #1.98的优先级设置为100

    priority 150  

        advert_int 5

        authentication {

            auth_type PASS

            auth_pass 1111

        }

          virtual_ipaddress {

          192.168.1.96/24

          192.168.1.97/24

        }

    }

    ###############################################################

    #this virtual server is the setting of Email Server SMTP port

    ###############################################################

    virtual_server 192.168.1.97 25 {

       delay_loop 6

       lb_algo rr

       lb_kind DR

       persistence_timeout 50

       protocol TCP

       real_server 192.168.1.99 25 {

           weight 1

           TCP_CHECK {

                  connect_timeout 3

                  nb_get_retry 3

                  delay_before_retry 3

                  connect_port 25

                }

       }

    }

  • 相关阅读:
    Selenium快速入门(下)
    Selenium快速入门(上)
    Python中yield和yield from的用法
    Python多进程
    Spring Cloud微服务安全实战_3-5_API安全之常见问题
    Spring Cloud微服务安全实战_3-3_API安全之流控
    Spring Cloud微服务安全实战_3-2_第一个API及注入攻击防护
    Spring Cloud微服务安全实战_3-1_API安全 常见的安全机制
    Spring Cloud微服务安全实战_2-1_开发环境
    Spring Cloud微服务安全实战_1-1_导学
  • 原文地址:https://www.cnblogs.com/hixiaowei/p/8376685.html
Copyright © 2011-2022 走看看