设为首页 收藏本站
查看: 965|回复: 0

[经验分享] 使用LVS构建可伸缩WEB集群

[复制链接]
发表于 2019-1-5 15:12:32 | 显示全部楼层 |阅读模式
  原文:http://kb.linuxvirtualserver.org/wiki/Building_Scalable_Web_Cluster_using_LVS
Building Scalable Web Cluster using LVS
  使用LVS构建可伸缩WEB集群
Contents
  内容

  •   1 Introduction
  •   1 介绍
  •   2 Architecture
  •   2 体系结构
  •   3 Configuration Example
  •   3 配置示例
  •   4 Conclusion
  •   4 结论
  •   5 References
  •   5 引用
Introduction介绍

  Web cluster is a cluster system of more than one computer to provide HTTP and HTTPS service (also called web server farm). Clustering is the best approach to achieve the scalability, availability and>  Web集群是集群系统的多个计算机提供HTTP和HTTPS服务(也称为Web服务器农场)。聚类是最好的方法来达到可伸缩性、可用性和可靠性的web服务。
  Web cluster with many inexpensive commodity servers can easily handle large volumes of web requests, without creating unwanted delays. The number of servers can be added as workload is increasing.
  Web集群与许多便宜的商品服务器可以很容易地处理大量的Web请求,不创建不必要的延误。服务器可以添加为工作负载的数量正在增加。
Architecture
  The general architecture of LVS-based web cluster is illustrated in the following figure.
DSC0000.jpg

  The architecture has three ties:

  •   Load balancer, which usually use IP load balancing technologies for higher system throughput
  •   Web server pool, which actually perform HTTP and/or HTTPS services
  •   Shared storage, which can be database, network file system, distributed file system, or the hybrid ones.
  For dynamic web pages (such as PHP, JSP and ASP pages), data that is accessed by dynamic pages usually is stored in database system. The database service is running at stand-alone server, and is shared by all the web servers. No matter if multiple dynamic pages from a web server or different web servers access the same data, database engines provide atomicity and locking facility to serialize data access, so that it is easier to guarantee data consistency.
  The static files, such as HTML, graphics, and dynamic page scripts file, can be stored in network file system (NFS or CIFS) or distributed file system. Whether to choose network file system and distributed file system, it depends on system scale and the loading of file access. Through shared network file system and distributed file system, webmaster can see a single image of file storage space, so that it is easier to maintain those files, and any updates is effective for all the web servers.
  In this architecture of shared storage, system administrators can easily add new web servers to handle increasing load of web access, and do not need to copy the contents to local disks of new web servers.
  Most web sites may use HTTP cookie, which is to store cookie in client browser and send cookie to web server to track sessions from different HTTP request from the same browser. Once HTTP cookie is used, all the requests from a client must be sent to the same web server if web servers don't know their generated cookie sessions one another.
  Some web sites may use HTTPS protocol, which is to transfer HTTP over SSL (Secure Socket Layer) connection. When a SSL connection is made to port 443 for secure web service, a key for the connection must be chosen and exchanged. Since it is time consuming to negociate and generate the SSL key, the successive connections from the same client can also be granted by the server in the life span of the SSL key. Therefore, all the HTTPS requests from a client must be sent to the same server in the life span of the SSL key.
  Upon these connection affinity requirements, IPVS load balancer provides the persistent service feature, which is to send all the successive requests from the same client IP address to the same server in the specified time. The persistent service feature can help solve the connection affinity problem between client and server.
Configuration Example
  In the configuration example, we will have a LVS/NAT cluster of three web servers. The virtual IP address of load balancer is 10.23.8.80, and gateway ip address for internal web servers is 172.18.1.254. The ip addresses of three web servers are 172.18.1.11, 172.18.1.12 and 172.18.1.13 respectively. The web servers can run apache or other web server programs.
  We use the following ipvsadm commands to setup IPVS rules:
ipvsadm -A -t 10.23.8.80:80 -s wlc  
ipvsadm -a -t 10.23.8.80:80 -r 172.18.1.11 -m -w 100
  
ipvsadm -a -t 10.23.8.80:80 -r 172.18.1.12 -m -w 100
  
ipvsadm -a -t 10.23.8.80:80 -r 172.18.1.13 -m -w 100
  Then, use any computer outside the internal network (172.18.1.0/24) to access http://10.23.8.80/, and see whether it works or not. "ipvsadm -Ln" can be used to list the IPVS table, and "ipvsadm -Lcn" can be used to list the IPVS connections.

  Once the basic cluster configuration works, we can consider to use cluster management software to add>Conclusion
  It's easier to build web cluster using LVS and add scalability and availability into the web system.
References

  •   Comparison of web servers



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-659751-1-1.html 上篇帖子: 实现LVS负载均衡NAT模式 下篇帖子: LVS/LB直接路由负载均衡
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表