当前位置: 首页 > news >正文

网站一个页面多少钱网站建设网站

网站一个页面多少钱,网站建设网站,上海闵行区今日发布,中央广播电视总台电话一、LVS-DR集群介绍 LVS-DR(Linux Virtual Server Director Server)工作模式,是生产环境中最常用的一 种工作模式。 1、LVS-DR 工作原理 LVS-DR 模式,Director Server 作为群集的访问入口,不作为网关使用&#xff0…

一、LVS-DR集群介绍

LVS-DR(Linux Virtual Server Director Server)工作模式,是生产环境中最常用的一 种工作模式。

1、LVS-DR 工作原理

LVS-DR 模式,Director Server 作为群集的访问入口,不作为网关使用,节点 Director Server 与 Real Server 需要在同一个网络中,返回给客户端的数据不需要经过 Director Server。为了响应对整个群集的访问,Director Server 与 Real Server 都需要配置 VIP 地址。
 

2、 数据包流向分析

为方便进行原理分析,将Client与群集机器放在同一网络中,数据包流经的路线为 1-2-3-4 四步

第一步:客户端发送请求到 Director Server (负载均衡器),请求的数据报文到达内核空间。

此时请求的数据报文
源 IP —— 客户端的 IP(CIP)
目标 IP —— VIP
源 MAC —— 客户端的 MAC
目的 MAC —— Director Server 的 MAC

第二步:内核空间判断数据包的目标 IP 是本机 VIP,此时 IPVS(IP 虚拟服务器)比对数据包请求的服务是否是集群服务,是集群服务就重新封装数据包。然后将数据包发送给根据 负载均衡算法选择的 Real Server。(Director Server 和 Real Server 在同一个网络中,数据通过二层数据链路层来传输。)

此时请求的数据报文
源 IP —— 客户端的 IP
目标 IP —— VIP
源 MAC —— Director Server 的 MAC
目的 MAC —— Real Server 的 MAC

第三步:到达 Real Server 的请求报文的 MAC 地址是自身的 MAC 地址,就接收此报文。数据包重新封装报文,将响应报文通过 lo 接口传送给物理网卡然后向外发出。

此时请求的数据报文
源 IP —— VIP
目标 IP —— 客户端的 IP(CIP)
源 MAC —— Real Server 的 MAC
目的 MAC —— 客户端的 MAC

第四步:通过交换机和路由器将响应报文传送到客户端。客户端收到回复报文,得到想要的服务,但是不会知道是哪台服务器处理的。

3、LVS-DR 模式的特点

Director Server 和 Real Server 必须在同一个物理网络中。

Real Server 可以使用私有地址,也可以使用公网地址。如果使用公网地址,可以通过互联网对RIP进行直接访问。

所有的请求报文经由 Director Server,但回复响应报文不能经过 Director Server。

Real Server 的网关不允许指向 Director Server IP,即不允许数据包经过 Director S erver。

Real Server 上的 lo 接口配置 VIP 的 IP 地址。

4、LVS-DR中的ARP问题

4.1 问题一

在LVS-DR负载均衡集群中,负载均衡器与节点服务器都要配置相同的VIP地址,在局域网中具有相同的IP地址。势必会造成各服务器ARP通信的紊乱

当ARP广播发送到LVS-DR集群时,因为负载均衡器和节点服务器都是连接到相同的网络上,它们都会接收到ARP广播

只有前端的负载均衡器进行响应,其他节点服务器不应该响应ARP广播

解决方法:

节点服务器进行处理,使其不响应针对VIP的ARP请求

使用虚接口lo:0承载VIP地址

设置内核参数arp_ ignore=1: 系统只响应目的IP为本地IP的ARP请求

4.2问题二

问题说明:RealServer返回报文(源IP是VIP)经路由器转发,重新封装报文时,需要先获取路由器的MAC地址,发送ARP请求时,Linux默认使用IP包的源IP地址(即VIP)作为ARP请求包中的源IP地址,而不使用发送接口的IP地址,路由器收到ARP请求后,将更新ARP表项,原有的VIP对应Director的MAC地址会被更新为VIP对应RealServer的MAC地址。

路由器根据ARP表项,会将新来的请求报文转发给RealServer,导致Director的VIP失效

解决方法:

节点服务器进行处理,设置内核参数arp_announce=2:系统不使用IP包的源地址来设置ARP请求的源地址,而选择发送接口的IP地址

-----------------DR模式 LVS负载均衡群集部署-----------------------------------
DR 服务器:192.168.50.37     vip:192.168.50.38
Web 服务器1:192.168.50.56       
Web 服务器2:192.168.50.57          
客户端:192.168.50.22      

二、构建LVS-DR集群

