三台主机:
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

三主机配置 keepalived VIP高可用的更多相关文章

  1. centos安装与配置keepalived+nginx高可用

    一.安装启动keepalived 1.下载keepalived 在centos系统中,用wget下载最新版本: mkdir tool cd tool wget https://www.keepaliv ...

  2. 整合apache+tomcat+keepalived实现高可用tomcat集群

    Apache是一个强大的Web服务器在处理静态页面.处理大量网络客户请求.支持服务的种类以及可配置方面都有优势,高速并且强壮.但是没有JSP/Servlet的解析能力.整合Apache和Tomcat可 ...

  3. 项目实战3—Keepalived 实现高可用

    实现基于Keepalived高可用集群网站架构 环境:随着业务的发展,网站的访问量越来越大,网站访问量已经从原来的1000QPS,变为3000QPS,目前业务已经通过集群LVS架构可做到随时拓展,后端 ...

  4. 项目实战03:Keepalived 实现高可用

    目录 实验一:实现keepalived主从方式高可用基于LVS-DR模式的应用实战: 1.环境准备: 2.在lvs-server-master 主上 3.在lvs-server-backup 从上 4 ...

  5. Nginx keepalived实现高可用负载均衡详细配置步骤

    Keepalived是一个免费开源的,用C编写的类似于layer3, 4 & 7交换机制软件,具备我们平时说的第3层.第4层和第7层交换机的功能.主要提供loadbalancing(负载均衡) ...

  6. Linux 笔记 - 第十八章 Linux 集群之(三)Keepalived+LVS 高可用负载均衡集群

    一.前言 前两节分别介绍了 Linux 的高可用集群和负载均衡集群,也可以将这两者相结合,即 Keepalived+LVS 组成的高可用负载均衡集群,Keepalived 加入到 LVS 中的原因有以 ...

  7. 通过LVS+Keepalived搭建高可用的负载均衡集群系统

    1. 安装LVS软件      (1)安装前准备操作系统:统一采用Centos6.5版本,地址规划如下: 服务器名 IP地址 网关 虚拟设备名 虚拟ip Director Server 192.168 ...

  8. keepalived工作原理和配置说明 腾讯云VPC内通过keepalived搭建高可用主备集群

    keepalived工作原理和配置说明 腾讯云VPC内通过keepalived搭建高可用主备集群 内网路由都用mac地址 一个mac地址绑定多个ip一个网卡只能一个mac地址,而且mac地址无法改,但 ...

  9. haproxy+keepalived实现高可用负载均衡

    软件负载均衡一般通过两种方式来实现:基于操作系统的软负载实现和基于第三方应用的软负载实现.LVS就是基于Linux操作系统实现的一种软负载,HAProxy就是开源的并且基于第三应用实现的软负载. HA ...

随机推荐

  1. RCAN——Image Super-Resolution Using Very Deep Residual Channel Attention Networks

    1. 摘要 在图像超分辨领域,卷积神经网络的深度非常重要,但过深的网络却难以训练.低分辨率的输入以及特征包含丰富的低频信息,但却在通道间被平等对待,因此阻碍了网络的表示能力. 为了解决上述问题,作者提 ...

  2. ios 报错记录

    1. 运行xcode 报错:unterminated conditional directive #ifdef 缺少对应的#endif 在结尾加上就好了 2.iOS添加非(c,c++)文件引发的&qu ...

  3. LC 869. Reordered Power of 2

    Starting with a positive integer N, we reorder the digits in any order (including the original order ...

  4. js函数节流和防抖的理解与实现

    一:函数防抖1.理解:触发高频事件后n秒内函数只会执行一次,如果n秒内高频事件再次被触发,则重新计算时间2.思路:每次触发事件时都取消之前的延时调用方法 3.实现: function debounce ...

  5. kafka default partitioner java版本和scala版本的不同

    scala import kafka.utils._ class DefaultPartitioner(props: VerifiableProperties = null) extends Part ...

  6. 008-ICMP协议(网络控制文协议)

    一.概述 ICMP是(Internet Control Message Protocol)Internet控制报文协议.它是TCP/IP协议簇的一个子协议,用于在IP主机.路由器之间传递控制消息.控制 ...

  7. idea使用generatorconfig生成

    在maven工程中的resource中创建generatorConfigxml配置generatorConfigxml的配置pomxml生成对象的两种方式方式一使用idea的maven插件直接快速生成 ...

  8. 模板引擎总结(Thymeleaf,FreeMarker,Enjoy,Velocity,JSP等)

    在java领域,表现层技术主要有以下几种, (1)jsp; (2)freemarker; (3)velocity; (4)thymeleaf; (5)Enjoy; 1.JSP 优点: 1.功能强大,可 ...

  9. c# Winform WebBrowser的自动化模拟点击

    https://blog.csdn.net/vs920079469vs/article/details/78459025

  10. button与subit区别

    submit介绍   submit是button的一个特例,也是button的一种,它把提交这个动作自动集成了.如果表单在点击提交按钮后需要用JS进行处理(包括输入验证)后再提交的话,通常都必须把su ...