zoukankan      html  css  js  c++  java
  • Keepalived 安装

    一、首先确保一些核心参数配置正确

    修改 /etc/sysctl.conf的如下参数:

    net.ipv4.ip_forward=1

    net.ipv4.ip_nonlocal_bind = 1
    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

     sysctl -p /etc/sysctl.conf

    cat /proc/sys/net/ipv4/ip_forward

    cat /proc/sys/net/ipv4/ip_nonlocal_bind

    cat /proc/sys/net/ipv4/conf/lo/arp_ignore
    cat /proc/sys/net/ipv4/conf/lo/arp_announce
    cat /proc/sys/net/ipv4/conf/all/arp_ignore
    cat /proc/sys/net/ipv4/conf/all/arp_announce

    二、在主节点 修改keepalived.conf

    global_defs {
    notification_email{
    andy_hugb@hotmail.com
    }
    notification_email_from andy_hugb@163.com
    smtp_server mail.163.com
    smtp_connect_timeout 30
    router_id LVS_DEVEL
    }

    vrrp_instance VI_1 {
    state MASTER
    interface ens33
    virtual_router_id 51
    priority 100
    advert_int 1
    mcast_src_ip 192.168.222.132
    authentication {
    auth_type PASS
    auth_pass 8888
    }
    virtual_ipaddress {
    192.168.222.134/24 brd 192.168.222.255 dev ens33 label ens33:vip
    }
    }

    三、在备节点修改keepalived.conf

    global_defs {
    notification_email{
    andy_hugb@hotmail.com
    }
    notification_email_from andy_hugb@163.com
    smtp_server mail.163.com
    smtp_connect_timeout 30
    router_id LVS_DEVEL
    }

    vrrp_instance VI_1 {
    state BACKUP
    interface ens33
    virtual_router_id 51
    priority 100
    advert_int 1
    mcast_src_ip 192.168.222.133
    authentication {
    auth_type PASS
    auth_pass 8888
    }
    virtual_ipaddress {
    192.168.222.134/24 brd 192.168.222.255 dev ens33 label ens33:vip
    }
    }

  • 相关阅读:
    Android studio开发找不到HttpClient问题
    Android studio开发找不到HttpClient问题
    互联网应用之传递HTTP参数
    互联网应用之传递HTTP参数
    计算机组成原理
    计算机组成原理
    【NYOJ】[40]公约数和公倍数
    【NYOJ】[40]公约数和公倍数
    【NYOJ】[39]水仙花数
    【NYOJ】[39]水仙花数
  • 原文地址:https://www.cnblogs.com/hugb/p/5863073.html
Copyright © 2011-2022 走看看