CN106790692A - A kind of load-balancing method and device of many clusters - Google Patents
A kind of load-balancing method and device of many clusters Download PDFInfo
- Publication number
- CN106790692A CN106790692A CN201710090972.8A CN201710090972A CN106790692A CN 106790692 A CN106790692 A CN 106790692A CN 201710090972 A CN201710090972 A CN 201710090972A CN 106790692 A CN106790692 A CN 106790692A
- Authority
- CN
- China
- Prior art keywords
- load balancing
- cluster
- middleware
- unit
- node
- 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/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
- H04L67/1004—Server selection for load balancing
- H04L67/1014—Server selection for load balancing based on the content of a request
-
- 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/2866—Architectures; Arrangements
- H04L67/30—Profiles
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本申请涉及数据处理领域,特别是涉及一种多集群的负载均衡方法和装置。The present application relates to the field of data processing, in particular to a multi-cluster load balancing method and device.
背景技术Background technique
随着互联网、计算机技术的发展,针对企业的业务处理系统复杂程度很高,需要处理的业务量也很大,故一般业务处理系统中都会使用中间件集群。一个中间件集群是指包括了多个作为中间件的节点所组成的集群(Cluster),而作为中间件的节点可以是位于平台(例如硬件和操作系统)与应用或用户之间的处理设备,一个节点可以是一台服务器,也可以是数据库等设备。With the development of the Internet and computer technology, the business processing system for enterprises is highly complex and needs to handle a large amount of business. Therefore, middleware clusters are used in general business processing systems. A middleware cluster refers to a cluster (Cluster) composed of multiple nodes as middleware, and the nodes as middleware can be processing devices located between platforms (such as hardware and operating systems) and applications or users. A node can be a server, or a device such as a database.
由于一个中间件集群中包括有多个节点,故在通过中间件集群为用户提供服务时,为了提高处理效率,一个中间件集群中各个节点的负载需要保持均衡,故一般情况下,会为一个中间件集群配置一个负载均衡单元,由该负载均衡单元接收来自用户侧的外部请求,并通过一定的负载均衡策略将外部请求分配给该中间件集群中的各个节点处理。Since a middleware cluster includes multiple nodes, in order to improve processing efficiency when providing services to users through the middleware cluster, the load of each node in a middleware cluster needs to be balanced. Therefore, under normal circumstances, it will be a The middleware cluster is equipped with a load balancing unit, which receives external requests from the user side, and distributes the external requests to each node in the middleware cluster for processing through a certain load balancing strategy.
发明内容Contents of the invention
然而,由于一些业务量处理较大的业务处理系统一般会包括多个中间件集群,若需要为每一个中间件集群都单独配置一个负载均衡单元的话,会提高系统成本。However, since some business processing systems with large business volume generally include multiple middleware clusters, if a load balancing unit needs to be separately configured for each middleware cluster, the system cost will be increased.
为了解决上述技术问题,本申请提供了一种多集群的负载均衡方法和装置,实现了为多个中间件集群只需配置一个负载均衡单元,降低了系统成本。In order to solve the above technical problems, the present application provides a multi-cluster load balancing method and device, which realizes that only one load balancing unit needs to be configured for multiple middleware clusters, and reduces system cost.
本申请实施例公开了如下技术方案:The embodiment of the application discloses the following technical solutions:
第一方面,本申请实施例提供了一种多集群的负载均衡方法,应用于业务处理系统,所述业务处理系统包括多个中间件集群,所述多个中间件集群与一个负载均衡单元相连,所述方法包括:In the first aspect, the embodiment of the present application provides a multi-cluster load balancing method, which is applied to a business processing system, and the business processing system includes multiple middleware clusters, and the multiple middleware clusters are connected to a load balancing unit , the method includes:
所述负载均衡单元获取外部请求,所述外部请求携带目标集群的标识,所述目标集群为所述多个中间件集群中的一个中间件集群;The load balancing unit acquires an external request, the external request carries an identifier of a target cluster, and the target cluster is a middleware cluster among the plurality of middleware clusters;
所述负载均衡单元根据所述目标集群的标识查找配置文件,确定出与所述目标集群的标识对应的多个节点位置信息;The load balancing unit searches for a configuration file according to the identifier of the target cluster, and determines a plurality of node location information corresponding to the identifier of the target cluster;
所述负载均衡单元向目标节点分发所述外部请求,所述目标节点为所述负载均衡单元根据预设规则从所述多个节点位置信息中所选择的。The load balancing unit distributes the external request to a target node, and the target node is selected by the load balancing unit from the plurality of node location information according to preset rules.
可选的,还包括:Optionally, also include:
所述负载均衡单元预先收集所述多个中间件集群中各个节点的位置信息和所属中间件集群的标识;The load balancing unit pre-collects the location information of each node in the multiple middleware clusters and the identifier of the middleware cluster to which they belong;
所述负载均衡单元根据各个节点的位置信息和所属中间件集群的标识的对应关系配置所述配置文件。The load balancing unit configures the configuration file according to the corresponding relationship between the location information of each node and the identifier of the middleware cluster to which it belongs.
可选的,所述目标节点的位置信息包括所述目标节点的IP地址和端口信息,所述目标节点所属中间件集群的标识包括所述目标集群所提供的应用访问关键字。Optionally, the location information of the target node includes the IP address and port information of the target node, and the identifier of the middleware cluster to which the target node belongs includes an application access key provided by the target cluster.
可选的,所述负载均衡单元通过一个端口接收外部请求。Optionally, the load balancing unit receives external requests through a port.
可选的,所述负载均衡单元为Apache代理服务器。Optionally, the load balancing unit is an Apache proxy server.
第二方面,一种多集群的负载均衡装置,其特征在于,应用于业务处理系统,所述业务处理系统包括多个中间件集群,所述多个中间件集群与一个负载均衡单元相连,所述装置包括获取单元、查找单元和分发单元:In the second aspect, a multi-cluster load balancing device is characterized in that it is applied to a business processing system, and the business processing system includes multiple middleware clusters, and the multiple middleware clusters are connected to a load balancing unit, so The above device includes an acquisition unit, a search unit and a distribution unit:
所述获取单元,用于获取外部请求,所述外部请求携带目标集群的标识,所述目标集群为所述多个中间件集群中的一个中间件集群;The acquiring unit is configured to acquire an external request, where the external request carries an identifier of a target cluster, and the target cluster is a middleware cluster among the plurality of middleware clusters;
所述查找单元,用于根据所述目标集群的标识查找配置文件,确定出与所述目标集群的标识对应的多个节点位置信息;The search unit is configured to search for a configuration file according to the identifier of the target cluster, and determine a plurality of node location information corresponding to the identifier of the target cluster;
所述分发单元,用于向目标节点分发所述外部请求,所述目标节点为所述负载均衡单元根据预设规则从所述多个节点位置信息中所选择的。The distribution unit is configured to distribute the external request to a target node selected by the load balancing unit from the plurality of node location information according to preset rules.
可选的,还包括收集单元和配置单元:Optionally, also include collection unit and hive:
所述收集单元,用于预先收集所述多个中间件集群中各个节点的位置信息和所属中间件集群的标识;The collection unit is configured to pre-collect the location information of each node in the plurality of middleware clusters and the identifier of the middleware cluster to which they belong;
所述配置单元,用于根据各个节点的位置信息和所属中间件集群的标识的对应关系配置所述配置文件。The configuration unit is configured to configure the configuration file according to the corresponding relationship between the location information of each node and the identifier of the middleware cluster to which it belongs.
可选的,所述目标节点的位置信息包括所述目标节点的IP地址和端口信息,所述目标节点所属中间件集群的标识包括所述目标集群所提供的应用访问关键字。Optionally, the location information of the target node includes the IP address and port information of the target node, and the identifier of the middleware cluster to which the target node belongs includes an application access key provided by the target cluster.
可选的,所述负载均衡单元通过一个端口接收外部请求。Optionally, the load balancing unit receives external requests through a port.
可选的,所述负载均衡单元为Apache代理服务器。Optionally, the load balancing unit is an Apache proxy server.
由上述技术方案可以看出,在业务处理系统中,通过同一个负载均衡单元为多个中间件集群分发外部请求,实现负载均衡,其中当该负载均衡单元获取外部请求时,负载均衡单元根据配置文件,查找到与该外部请求所携带标识对应的目标集群,即该多个中间件集群中的一个,负载均衡单元可以根据预设的负载均衡规则从该目标集群的多个节点中确定出可以处理该外部请求的目标节点,并根据该目标节点的位置信息将该外部请求发送给该目标节点,从而实现了为多个中间件集群只需配置一个负载均衡单元,减少了系统资源的消耗,降低了系统成本。It can be seen from the above technical solutions that in the business processing system, the same load balancing unit distributes external requests for multiple middleware clusters to achieve load balancing. When the load balancing unit obtains external requests, the load balancing unit according to the configuration file, find the target cluster corresponding to the identification carried by the external request, that is, one of the multiple middleware clusters, and the load balancing unit can determine from the multiple nodes of the target cluster according to the preset load balancing rules Process the target node of the external request, and send the external request to the target node according to the location information of the target node, so that only one load balancing unit needs to be configured for multiple middleware clusters, reducing the consumption of system resources, Reduced system cost.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without any creative effort.
图1为本申请实施例提供的一种业务处理系统中多个中间件集群与负载均衡单元的连接关系示意图;FIG. 1 is a schematic diagram of the connection relationship between multiple middleware clusters and load balancing units in a service processing system provided by an embodiment of the present application;
图2为本申请实施例提供的一种多集群的负载均衡方法的方法流程图;FIG. 2 is a method flow chart of a multi-cluster load balancing method provided in an embodiment of the present application;
图3为本申请实施例提供的一种多集群的负载均衡装置的装置结构图。FIG. 3 is a device structure diagram of a multi-cluster load balancing device provided by an embodiment of the present application.
具体实施方式detailed description
下面结合附图,对本申请的实施例进行描述。Embodiments of the present application are described below in conjunction with the accompanying drawings.
在通过中间件集群进行业务处理的业务处理系统中,一般需要为每一个中间件集群单独配置一个负载均衡单元,以实现负载均衡的为中间件集群中节点分发外部请求,例如一个业务处理系统有十个中间件集群,则需要为这十个中间件集群配置十个负载均衡单元。In a business processing system that performs business processing through middleware clusters, it is generally necessary to configure a load balancing unit for each middleware cluster to achieve load balancing and distribute external requests to nodes in the middleware cluster. For example, a business processing system has If there are ten middleware clusters, ten load balancing units need to be configured for the ten middleware clusters.
然而,很多业务处理系统由于需要处理的业务量很大,会设置大量的中间件集群,如果为每一个中间件集群都单独配置一个负载均衡单元,维护大量的负载均衡单元会提高业务处理系统的搭建成本。However, many business processing systems will set up a large number of middleware clusters due to the large amount of business that needs to be processed. If a load balancing unit is configured for each middleware cluster, maintaining a large number of load balancing units will improve the performance of the business processing system. Build costs.
为此,本申请实施例提供了一种多集群的负载均衡方法和装置,在业务处理系统中,通过同一个负载均衡单元为多个中间件集群分发外部请求,实现负载均衡,其中当该负载均衡单元获取外部请求时,负载均衡单元根据配置文件,查找到与该外部请求所携带标识对应的目标集群,即该多个中间件集群中的一个,负载均衡单元可以根据预设的负载均衡规则从该目标集群的多个节点中确定出可以处理该外部请求的目标节点,并根据该目标节点的位置信息将该外部请求发送给该目标节点,从而实现了为多个中间件集群只需配置一个负载均衡单元,减少了系统资源的消耗,降低了系统成本。To this end, the embodiment of the present application provides a multi-cluster load balancing method and device. In the business processing system, the same load balancing unit distributes external requests for multiple middleware clusters to achieve load balancing. When the load When the balance unit obtains an external request, the load balance unit finds the target cluster corresponding to the identifier carried by the external request according to the configuration file, that is, one of the multiple middleware clusters, and the load balance unit can use the preset load balance rule Determine the target node that can handle the external request from the multiple nodes of the target cluster, and send the external request to the target node according to the location information of the target node, so as to realize the configuration for multiple middleware clusters A load balancing unit reduces system resource consumption and system cost.
在本申请实施例的业务处理系统中,其系统组成和连接结构与传统的业务处理系统有所不同。本申请的业务处理系统包括有多个中间件集群,每个中间件集群中包括了多个节点,有别于传统方式中一个中间件集群配置一个负载均衡单元,本申请中可以将多个中间件集群统一配置一个负载均衡单元,本申请并不限定将一个业务处理系统中包括的所有中间件集群都配置同一个负载均衡单元,只需要其中有多个中间件集群统一配置在一个负载均衡单元即可,例如一个业务处理系统包括十个中间件集群,可以为这十个中间件集群统一配置一个负载均衡单元,这种情况下,该业务处理系统中包括一个负载均衡单元。也可以为这十个中间件集群中六个中间件集群统一配置一个负载均衡单元,为剩余四个中间件集群统一配置另一个负载均衡单元,这种情况下,该业务处理系统中包括两个负载均衡单元。也可以为这十个中间件集群中八个中间件集群统一配置一个负载均衡单元,为剩余两个中间件集群分别独立配置一个负载均衡单元,这种情况下,该业务处理系统中包括三个负载均衡单元。也就是说,通过实施本申请实施例的技术方案,在本申请实施例中的业务处理系统中,负载均衡单元的数量显然要小于中间件集群的数量。In the business processing system of the embodiment of the present application, its system composition and connection structure are different from traditional business processing systems. The business processing system of this application includes multiple middleware clusters, and each middleware cluster includes multiple nodes, which is different from the traditional way in which one middleware cluster is configured with one load balancing unit. In this application, multiple intermediate One load balancing unit is uniformly configured for each middleware cluster. This application does not limit all middleware clusters included in a business processing system to be configured with the same load balancing unit. It only needs to have multiple middleware clusters uniformly configured in one load balancing unit. That is, for example, if a business processing system includes ten middleware clusters, one load balancing unit may be uniformly configured for the ten middleware clusters. In this case, the business processing system includes one load balancing unit. It is also possible to uniformly configure a load balancing unit for six middleware clusters among the ten middleware clusters, and configure another load balancing unit for the remaining four middleware clusters. In this case, the business processing system includes two Load balancing unit. It is also possible to uniformly configure a load balancing unit for eight middleware clusters among the ten middleware clusters, and independently configure a load balancing unit for the remaining two middleware clusters. In this case, the business processing system includes three Load balancing unit. That is to say, by implementing the technical solution of the embodiment of the present application, in the business processing system in the embodiment of the present application, the number of load balancing units is obviously smaller than the number of middleware clusters.
图1所示的是本申请实施例提供的一种业务处理系统中多个中间件集群与负载均衡单元的连接关系示意图。为了方便展示,图1中所示的是业务处理系统中的三个中间件集群,该三个中间件集群100与一个负载均衡单元200相连,由该负载均衡单元200为这三个中间件集群100提供外部请求的分发,以及向外部返回根据外部请求处理得到的响应内容的服务。在图1中,负载均衡单元200可以是一个硬件设备,例如Apache代理服务器,负载均衡单元200也可以是安装在服务器等数据处理设备上的程序或软件,例如能够实现负载均衡功能的软件。FIG. 1 is a schematic diagram of the connection relationship between multiple middleware clusters and load balancing units in a business processing system provided by an embodiment of the present application. For the convenience of display, shown in Fig. 1 are three middleware clusters in the business processing system, these three middleware clusters 100 are connected with a load balancing unit 200, by this load balancing unit 200 for these three middleware clusters 100 provides services of distributing external requests and returning to the outside the response content processed according to the external requests. In FIG. 1, the load balancing unit 200 may be a hardware device, such as an Apache proxy server, and the load balancing unit 200 may also be a program or software installed on a data processing device such as a server, such as software capable of implementing a load balancing function.
接下来说明本申请实施例的负载均衡的实现过程,图2为本申请实施例提供的一种多集群的负载均衡方法的方法流程图,可以应用于例如图1所示的业务处理系统中,所述方法包括:Next, the implementation process of load balancing in the embodiment of the present application is described. FIG. 2 is a method flow chart of a multi-cluster load balancing method provided in the embodiment of the present application, which can be applied to, for example, the business processing system shown in FIG. 1 . The methods include:
S201:所述负载均衡单元获取外部请求,所述外部请求携带目标集群的标识,所述目标集群为所述多个中间件集群中的一个中间件集群。S201: The load balancing unit acquires an external request, where the external request carries an identifier of a target cluster, and the target cluster is a middleware cluster in the plurality of middleware clusters.
这里所述的外部请求主要是指来自于业务处理系统外部的请求,这类外部请求需要业务处理系统中中间件集群的节点进行处理,有些情况下,需要根据处理结果向外部请求的发送方返回相应的内容(响应)。外部请求例如可以包括由用户发出的访问某个网页所生成的请求,而通过处理而返回的相应内容可以是存储在节点上的该网页内容。The external requests mentioned here mainly refer to requests from outside the business processing system. Such external requests need to be processed by the nodes of the middleware cluster in the business processing system. In some cases, they need to be returned to the sender of the external request according to the processing results. The corresponding content (response). The external request may include, for example, a request generated by a user to access a certain webpage, and the corresponding content returned through processing may be the content of the webpage stored on the node.
由于该外部请求一般是根据一定的目的或访问需求生成的,故当负载均衡单元接收到外部请求时,可以通过该外部请求所携带的标识明确该外部请求希望访问的是与负载均衡单元相连的哪一个中间件集群,或者说明确需要接收该外部请求的中间件集群是与负载均衡单元相连的中间件集群中的哪一个。Since the external request is generally generated according to a certain purpose or access requirement, when the load balancing unit receives the external request, it can be determined through the identification carried by the external request that the external request wants to access the server connected to the load balancing unit. Which middleware cluster, or specifically which middleware cluster needs to receive the external request is which one of the middleware clusters connected to the load balancing unit.
该外部请求可以是由用户发送的,例如图1中的用户A、用户B和用户C中的任意一个。The external request may be sent by a user, such as any one of user A, user B, and user C in FIG. 1 .
S202:所述负载均衡单元根据所述目标集群的标识查找配置文件,确定出与所述目标集群的标识对应的多个节点位置信息。S202: The load balancing unit searches for a configuration file according to the identifier of the target cluster, and determines a plurality of node location information corresponding to the identifier of the target cluster.
举例说明,负载均衡单元具有预先设置的配置文件,该配置文件中包括了与该负载均衡单元相连的中间件集群、以及这些中间件集群中各个节点的相关信息,故负载均衡单元可以根据该配置文件查找到可以接收该外部请求的目标集群,以及该目标集群中各个节点的位置信息。For example, the load balancing unit has a preset configuration file, which includes the middleware clusters connected to the load balancing unit and the relevant information of each node in these middleware clusters, so the load balancing unit can The file finds the target cluster that can receive the external request, and the location information of each node in the target cluster.
该配置文件可以是负载均衡单元预设获取的,也可以是由该负载均衡单元预先采集并配置得到的。本申请实施例提供了一种预先采集配置得到该配置文件的方式。可选的,所述负载均衡单元预先收集所述多个中间件集群中各个节点的位置信息和所属中间件集群的标识;所述负载均衡单元根据各个节点的位置信息和所属中间件集群的标识的对应关系配置所述配置文件。The configuration file may be acquired by the load balancing unit by default, or may be pre-collected and configured by the load balancing unit. The embodiment of the present application provides a way to acquire the configuration file in advance. Optionally, the load balancing unit pre-collects the location information of each node in the plurality of middleware clusters and the identification of the middleware cluster to which it belongs; Configure the configuration file for the corresponding relationship.
其中,中间件集群中各个节点的位置信息用于标识节点在网络或局域网中的位置,例如可以包括节点的IP地址和端口信息,而中间件集群的标识可以用于标识中间件集群,以区别于其他中间件集群,例如可以是应用访问关键字。Wherein, the position information of each node in the middleware cluster is used to identify the position of the node in the network or local area network, for example, may include the IP address and port information of the node, and the identification of the middleware cluster may be used to identify the middleware cluster to distinguish For other middleware clusters, for example, it may be an application access keyword.
以图1中的三个中间件集群为例,分别为Cluster1,Cluster2和Cluster3,每个中间件集群均包括两个节点,那么与这三个中间件集群相连的负载均衡单元预先收集的中间件集群的相关信息可以如表1所示:Take the three middleware clusters in Figure 1 as an example, respectively Cluster1, Cluster2 and Cluster3, each middleware cluster includes two nodes, then the middleware pre-collected by the load balancing unit connected to these three middleware clusters The relevant information of the cluster can be shown in Table 1:
表1Table 1
负载均衡单元可以利用所收集的上述信息配置出配置文件。当负载均衡单元具体为Apache代理服务器时,该配置文件可以是http.conf,若采集到的信息为表1中的内容,那么可以根据如下格式配置http.conf:The load balancing unit can use the collected above information to configure a configuration file. When the load balancing unit is specifically an Apache proxy server, the configuration file can be http.conf. If the collected information is the content in Table 1, then http.conf can be configured according to the following format:
LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.soLoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.soLoadModule proxy_http_module modules/mod_proxy_http.so
并可以在http.conf的文件末尾添加如下内容:And you can add the following content at the end of the http.conf file:
S203:所述负载均衡单元向目标节点分发所述外部请求,所述目标节点为所述负载均衡单元根据预设规则从所述多个节点位置信息中所选择的。S203: The load balancing unit distributes the external request to a target node, and the target node is selected by the load balancing unit from the plurality of node location information according to preset rules.
该预设规则可以是预先设定的负载均衡规则,例如可以是轮流为节点分发外部请求,也可以是相同类型的外部请求分发给同一个节点等,本申请对此不进行限定。总之,负载均衡单元可以根据预设规则从目标集群中确定出一个用于接收该外部请求的节点,即目标节点。相应的,在S202中预先采集了该目标节点的位置信息,可以包括所述目标节点的IP地址和端口信息,该目标节点所属中间件集群的标识包括该目标集群所提供的应用访问关键字。The preset rule may be a preset load balancing rule, for example, it may distribute external requests to nodes in turn, or it may distribute external requests of the same type to the same node, etc., which is not limited in this application. In short, the load balancing unit can determine a node for receiving the external request from the target cluster according to preset rules, that is, the target node. Correspondingly, the location information of the target node is pre-collected in S202, which may include the IP address and port information of the target node, and the identifier of the middleware cluster to which the target node belongs includes the application access key provided by the target cluster.
在从配置文件中确定出该目标节点的位置信息后,可以根据该位置信息将该外部请求分发到该目标节点处,由该目标节点处理该外部请求。After the location information of the target node is determined from the configuration file, the external request can be distributed to the target node according to the location information, and the external request is processed by the target node.
可见,在业务处理系统中,通过同一个负载均衡单元为多个中间件集群分发外部请求,实现负载均衡,其中当该负载均衡单元获取外部请求时,负载均衡单元根据配置文件,查找到与该外部请求所携带标识对应的目标集群,即该多个中间件集群中的一个,负载均衡单元可以根据预设的负载均衡规则从该目标集群的多个节点中确定出可以处理该外部请求的目标节点,并根据该目标节点的位置信息将该外部请求发送给该目标节点,从而实现了为多个中间件集群只需配置一个负载均衡单元,减少了系统资源的消耗,降低了系统成本。It can be seen that in the business processing system, the same load balancing unit distributes external requests for multiple middleware clusters to achieve load balancing. When the load balancing unit obtains an external request, the load balancing unit finds the The target cluster corresponding to the identification carried by the external request is one of the multiple middleware clusters, and the load balancing unit can determine the target that can process the external request from multiple nodes of the target cluster according to the preset load balancing rules Node, and send the external request to the target node according to the location information of the target node, so that only one load balancing unit needs to be configured for multiple middleware clusters, reducing the consumption of system resources and system cost.
需要注意的是,由于负载均衡单元可以通过配置文件区分出接收到的外部请求由哪个中间件集群进行处理,故该负载均衡单元可以仅通过一个端口用于接收外部请求。由此,多个中间件集群只需要提供一个端口的访问连接,减少了配置有负载均衡单元的服务器以及配置有中间件集群的服务器在公共网络上暴露的风险,从根本上提升了服务器的安全。It should be noted that since the load balancing unit can distinguish which middleware cluster the received external request is processed by using the configuration file, the load balancing unit can only receive external requests through one port. As a result, multiple middleware clusters only need to provide access to one port, which reduces the risk of servers configured with load balancing units and servers configured with middleware clusters being exposed on the public network, and fundamentally improves server security. .
图3为本申请实施例提供的一种多集群的负载均衡装置的装置结构图,应用于业务处理系统,所述业务处理系统包括多个中间件集群,所述多个中间件集群与一个负载均衡单元相连,所述装置包括获取单元301、查找单元302和分发单元303:Fig. 3 is a device structure diagram of a multi-cluster load balancing device provided by an embodiment of the present application, which is applied to a business processing system, and the business processing system includes multiple middleware clusters, and the multiple middleware clusters are connected to a load The equalization unit is connected, and the device includes an acquisition unit 301, a search unit 302 and a distribution unit 303:
获取单元301,用于获取外部请求,所述外部请求携带目标集群的标识,所述目标集群为所述多个中间件集群中的一个中间件集群。The acquiring unit 301 is configured to acquire an external request, where the external request carries an identifier of a target cluster, and the target cluster is a middleware cluster in the plurality of middleware clusters.
查找单元302,用于根据所述目标集群的标识查找配置文件,确定出与所述目标集群的标识对应的多个节点位置信息。The searching unit 302 is configured to search a configuration file according to the identifier of the target cluster, and determine a plurality of node location information corresponding to the identifier of the target cluster.
分发单元303,用于向目标节点分发所述外部请求,所述目标节点为所述负载均衡单元根据预设规则从所述多个节点位置信息中所选择的。The distribution unit 303 is configured to distribute the external request to a target node selected by the load balancing unit from the plurality of node location information according to preset rules.
可选的,还包括收集单元和配置单元:Optionally, also include collection unit and hive:
所述收集单元,用于预先收集所述多个中间件集群中各个节点的位置信息和所属中间件集群的标识;The collection unit is configured to pre-collect the location information of each node in the plurality of middleware clusters and the identifier of the middleware cluster to which they belong;
所述配置单元,用于根据各个节点的位置信息和所属中间件集群的标识的对应关系配置所述配置文件。The configuration unit is configured to configure the configuration file according to the corresponding relationship between the location information of each node and the identifier of the middleware cluster to which it belongs.
可选的,所述目标节点的位置信息包括所述目标节点的IP地址和端口信息,所述目标节点所属中间件集群的标识包括所述目标集群所提供的应用访问关键字。Optionally, the location information of the target node includes the IP address and port information of the target node, and the identifier of the middleware cluster to which the target node belongs includes an application access key provided by the target cluster.
可选的,所述负载均衡单元通过一个端口接收外部请求。Optionally, the load balancing unit receives external requests through a port.
可选的,所述负载均衡单元为Apache代理服务器。Optionally, the load balancing unit is an Apache proxy server.
可见,在业务处理系统中,通过同一个负载均衡单元为多个中间件集群分发外部请求,实现负载均衡,其中当该负载均衡单元获取外部请求时,负载均衡单元根据配置文件,查找到与该外部请求所携带标识对应的目标集群,即该多个中间件集群中的一个,负载均衡单元可以根据预设的负载均衡规则从该目标集群的多个节点中确定出可以处理该外部请求的目标节点,并根据该目标节点的位置信息将该外部请求发送给该目标节点,从而实现了为多个中间件集群只需配置一个负载均衡单元,减少了系统资源的消耗,降低了系统成本。It can be seen that in the business processing system, the same load balancing unit distributes external requests for multiple middleware clusters to achieve load balancing. When the load balancing unit obtains an external request, the load balancing unit finds the The target cluster corresponding to the identification carried by the external request is one of the multiple middleware clusters, and the load balancing unit can determine the target that can process the external request from multiple nodes of the target cluster according to the preset load balancing rules Node, and send the external request to the target node according to the location information of the target node, so that only one load balancing unit needs to be configured for multiple middleware clusters, reducing the consumption of system resources and system cost.
需要注意的是,由于负载均衡单元可以通过配置文件区分出接收到的外部请求由哪个中间件集群进行处理,故该负载均衡单元可以仅通过一个端口用于接收外部请求。由此,多个中间件集群只需要提供一个端口的访问连接,减少了配置有负载均衡单元的服务器以及配置有中间件集群的服务器在公共网络上暴露的风险,从根本上提升了服务器的安全。It should be noted that since the load balancing unit can distinguish which middleware cluster the received external request is processed by using the configuration file, the load balancing unit can only receive external requests through one port. As a result, multiple middleware clusters only need to provide access to one port, which reduces the risk of servers configured with load balancing units and servers configured with middleware clusters being exposed on the public network, and fundamentally improves server security. .
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质可以是下述介质中的至少一种:只读存储器(英文:read-only memory,缩写:ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps to realize the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the execution includes: The steps of the above-mentioned method embodiments; and the aforementioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviation: ROM), RAM, magnetic disk or optical disk, etc. can store medium for program code.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备及系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It should be noted that each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. place. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiments. The device and system embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上所述,仅为本申请的一种具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应该以权利要求的保护范围为准。The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or Replacement should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710090972.8A CN106790692A (en) | 2017-02-20 | 2017-02-20 | A kind of load-balancing method and device of many clusters |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710090972.8A CN106790692A (en) | 2017-02-20 | 2017-02-20 | A kind of load-balancing method and device of many clusters |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106790692A true CN106790692A (en) | 2017-05-31 |
Family
ID=58958882
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710090972.8A Pending CN106790692A (en) | 2017-02-20 | 2017-02-20 | A kind of load-balancing method and device of many clusters |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106790692A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108111590A (en) * | 2017-12-15 | 2018-06-01 | 安徽长泰信息安全服务有限公司 | A kind of data handling system and its method based on more service nodes |
CN109582451A (en) * | 2018-11-21 | 2019-04-05 | 金色熊猫有限公司 | Task scheduling method, system, device and readable medium |
CN109842651A (en) * | 2017-11-27 | 2019-06-04 | 中国移动通信集团上海有限公司 | A kind of continual load-balancing method of business and system |
CN110166429A (en) * | 2019-04-12 | 2019-08-23 | 深圳壹账通智能科技有限公司 | Data package processing method, device, computer readable storage medium and server |
CN110442447A (en) * | 2019-07-05 | 2019-11-12 | 中国平安人寿保险股份有限公司 | Load-balancing method, device and computer equipment based on message queue |
CN110515731A (en) * | 2019-08-22 | 2019-11-29 | 北京浪潮数据技术有限公司 | A kind of data processing method, apparatus and system |
CN110727653A (en) * | 2019-10-12 | 2020-01-24 | 广州华多网络科技有限公司 | Multi-project load balancing method and device |
CN110995656A (en) * | 2019-11-06 | 2020-04-10 | 深信服科技股份有限公司 | Load balancing method, device, equipment and storage medium |
CN111045830A (en) * | 2020-03-18 | 2020-04-21 | 成都数联铭品科技有限公司 | Multi-cluster uniform resource distribution system and method |
CN111464574A (en) * | 2019-01-21 | 2020-07-28 | 阿里巴巴集团控股有限公司 | Calling, loading, registering and managing method and route, server, node and medium |
CN113094182A (en) * | 2021-05-18 | 2021-07-09 | 联想(北京)有限公司 | Load balancing processing method and device for service and cloud server |
CN113326100A (en) * | 2021-06-29 | 2021-08-31 | 深信服科技股份有限公司 | Cluster management method, device and equipment and computer storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104023082A (en) * | 2014-06-23 | 2014-09-03 | 浪潮电子信息产业股份有限公司 | Method for achieving cluster load balance |
CN105357090A (en) * | 2015-11-10 | 2016-02-24 | 中国建设银行股份有限公司 | Load balancing method and device for externally-connected bus service system |
CN105635199A (en) * | 2014-10-28 | 2016-06-01 | 广州睿哲网络科技有限公司 | Method and device for implementation of self-organization cluster server supporting load balancing |
CN105915650A (en) * | 2016-06-21 | 2016-08-31 | 腾讯科技(深圳)有限公司 | Load balancing method and device |
US20160261508A1 (en) * | 2013-03-13 | 2016-09-08 | International Business Machines Corporation | Load balancing for a virtual networking system |
US20160261463A1 (en) * | 2001-07-24 | 2016-09-08 | International Business Machines Corporation | Dynamic http load balancing |
-
2017
- 2017-02-20 CN CN201710090972.8A patent/CN106790692A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160261463A1 (en) * | 2001-07-24 | 2016-09-08 | International Business Machines Corporation | Dynamic http load balancing |
US20160261508A1 (en) * | 2013-03-13 | 2016-09-08 | International Business Machines Corporation | Load balancing for a virtual networking system |
CN104023082A (en) * | 2014-06-23 | 2014-09-03 | 浪潮电子信息产业股份有限公司 | Method for achieving cluster load balance |
CN105635199A (en) * | 2014-10-28 | 2016-06-01 | 广州睿哲网络科技有限公司 | Method and device for implementation of self-organization cluster server supporting load balancing |
CN105357090A (en) * | 2015-11-10 | 2016-02-24 | 中国建设银行股份有限公司 | Load balancing method and device for externally-connected bus service system |
CN105915650A (en) * | 2016-06-21 | 2016-08-31 | 腾讯科技(深圳)有限公司 | Load balancing method and device |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109842651B (en) * | 2017-11-27 | 2021-11-26 | 中国移动通信集团上海有限公司 | Uninterrupted service load balancing method and system |
CN109842651A (en) * | 2017-11-27 | 2019-06-04 | 中国移动通信集团上海有限公司 | A kind of continual load-balancing method of business and system |
CN108111590A (en) * | 2017-12-15 | 2018-06-01 | 安徽长泰信息安全服务有限公司 | A kind of data handling system and its method based on more service nodes |
CN109582451A (en) * | 2018-11-21 | 2019-04-05 | 金色熊猫有限公司 | Task scheduling method, system, device and readable medium |
CN111464574B (en) * | 2019-01-21 | 2022-10-21 | 阿里巴巴集团控股有限公司 | Calling, loading, registering and managing method and route, server, node and medium |
CN111464574A (en) * | 2019-01-21 | 2020-07-28 | 阿里巴巴集团控股有限公司 | Calling, loading, registering and managing method and route, server, node and medium |
CN110166429A (en) * | 2019-04-12 | 2019-08-23 | 深圳壹账通智能科技有限公司 | Data package processing method, device, computer readable storage medium and server |
CN110166429B (en) * | 2019-04-12 | 2022-03-22 | 深圳壹账通智能科技有限公司 | Data packet processing method and device, computer readable storage medium and server |
CN110442447A (en) * | 2019-07-05 | 2019-11-12 | 中国平安人寿保险股份有限公司 | Load-balancing method, device and computer equipment based on message queue |
CN110442447B (en) * | 2019-07-05 | 2023-07-28 | 中国平安人寿保险股份有限公司 | Message queue-based load balancing method and device and computer equipment |
CN110515731A (en) * | 2019-08-22 | 2019-11-29 | 北京浪潮数据技术有限公司 | A kind of data processing method, apparatus and system |
CN110727653B (en) * | 2019-10-12 | 2023-06-16 | 广州华多网络科技有限公司 | Multi-project load balancing method and device |
CN110727653A (en) * | 2019-10-12 | 2020-01-24 | 广州华多网络科技有限公司 | Multi-project load balancing method and device |
CN110995656B (en) * | 2019-11-06 | 2022-08-05 | 深信服科技股份有限公司 | Load balancing method, device, equipment and storage medium |
CN110995656A (en) * | 2019-11-06 | 2020-04-10 | 深信服科技股份有限公司 | Load balancing method, device, equipment and storage medium |
CN111045830A (en) * | 2020-03-18 | 2020-04-21 | 成都数联铭品科技有限公司 | Multi-cluster uniform resource distribution system and method |
CN113094182A (en) * | 2021-05-18 | 2021-07-09 | 联想(北京)有限公司 | Load balancing processing method and device for service and cloud server |
CN113094182B (en) * | 2021-05-18 | 2024-02-27 | 联想(北京)有限公司 | Service load balancing processing method and device and cloud server |
CN113326100A (en) * | 2021-06-29 | 2021-08-31 | 深信服科技股份有限公司 | Cluster management method, device and equipment and computer storage medium |
CN113326100B (en) * | 2021-06-29 | 2024-04-09 | 深信服科技股份有限公司 | Cluster management method, device, equipment and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106790692A (en) | A kind of load-balancing method and device of many clusters | |
US20220210035A1 (en) | Systems and methods for performing end-to-end link-layer and ip-layer health checks between a host machine and a network virtualization device | |
US11777897B2 (en) | Cloud infrastructure resources for connecting a service provider private network to a customer private network | |
US9910687B2 (en) | Data flow affinity for heterogenous virtual machines | |
US10511484B1 (en) | Membership self-discovery in distributed computing environments | |
US11876710B2 (en) | Dynamic IP routing in a cloud environment | |
US12052180B2 (en) | Managing network state for high flow availability within distributed network platform | |
US20240098089A1 (en) | Metadata customization for virtual private label clouds | |
EP4292262A1 (en) | Cloud infrastructure resources for connecting a service provider private network to a customer private network | |
CN118541674A (en) | Publishing physical topology network locality information for graphics processing unit workloads | |
US11652746B1 (en) | Resilient consistent hashing for a distributed cache | |
US20210243261A1 (en) | Connecting application instances to client devices | |
US12086625B2 (en) | Multiple top-of-rack (TOR) switches connected to a network virtualization device | |
WO2024039521A1 (en) | Providing fault-resistance services in a dedicated region cloud at customer | |
WO2024039520A1 (en) | Dual top-of-rack switch implementation for dedicated region cloud at customer | |
WO2024039519A1 (en) | Multiple top-of-rack (tor) switches connected to a network virtualization device | |
WO2024039522A1 (en) | Network architecture for dedicated region cloud at customer | |
CN118541675A (en) | Publishing physical topology network locality for general workload | |
CN119732020A (en) | Multiple top-of-rack (TOR) switches connected to network virtualization devices | |
CN119732025A (en) | Providing failure-resistant services in dedicated regional clouds at customer locations |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170531 |
|
RJ01 | Rejection of invention patent application after publication |