CN104618508A - Load balancing mesh architecture based on Nginx, Memcached and Tomcat - Google Patents
Load balancing mesh architecture based on Nginx, Memcached and Tomcat Download PDFInfo
- Publication number
- CN104618508A CN104618508A CN201510088274.5A CN201510088274A CN104618508A CN 104618508 A CN104618508 A CN 104618508A CN 201510088274 A CN201510088274 A CN 201510088274A CN 104618508 A CN104618508 A CN 104618508A
- Authority
- CN
- China
- Prior art keywords
- memcached
- nginx
- tomcat
- load
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Stored Programmes (AREA)
Abstract
本发明公开了一种基于Nginx、Memcached、Tomcat负载均衡网状架构,属于应用程序开发领域。所述架构以Nginx作为负载均衡服务器,并缓存静态资源;Memcached分布式内存对象缓存系统作为共享同步会话中间件;Tomcat作为Web应用服务器,用于部署运行应用程序。与现有技术相比,本发明的架构设计能够将高并发访问分流到各个应用服务器处理,避免多业务集中在某一个应用服务器造成负载过重的现象,具有很好的推广应用价值。
The invention discloses a load balancing mesh architecture based on Nginx, Memcached and Tomcat, belonging to the field of application program development. The architecture uses Nginx as a load balancing server and caches static resources; Memcached distributed memory object cache system as a shared synchronization session middleware; Tomcat as a web application server for deploying and running applications. Compared with the prior art, the architecture design of the present invention can distribute high-concurrency access to each application server for processing, avoiding the phenomenon that multiple services are concentrated on a certain application server and causing overload, and has good promotion and application value.
Description
技术领域 technical field
本发明涉及应用程序开发领域,具体地说是一种基于Nginx、Memcached、Tomcat负载均衡网状架构。 The invention relates to the field of application program development, in particular to a load balancing mesh architecture based on Nginx, Memcached and Tomcat.
背景技术 Background technique
随着信息化的快速发展,信息的交流越来越方便了,可以说只要有一部手机就可以了解整个世界的动态。然而方便人们的同时,对于在后台的开发人员也带来的无穷的压力,不仅要保证应用程序的功能完善,还要在性能上做最好最优的设计,给用户提供轻便、快捷、安全的体验。 With the rapid development of informatization, the exchange of information has become more and more convenient. It can be said that as long as you have a mobile phone, you can understand the dynamics of the whole world. However, while it is convenient for people, it also brings endless pressure to the developers in the background. It is not only necessary to ensure that the functions of the application are perfect, but also to make the best and optimal design in terms of performance, so as to provide users with light, fast and safe experience.
现有技术中,实现均衡负载的方式有很多,不同的设计实现有不同的优缺点,比如会话的共享可以采用粘性Session的设计方式,性能上略胜于Memcached实现方式,缺点是一旦某一个应用服务器节点故障,其对应的所有业务将无法处理。 In the existing technology, there are many ways to achieve load balancing. Different designs have different advantages and disadvantages. For example, session sharing can adopt the sticky Session design method, which is slightly better than the Memcached implementation method in terms of performance. The disadvantage is that once a certain application If a server node fails, all its corresponding services will not be able to be processed.
发明内容 Contents of the invention
本发明的技术任务是针对上述现有技术的不足,提供一种基于Nginx、Memcached、Tomcat负载均衡网状架构。该架构设计是针对目前高并发访问、高容错的一种架构设计,可以将高并发访问分流到各个应用服务器处理,避免多业务集中在某一个应用服务器造成负载过重的现象。 The technical task of the present invention is to provide a load balancing mesh architecture based on Nginx, Memcached and Tomcat aiming at the above-mentioned deficiencies in the prior art. This architecture design is aimed at the current high-concurrency access and high fault-tolerant architecture design. It can distribute high-concurrency access to various application servers for processing, and avoid the phenomenon of heavy load caused by the concentration of multiple services on a certain application server.
本发明的技术任务是按以下方式实现的:一种基于Nginx、Memcached、Tomcat负载均衡网状架构,其特点是以Nginx作为负载均衡服务器,并缓存静态资源;Memcached分布式内存对象缓存系统作为共享同步会话中间件;Tomcat作为Web应用服务器,用于部署运行应用程序。 The technical task of the present invention is realized in the following manner: a kind of load-balanced mesh architecture based on Nginx, Memcached, Tomcat, which is characterized in that Nginx is used as a load-balanced server and caches static resources; Memcached distributed memory object caching system is used as a shared Synchronous session middleware; Tomcat is used as a web application server for deploying and running applications.
Nginx为轻量级且高性能的Web服务器/反向代理服务器,本发明的负载均衡网状架构里用作负载均衡服务器并缓存静态资源; Nginx is a lightweight and high-performance web server/reverse proxy server, which is used as a load balancing server and caches static resources in the load balancing mesh architecture of the present invention;
Memcached是一个高性能分布式内存对象缓存系统,本发明的负载均衡网状架构里用于多Web服务器节点间同步会话的中间件; Memcached is a high-performance distributed memory object caching system, and is used for the middleware of the synchronous session between the multiple Web server nodes in the load-balancing mesh architecture of the present invention;
Tomcat为现有技术中比较常用的Web应用服务器,本发明的负载均衡网状架构中用于部署运行应用程序。 Tomcat is a commonly used web application server in the prior art, and is used for deploying and running application programs in the load balancing mesh architecture of the present invention.
作为优选,本发明的网关架构中包括至少2个Nginx负载服务器。 Preferably, at least 2 Nginx load servers are included in the gateway framework of the present invention.
上述基于Nginx、Memcached、Tomcat负载均衡网状架构的搭建方法优选包括以下步骤: The above-mentioned construction method based on Nginx, Memcached, Tomcat load balancing mesh architecture preferably includes the following steps:
一、搭建Web应用集群:选网络中若干台机器安装tomcat应用服务器并部署应用程序,并确保各应用服务器能够正常独立运行; 1. Build a web application cluster: select several machines in the network to install tomcat application servers and deploy applications, and ensure that each application server can run normally and independently;
二、另选一台机器搭建M emcached分布式内存对象缓存系统,并在步骤一所述tomcat应用服务器配置中关联Memcached,实现session的共享;或者用magent缓存代理搭建Memcached集群,实现多个Memcached之间的数据共享; 2. Select another machine to build the Memcached distributed memory object cache system, and associate Memcached in the tomcat application server configuration described in step 1 to realize session sharing; or use the magent cache proxy to build a Memcached cluster to realize multiple Memcached data sharing between
三、搭建负载服务器Nginx:选至少两台机器安装Nginx,并在配置中配置各个Tomcat的映射配置,当用户请求时,负载服务器根据调度算法请求Web应用服务器,实现请求。 3. Build load server Nginx: select at least two machines to install Nginx, and configure the mapping configuration of each Tomcat in the configuration. When a user requests, the load server requests the Web application server according to the scheduling algorithm to realize the request.
本发明架构设计以多个Nginx负载均衡服务器同时为多个Web服务器服务,“多对多”模型,其中任何一个Nginx代理服务器或Web服务器故障都不会影响业务的正常运行,Memcached实现多个Web服务器会话共享,保证其中某个Web服务器故障,业务平滑移交其他正常服务器而不影响用户正常业务操作。 The architecture design of the present invention uses multiple Nginx load balancing servers to serve multiple Web servers at the same time, a "many-to-many" model, wherein any Nginx proxy server or Web server failure will not affect the normal operation of the business, and Memcached realizes multiple Web servers. Server session sharing ensures that one of the web servers fails, and the business is smoothly handed over to other normal servers without affecting the normal business operations of users.
与现有技术相比,本发明架构设计主要为应用程序高并发访问与高容错设计提供一种解决方案,可以将高并发访问分流到各个应用服务器处理,避免多业务集中在某一个应用服务器造成负载过重的现象。 Compared with the prior art, the architecture design of the present invention mainly provides a solution for the high concurrent access and high fault-tolerant design of the application program, which can distribute the high concurrent access to each application server for processing, and avoid the problem caused by the concentration of multiple services on a certain application server. Phenomenon of overload.
附图说明 Description of drawings
附图1是本发明基于Nginx、Memcached、Tomcat负载均衡网状架构实施例的架构拓扑简图。 Accompanying drawing 1 is that the present invention is based on Nginx, Memcached, Tomcat load-balancing mesh structure embodiment's architecture topology diagram.
具体实施方式 Detailed ways
参照说明书附图,以三个节点的实施例为例对本发明的基于Nginx、Memcached、Tomcat负载均衡网状架构作以下详细地说明。 With reference to the drawings in the description, taking the embodiment of three nodes as an example, the load balancing network architecture based on Nginx, Memcached, and Tomcat of the present invention will be described in detail below.
实施例: Example:
如附图1所示,该架构设计包括2个Nginx负载服务器、3个Tomcat应用服务器和1个Memcached。实际操作中可以配置更多的节点,还可以配置备用服务器、备用负载服务器、缓存集群等,使此架构设计更完美。 As shown in Figure 1, the architecture design includes 2 Nginx load servers, 3 Tomcat application servers and 1 Memcached. In actual operation, more nodes can be configured, and backup servers, backup load servers, cache clusters, etc. can be configured to make this architecture design more perfect.
上述架构设计中,其构成模块可分布在不同平台上运行,其搭建方法如下: In the above architecture design, its constituent modules can be distributed and run on different platforms. The construction method is as follows:
首先搭建Web应用集群,选网络中三台机器安装tomcat应用服务器并部署应用程序,并确保各应用服务器能够正常独立运行。 First of all, build a web application cluster, select three machines in the network to install the tomcat application server and deploy the application, and ensure that each application server can run normally and independently.
另选一台机器搭建Memcached分布式内存对象缓存系统,并在三台tomcat应用服务器配置中关联Memcached,实现session的共享,也可以用magent缓存代理搭建Memcached集群,实现多个Memcached之间的数据共享。 Choose another machine to build a Memcached distributed memory object cache system, and associate Memcached in the configuration of three tomcat application servers to realize session sharing. You can also use magent cache proxy to build a Memcached cluster to realize data sharing between multiple Memcached .
再搭建负载服务器Nginx,选两台或更多机器安装Nginx,并在配置中配置各个Tomcat的映射配置,这样当用户请求时,负载服务器会根据调度算法请求Web应用服务器,实现请求。 Then build the load server Nginx, select two or more machines to install Nginx, and configure the mapping configuration of each Tomcat in the configuration, so that when the user requests, the load server will request the web application server according to the scheduling algorithm to realize the request.
当应用集群中的某些节点故障,Nginx负载服务器会将业务移交给其他正常节点处理,并且因为Memcached实现Session的共享,其他节点可准确无误的继续完成业务处理而无需更多的操作。 When some nodes in the application cluster fail, the Nginx load server will hand over the business to other normal nodes for processing, and because Memcached implements session sharing, other nodes can continue to complete business processing without any further operations.
Claims (3)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510088274.5A CN104618508A (en) | 2015-02-26 | 2015-02-26 | Load balancing mesh architecture based on Nginx, Memcached and Tomcat |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510088274.5A CN104618508A (en) | 2015-02-26 | 2015-02-26 | Load balancing mesh architecture based on Nginx, Memcached and Tomcat |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN104618508A true CN104618508A (en) | 2015-05-13 |
Family
ID=53152783
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510088274.5A Pending CN104618508A (en) | 2015-02-26 | 2015-02-26 | Load balancing mesh architecture based on Nginx, Memcached and Tomcat |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104618508A (en) |
Cited By (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105357320A (en) * | 2015-12-09 | 2016-02-24 | 浪潮电子信息产业股份有限公司 | Multi-Web server load balancing system |
| CN106357549A (en) * | 2016-11-02 | 2017-01-25 | 郑州云海信息技术有限公司 | Method, device, system and load balancer for high-concurrency shunting in cluster deployment |
| CN106506677A (en) * | 2016-11-28 | 2017-03-15 | 杭州先手科技有限公司 | A kind of method and apparatus of data management |
| CN106790666A (en) * | 2017-01-20 | 2017-05-31 | 泰华智慧产业集团股份有限公司 | Load balancing mesh architecture and its build operation method |
| CN107038623A (en) * | 2017-03-30 | 2017-08-11 | 南京车喇叭信息科技有限公司 | A kind of processing method of electric business order in underlying services device framework |
| CN107426341A (en) * | 2017-09-13 | 2017-12-01 | 北京智芯微电子科技有限公司 | The system and method that APP interacts with service end |
| CN107734004A (en) * | 2017-09-26 | 2018-02-23 | 河海大学 | A kind of high concurrent SiteServer LBS based on Nginx, Redis |
| CN107872525A (en) * | 2017-11-09 | 2018-04-03 | 杭州东方通信软件技术有限公司 | A kind of micro services call framework |
| CN108920157A (en) * | 2018-06-13 | 2018-11-30 | 平安科技(深圳)有限公司 | Installation method, device, computer equipment and the storage medium of Nginx software |
| CN109284322A (en) * | 2018-09-06 | 2019-01-29 | 杭州途记科技有限公司 | A kind of data center |
| CN109951567A (en) * | 2019-04-02 | 2019-06-28 | 山东浪潮云信息技术有限公司 | A kind of Double Data center applications dispositions method |
| CN110020061A (en) * | 2018-08-21 | 2019-07-16 | 广州市城市规划勘测设计研究院 | A kind of smart city space time information cloud platform service-Engine |
| CN110535924A (en) * | 2019-07-31 | 2019-12-03 | 郑州地铁集团有限公司 | A kind of rail traffic server communications method and system |
| CN110995797A (en) * | 2019-11-19 | 2020-04-10 | 湖北民族大学 | Multilayer B/S and C/S mixed software system and asynchronous real-time communication method between layers |
| CN111526220A (en) * | 2020-07-06 | 2020-08-11 | 飞天诚信科技股份有限公司 | Method and system for processing information in high concurrency environment |
| CN112769884A (en) * | 2019-11-01 | 2021-05-07 | 普天信息技术有限公司 | Double-layer reverse proxy system and dynamic self-balancing adjusting method thereof |
| CN113630434A (en) * | 2021-06-19 | 2021-11-09 | 特瓦特能源科技有限公司 | Processing method for client access request and server |
| CN114726864A (en) * | 2022-04-08 | 2022-07-08 | 傲普(上海)新能源有限公司 | Nginx load balancing method, device, medium and equipment |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101702673A (en) * | 2009-11-10 | 2010-05-05 | 南京联创科技集团股份有限公司 | Load balancing method based on BS framework |
| US20100138542A1 (en) * | 2003-04-15 | 2010-06-03 | Davis Andrew T | Method of load balancing edge-enabled applications in a content delivery network (CDN) |
-
2015
- 2015-02-26 CN CN201510088274.5A patent/CN104618508A/en active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100138542A1 (en) * | 2003-04-15 | 2010-06-03 | Davis Andrew T | Method of load balancing edge-enabled applications in a content delivery network (CDN) |
| CN101702673A (en) * | 2009-11-10 | 2010-05-05 | 南京联创科技集团股份有限公司 | Load balancing method based on BS framework |
Non-Patent Citations (1)
| Title |
|---|
| 何京霖: "《基于B2C模式的移动电子商务平台的设计与实现》", 《万方-学位论文》 * |
Cited By (24)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105357320A (en) * | 2015-12-09 | 2016-02-24 | 浪潮电子信息产业股份有限公司 | Multi-Web server load balancing system |
| CN106357549B (en) * | 2016-11-02 | 2019-09-24 | 郑州云海信息技术有限公司 | Method, apparatus, system and the load balancer that high concurrent shunts in clustered deploy(ment) |
| CN106357549A (en) * | 2016-11-02 | 2017-01-25 | 郑州云海信息技术有限公司 | Method, device, system and load balancer for high-concurrency shunting in cluster deployment |
| CN106506677A (en) * | 2016-11-28 | 2017-03-15 | 杭州先手科技有限公司 | A kind of method and apparatus of data management |
| CN106790666A (en) * | 2017-01-20 | 2017-05-31 | 泰华智慧产业集团股份有限公司 | Load balancing mesh architecture and its build operation method |
| CN107038623A (en) * | 2017-03-30 | 2017-08-11 | 南京车喇叭信息科技有限公司 | A kind of processing method of electric business order in underlying services device framework |
| CN107426341A (en) * | 2017-09-13 | 2017-12-01 | 北京智芯微电子科技有限公司 | The system and method that APP interacts with service end |
| CN107734004A (en) * | 2017-09-26 | 2018-02-23 | 河海大学 | A kind of high concurrent SiteServer LBS based on Nginx, Redis |
| CN107872525B (en) * | 2017-11-09 | 2020-10-09 | 杭州东方通信软件技术有限公司 | Micro-service calling system |
| CN107872525A (en) * | 2017-11-09 | 2018-04-03 | 杭州东方通信软件技术有限公司 | A kind of micro services call framework |
| CN108920157B (en) * | 2018-06-13 | 2021-02-23 | 平安科技(深圳)有限公司 | Nginx software installation method and device, computer equipment and storage medium |
| CN108920157A (en) * | 2018-06-13 | 2018-11-30 | 平安科技(深圳)有限公司 | Installation method, device, computer equipment and the storage medium of Nginx software |
| CN110020061A (en) * | 2018-08-21 | 2019-07-16 | 广州市城市规划勘测设计研究院 | A kind of smart city space time information cloud platform service-Engine |
| CN109284322A (en) * | 2018-09-06 | 2019-01-29 | 杭州途记科技有限公司 | A kind of data center |
| CN109951567A (en) * | 2019-04-02 | 2019-06-28 | 山东浪潮云信息技术有限公司 | A kind of Double Data center applications dispositions method |
| CN110535924A (en) * | 2019-07-31 | 2019-12-03 | 郑州地铁集团有限公司 | A kind of rail traffic server communications method and system |
| CN110535924B (en) * | 2019-07-31 | 2023-02-07 | 郑州地铁集团有限公司 | Rail transit server communication method and system |
| CN112769884A (en) * | 2019-11-01 | 2021-05-07 | 普天信息技术有限公司 | Double-layer reverse proxy system and dynamic self-balancing adjusting method thereof |
| CN110995797B (en) * | 2019-11-19 | 2022-03-15 | 湖北民族大学 | Multilayer B/S and C/S mixed software system and asynchronous real-time communication method between layers |
| CN110995797A (en) * | 2019-11-19 | 2020-04-10 | 湖北民族大学 | Multilayer B/S and C/S mixed software system and asynchronous real-time communication method between layers |
| CN111526220A (en) * | 2020-07-06 | 2020-08-11 | 飞天诚信科技股份有限公司 | Method and system for processing information in high concurrency environment |
| CN111526220B (en) * | 2020-07-06 | 2020-10-13 | 飞天诚信科技股份有限公司 | Method and system for processing information in high concurrency environment |
| CN113630434A (en) * | 2021-06-19 | 2021-11-09 | 特瓦特能源科技有限公司 | Processing method for client access request and server |
| CN114726864A (en) * | 2022-04-08 | 2022-07-08 | 傲普(上海)新能源有限公司 | Nginx load balancing method, device, medium and equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104618508A (en) | Load balancing mesh architecture based on Nginx, Memcached and Tomcat | |
| CN103997526B (en) | A kind of expansible SiteServer LBS and method | |
| US10002141B2 (en) | Distributed database in software driven networks | |
| US10491523B2 (en) | Load distribution in data networks | |
| CN108476231B (en) | System and method for maintaining sessions via an intermediary device | |
| CN105393220B (en) | System and method for disposing dotted virtual server in group system | |
| US20180102945A1 (en) | Graceful scaling in software driven networks | |
| CN104253865B (en) | A kind of two-level management method of mixed type desktop cloud service platform | |
| US10326613B2 (en) | Method and system for processing spanning tree protocol (STP) state in a multichassis link aggregation (MLAG) domain | |
| Li et al. | Load balancing researches in SDN: A survey | |
| CN105391797A (en) | SDN-based cloud server load balancing method and device | |
| Shiraz et al. | Mobile cloud computing: critical analysis of application deployment in virtual machines | |
| CN103544319A (en) | Multi-tenant database sharing method and multi-tenant database as-a-service system | |
| US9851995B2 (en) | Hypervisor adjustment for host transfer between clusters | |
| CN103957237A (en) | Architecture of elastic cloud | |
| CN104301417B (en) | A kind of load-balancing method and device | |
| WO2017107483A1 (en) | Load balancing method for virtualized network management file downloading, and network management server | |
| CN104111874A (en) | High-concurrence high-reliability load balance software architecture design of virtual mainframe in cloud computing environment | |
| US10476779B1 (en) | Configuring a topology of devices to support scaling of an exchange point | |
| CN104348913A (en) | Tight-coupling extensible big data interaction method | |
| CN104462037A (en) | Consistency maintaining method in document collaborative editing | |
| CN204650507U (en) | Virtual resources integration platform in a kind of system for cloud computing | |
| CN102447609B (en) | Deployment method and device for dummy nodes in virtualized resource system | |
| CN103532816A (en) | Virtual network reliable mapping method capable of considering constraint of geographic position | |
| CN105227630A (en) | APACHE, MOD _ JK and TOMCAT based load balancing implementation mode |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20150513 |
|
| WD01 | Invention patent application deemed withdrawn after publication |