CentOS7配置VIP
CentOS7 两台做vip飘逸,实现虚拟ip的跳转
两台机器
首先下载ipvsadm 和 keepalived
- yum -y install ipvsadm keepalived
vim /etc/keepalived/keepalived.conf
- ! 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_skip_check_adv_addr
- vrrp_strict
- vrrp_garp_interval 0
- vrrp_gna_interval 0
- }
- vrrp_instance VI_1 {
- state MASTER #配置主 、 从 master backup
- interface ens33 #查看自己主机真实ip
- virtual_router_id 51
- priority 100 #优先级
- advert_int 1
- authentication {
- auth_type PASS
- auth_pass 1111
- }
- virtual_ipaddress {
- 192.168.189.181 #填写自己的虚拟ip
- }
- }
- virtual_server 192.168.189.181 80 { #虚拟ip
- delay_loop 6
- lb_algo rr
- lb_kind DR #DR模式
- net_mask 255.255.255.0 #网关
- protocol TCP
- real_server 192.168.189.137 80 { #真实地址ip1
- weight 1
- TCP_CHECK {
- connect_port 80 # 端口
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
- real_server 192.168.189.138 80 { #真实地址ip2
- weight 1
- TCP_CHECK {
- connect_port 80
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
- }
这一步完成即可看到vip的飘逸
下一步查看ipvsadm是否存在虚拟ip (vip 和 ip)
- ipvsadm -a -t 192.168.189.181:80 -r 192.168.189.137:80 -g
- ipvsadm -a -t 192.168.189.181:80 -r 192.168.189.138:80 -g
- ipvsadm -Ln
CentOS7配置VIP的更多相关文章
- Centos7 配置网络步奏详解
Centos7 配置网络步奏详解 编辑网卡配置文件 vi /etc/sysconfig/network-script/ifcfg-ens01 备注:这里的ens01不是所有系统都叫这个,有的可能叫其他 ...
- centos7配置开启无线网卡,重启防火墙
centos7配置无线网卡: 在虚拟机为nat的网络连接下(就是默认的那个),centos7默认网卡未激活. 可以设置 文件 /etc/sysconfig/network-scripts/ifcfg- ...
- 配置VIP地址
10.10.10.7 mysql主 redis从 10.10.10.8 mysql从 redis主 现游戏架构如上,游戏后端数据库配置集群.场景描述:若是一台服务器宕机之后,及时切换数据库保持业务 ...
- Centos7配置JAVA_HOME
Centos7配置JAVA_HOME http://blog.csdn.net/zzpzheng/article/details/73613838 在Centos7上,通过yum install ja ...
- Centos7配置NFS
centos7配置nfs yum -y install nfs-utils rpcbind 设置服务开机启动: systemctl enable rpcbind systemctl enable nf ...
- keepalived主备节点都配置vip,vip切换异常案例分析
原文地址:http://blog.51cto.com/13599730/2161622 参考地址:https://blog.csdn.net/qq_14940627/article/details/7 ...
- Centos7 配置ssh连接
Centos7 配置ssh连接 1.检查是否安装openssh-server:#yum list installed | grep openssh-server 安装openssh-server:#y ...
- CentOS7 配置静态 ip
1. 为 CentOS7 配置静态 ip 1.1 修改文件/etc/sysconfig/network-scripts/ifcfg-ens33 sudo vi /etc/sysconfig/netwo ...
- virtualbox 最小化安装centos7 配置双网卡(nat和桥接)记录----已经过期
该文章已经过期 请参考另一篇文章:virtualbox 安装centos7 配置桥接网卡,实现主机和虚拟机互通,虚拟机可以访问外网,解决无法上网问题 先说明一下为什么要配置双网卡? 配置nat ...
随机推荐
- 微信小程序路径表达式解析规则
小程序 setData 方法支持路径表达式来设置属性,例如 setData({"x.y.z": 1}). 微信官方没有公布路径表达式的语法规则及解析规则,本文所描述的路径表达式解析 ...
- CSP2019: Lost and Found
再不更就成鸽子了= = Day -INF to Day 0 不记得发生了什么 Day 1 今年HN用网上提交的方式收题?再也不怕因为交代码太晚增加省队名额了 开考看了一眼T1好像是模拟题,特地注意了\ ...
- 创建一个dotnetcore的SPA模板项目
MPA和SPA 对比 dotnet new --install Microsoft.AspNetCore.SpaTemplates::* 我这边用的是vue dotnet new vue dotnet ...
- java 基础 四种权限修饰符
/** * Java有四种权限修饰符: * public > protected > (default) > private * 同一个类 YES YES YES YES * 同一个 ...
- RabbitMQ学习之RPC(6)
在第二个教程中,我们了解到如何在多个worker中使用Work Queues分发费时的任务. 但是,如果我们需要在远程运行一个函数并且等待结果该怎么办呢?这个时候,我们需要另外一个模式了.这种模式通常 ...
- person类与其子类在使用中的内存情况(含java的改写和c#的屏蔽)
JAVA 普通person类及调用代码: public class Person { public String xm; public int nl; public void setme(String ...
- POST请求转换为PUT或者Delete请求、处理post请求乱码的过滤器、Get请求乱码
在web.xml中配置 <!--配置HiddenHttpMethodFilter : 将所有的POST请求转换为PUT或者Delete请求 --><filter> <fi ...
- SpringBoot中执行定时任务
一:在SpringBoot中使用定时任务相当的简单.首先,我们在启动类中加入@EnableScheduling来开启定时任务. @SpringBootApplication @EnableSchedu ...
- golang之数据转换
golang按位取反符号和异或符号都是^. fmt.Printf("0x%X\n", 0xFF^0x55) var a uint8 = 0x55 fmt.Printf(" ...
- 第十二周LINUX学习笔记
zabbix zabbix-server: 监听的端口10051 zabbix-agent: 10050 Zabbix: Item, Key(键) ethercard.traffic[eth0] ac ...