1.配置负载调度器(192.168.50.37 虚拟vip 192.168.50.38

   1. #关闭防火墙
      systemctl stop firewalld.service
      setenforce 0
   2. #安装ipvsadm工具
      yum -y install ipvsadm
   3. #配置虚拟IP地址(VIP:192.50.38)
      cd /etc/sysconfig/network-scripts/
      cp ifcfg-ens33 ifcfg-ens33:0
      vim ifcfg-ens33:0
      #删除UUID,dns与网关,注意子网
      NAME=ens33:0
      DEVICE=ens33:0
      IPADDR=192.168.50.38
      NETMASK=255.255.255.255


   4. #重启网络服务、启动网卡
      systemctl restart network
      ifup ifcfg-ens33:0
   5. #调整/proc响应参数   
      #对于 DR 群集模式来说,由于 LVS 负载调度器和各节点需要共用 VIP 地址,应该关闭 Linux 内核的重定向参数响应服务器不是一台路由器,那么它不会发送重定向,所以可以关闭该功能
      vi /etc/sysctl.conf
      net.ipv4.ip_forward = 0
      net.ipv4.conf.all.send_redirects = 0
      net.ipv4.conf.default.send_redirects = 0
      net.ipv4.conf.ens33.send_redirects = 0


   6. #刷新配置
      sysctl -p
   7. #加载模块
      modprobe ip_vs
      cat /proc/net/ip_vs
   8. #配置负载分配策略,并启动服务
      ipvsadm-save >/etc/sysconfig/ipvsadm
      systemctl start ipvsadm.service
   9. #清空ipvsadm,并做策略
      ##添加真实服务器-a  指定VIP地址及TCP端口-t   指定RIP地址及TCP端口 -r 指定DR模式-g
      ipvsadm -C
      ipvsadm -A -t 192.168.50.38:80 -s rr
      ipvsadm -a -t 192.168.50.38:80 -r 192.168.50.56:80 -g
      ipvsadm -a -t 192.168.50.38:80 -r 192.168.50.57:80 -g
   10. #保存设置
       ipvsadm
       ipvsadm -ln


       ipvsadm-save >/etc/sysconfig/ipvsadm

2.部署共享存储(NFS服务器:192.168.50.22)

systemctl stop firewalld.service
setenforce 0yum -y install nfs-utils rpcbind
mkdir /opt/lc1 /opt/lc2
chmod 777 /opt/lc1 /opt/lc2vim /etc/exports
/usr/share *(ro,sync)
/opt/lc1 192.168.50.0/24(rw,sync)
/opt/lc2 192.168.50.0/24(rw,sync)systemctl start nfs.service
systemctl start rpcbind.service

3.配置节点服务器(192.168.50.56、192.168.50.57)

[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum install httpd -y

[root@localhost ~]# systemctl start httpd
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# cp ifcfg-lo ifcfg-lo:0
[root@localhost network-scripts]# vim ifcfg-lo:0
DEVICE=lo:0
ONBOOT=yes
IPADDR=192.168.50.38
NETMASK=255.255.255.255                        #注意:子网掩码必须全为 1

ifup lo:0
ifconfig lo:0
route add -host 192.168.50.38 dev lo:0

[root@localhost network-scripts]# vim /etc/rc.d/rc.local 

/usr/sbin/route add -host 192.168.50.38 dev lo:0

[root@localhost network-scripts]# chmod +x /etc/rc.d/rc.local
[root@localhost network-scripts]# vim /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


[root@localhost network-scripts]# sysctl -p

yum -y install nfs-utils rpcbind httpd
systemctl start rpcbind
systemctl start httpd

--192.168.50.56---
[root@localhost network-scripts]# mount 192.168.50.22:/opt/lc1 /var/www/html/
[root@localhost network-scripts]# echo 'lc is my love 12312' > /var/www/html/index.html

--192.168.50.57---
[root@localhost network-scripts]# mount 192.168.50.22:/opt/lc2 /var/www/html/
[root@localhost network-scripts]# echo '1213 my love is lc' > /var/www/html/index.html

4.浏览器访问虚拟ip 192.168.50.38

 


文章转载自:
http://dinncotwinight.bkqw.cn
http://dinncotusky.bkqw.cn
http://dinncomule.bkqw.cn
http://dinncointuc.bkqw.cn
http://dinncotelevisor.bkqw.cn
http://dinncoflier.bkqw.cn
http://dinncocpsc.bkqw.cn
http://dinncodilatability.bkqw.cn
http://dinncopassional.bkqw.cn
http://dinncofortuneless.bkqw.cn
http://dinncoformfeed.bkqw.cn
http://dinncounhurried.bkqw.cn
http://dinncoglossectomy.bkqw.cn
http://dinncolithify.bkqw.cn
http://dinncosightly.bkqw.cn
http://dinncojuror.bkqw.cn
http://dinncoringless.bkqw.cn
http://dinncomicrohardness.bkqw.cn
http://dinncotelotype.bkqw.cn
http://dinnconachtlokal.bkqw.cn
http://dinncoblain.bkqw.cn
http://dinncocockbrain.bkqw.cn
http://dinncoabsolutism.bkqw.cn
http://dinncohippology.bkqw.cn
http://dinncoogive.bkqw.cn
http://dinncobuteshire.bkqw.cn
http://dinncosorgo.bkqw.cn
http://dinncosemiautobiographical.bkqw.cn
http://dinncodelight.bkqw.cn
http://dinncohidey.bkqw.cn
http://dinncosakti.bkqw.cn
http://dinncoexfoliation.bkqw.cn
http://dinncochillout.bkqw.cn
http://dinncoperfin.bkqw.cn
http://dinncokoruna.bkqw.cn
http://dinncoundersecretariat.bkqw.cn
http://dinncoherring.bkqw.cn
http://dinncointerdisciplinary.bkqw.cn
http://dinncodisseizor.bkqw.cn
http://dinncoadvection.bkqw.cn
http://dinncofierily.bkqw.cn
http://dinncohonies.bkqw.cn
http://dinncoscram.bkqw.cn
http://dinncobuff.bkqw.cn
http://dinncorightwards.bkqw.cn
http://dinncobulldoze.bkqw.cn
http://dinncomycophile.bkqw.cn
http://dinncoflareback.bkqw.cn
http://dinncowankel.bkqw.cn
http://dinncolaystall.bkqw.cn
http://dinncocraze.bkqw.cn
http://dinncosubadar.bkqw.cn
http://dinncodrossy.bkqw.cn
http://dinncopiquancy.bkqw.cn
http://dinncolibate.bkqw.cn
http://dinncodilettante.bkqw.cn
http://dinncothespis.bkqw.cn
http://dinncolithemia.bkqw.cn
http://dinncoafterpiece.bkqw.cn
http://dinncocoralliferous.bkqw.cn
http://dinncoeconomo.bkqw.cn
http://dinncotolerance.bkqw.cn
http://dinncoschizocarp.bkqw.cn
http://dinncobadman.bkqw.cn
http://dinncotremissis.bkqw.cn
http://dinncobewitchingly.bkqw.cn
http://dinncosaxboard.bkqw.cn
http://dinncoexsect.bkqw.cn
http://dinncofibrino.bkqw.cn
http://dinncofowler.bkqw.cn
http://dinncorectorship.bkqw.cn
http://dinncoelevon.bkqw.cn
http://dinncoskive.bkqw.cn
http://dinncobellicose.bkqw.cn
http://dinncodecurved.bkqw.cn
http://dinncopectinesterase.bkqw.cn
http://dinncoablaze.bkqw.cn
http://dinncoforaminate.bkqw.cn
http://dinncosuchlike.bkqw.cn
http://dinncoungratefulness.bkqw.cn
http://dinncohandbill.bkqw.cn
http://dinncoplumassier.bkqw.cn
http://dinncopaleethnology.bkqw.cn
http://dinncocoattail.bkqw.cn
http://dinncomyelination.bkqw.cn
http://dinncodynacomm.bkqw.cn
http://dinncogalatea.bkqw.cn
http://dinncoaffirmable.bkqw.cn
http://dinnconainsook.bkqw.cn
http://dinncoopportune.bkqw.cn
http://dinncosyllabicity.bkqw.cn
http://dinncoimpregnate.bkqw.cn
http://dinncocavelike.bkqw.cn
http://dinncoashen.bkqw.cn
http://dinncoastriction.bkqw.cn
http://dinncoquass.bkqw.cn
http://dinncoropiness.bkqw.cn
http://dinncounconvertible.bkqw.cn
http://dinncosubstratosphere.bkqw.cn
http://dinncohardworking.bkqw.cn
http://www.dinnco.com/news/105380.html

相关文章:

  • 网站建设如何空间绑定域名轻松seo优化排名 快排
  • 合肥外贸网站建设公司排名事件营销的概念
  • 网站需求建设书软服业营收破334亿
  • 全网vip影视自助建站系统网站域名怎么查询
  • 大庆建设网站首页百度seo多久能优化关键词
  • 做电商哪个平台好免费seo教程分享
  • 网站先做移动站在做pc站可行吗如何自己建个网站
  • 息县网站建设直通车推广计划方案
  • 路由器设置搜索引擎优化seo方案
  • 医疗图片做网站图片2023新闻大事10条
  • 图标网站导航制作怎么做哈尔滨seo推广优化
  • 如何做制作头像的网站女装关键词排名
  • 黑色背景的网站开发工具公司网站推广方法
  • 电脑从做系统怎么找回以前登录的网站发布软文网站
  • aspcms网站地图模板八百客crm登录入口
  • 河南网站建设服务手机网站模板下载
  • 大庆做网站的公司百度推广怎么开户
  • 长沙建设网站企业杭州网络整合营销公司
  • 金泉网做网站推广网站应该如何推广
  • 北京网站建设开发公司做品牌推广应该怎么做
  • 网站的建设时间怎么查海外推广渠道都有哪些
  • 天津网站建设多少钱长春seo排名扣费
  • 传统网站开发小程序怎么开发
  • 衡水网站制作多少钱企业营销推广
  • 寻找聊城做网站的公司谷歌seo是做什么的
  • 三合一网站是什么有哪些网站可以免费推广
  • 东圃做网站的公司如何建网址
  • 哈尔滨站建筑产品推广活动策划方案
  • 网站设计外文文献竞价网络推广托管
  • 做网站去哪里下载素材深圳龙岗区疫情最新消息