zoukankan      html  css  js  c++  java
  • 三主机配置 keepalived VIP高可用

    三台主机:
    192.168.33.134
    192.168.33.136
    192.168.33.137
     
    实验前:
    关闭selinux 和iptables
     
     
    1). 192.168.33.134 配置
    #yum install keepalived
    #systemctl start keepalived
    #systemctl enable keepalived
     
    #cp vim /etc/keepalived/keepalived.conf{,.bak}
     
    #vim /etc/keepalived/keepalived.conf
    ! Configuration File for keepalived
     
    global_defs {
       notification_email {
          root@centos7.magedu.com
       }
       notification_email_from root@centos7.magedu.com
       smtp_server 127.0.0.1
       smtp_connect_timeout 30
       router_id centos7.magedu.com
       vrrp_skip_check_adv_addr
       vrrp_strict
       vrrp_garp_interval 0
       vrrp_gna_interval 0
       vrrp_iptables
    }
     
    vrrp_instance VIP_1 {
        state MASTER
        interface ens33
        virtual_router_id 51
        priority 100
        advert_int 1
        authentication {
            auth_type PASS
            auth_pass 1111
        }
        virtual_ipaddress {
            192.168.33.200 dev ens33 label ens33:0
        }
     
     
    2). 192.168.33.136 配置
    #yum install keepalived
    #systemctl start keepalived
    #systemctl enable keepalived
     
    #cp vim /etc/keepalived/keepalived.conf{,.bak}
     
    #vim /etc/keepalived/keepalived.conf
    ! Configuration File for keepalived
     
    global_defs {
       notification_email {
          root@centos7.magedu.com
       }
       notification_email_from root@centos7.magedu.com
       smtp_server 127.0.0.1
       smtp_connect_timeout 30
       router_id centos7.magedu.com
       vrrp_skip_check_adv_addr
       vrrp_strict
       vrrp_garp_interval 0
       vrrp_gna_interval 0
       vrrp_iptables
    }
     
    vrrp_instance VIP_1 {
        state BACKUP
        interface ens33
        virtual_router_id 51
        priority 50
        advert_int 1
        authentication {
            auth_type PASS
            auth_pass 1111
        }
        virtual_ipaddress {
            192.168.33.200 dev ens33 label ens33:0
        }
     
     
    3). 192.168.33.137配置
    #yum install keepalived
    #systemctl start keepalived
    #systemctl enable keepalived
     
    #cp vim /etc/keepalived/keepalived.conf{,.bak}
     
    #vim /etc/keepalived/keepalived.conf
    ! Configuration File for keepalived
     
    global_defs {
       notification_email {
          root@centos7.magedu.com
       }
       notification_email_from root@centos7.magedu.com
       smtp_server 127.0.0.1
       smtp_connect_timeout 30
       router_id centos7.magedu.com
       vrrp_skip_check_adv_addr
       vrrp_strict
       vrrp_garp_interval 0
       vrrp_gna_interval 0
       vrrp_iptables
    }
     
    vrrp_instance VIP_1 {
        state BACKUP
        interface ens33
        virtual_router_id 51
        priority 10
        advert_int 1
        authentication {
            auth_type PASS
            auth_pass 1111
        }
        virtual_ipaddress {
            192.168.33.200 dev ens33 label ens33:0
        }
    
    
     
     
     
    默认组播:抓包,看到流量是发往组播
    [root@centos7 ~]#tcpdump -i ens33 -nn host 224.0.0.18
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on ens33, link-type EN10MB (Ethernet), capture size 262144 bytes
    10:35:43.325499 IP 192.168.33.134 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 1s, length 20
    10:35:44.327673 IP 192.168.33.134 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 1s, length 20
    10:35:45.329368 IP 192.168.33.134 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 1s, length 20
    10:35:46.331697 IP 192.168.33.134 > 224.0.0.18: VRRPv2, Advertisement, vrid 51, prio 100, authtype simple, intvl 1s, leng

     

  • 相关阅读:
    PVT--无卷积密集预测的多功能backbone
    MobileNet系列之MobileNet_v3
    MobileNet系列之MobileNet_v2
    CVPR2021 | 开放世界的目标检测
    Siamese network总结
    文字识别OCR开源框架的对比--Tesseract vs EasyOCR
    CVPR2021|一个高效的金字塔切分注意力模块PSA
    Boltdb学习笔记之二--数据结构
    C++关键字之likely和unlikely
    Boltdb学习笔记之〇--概述
  • 原文地址:https://www.cnblogs.com/xiaohanlin/p/11064996.html
Copyright © 2011-2022 走看看