WO2012000455A1 - 一种客户端及负载均衡的方法 - Google Patents

一种客户端及负载均衡的方法 Download PDF

Info

Publication number
WO2012000455A1
WO2012000455A1 PCT/CN2011/076770 CN2011076770W WO2012000455A1 WO 2012000455 A1 WO2012000455 A1 WO 2012000455A1 CN 2011076770 W CN2011076770 W CN 2011076770W WO 2012000455 A1 WO2012000455 A1 WO 2012000455A1
Authority
WO
WIPO (PCT)
Prior art keywords
service node
service
client
call request
cluster
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.)
Ceased
Application number
PCT/CN2011/076770
Other languages
English (en)
French (fr)
Inventor
黄志辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Publication of WO2012000455A1 publication Critical patent/WO2012000455A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Definitions

  • the present invention relates to the field of clustering, and in particular, to a method for client and load balancing. Background technique
  • a cluster is a collection of loosely coupled service nodes consisting of two or more servers that provide users with network services or applications.
  • load balancing means that the service nodes in the cluster bear the corresponding load according to their computing power.
  • a load balancer is usually set on the cluster side, and load balancing is performed by the load balancer.
  • the specific process is as follows:
  • the client sends a call request to the cluster providing the service.
  • the load balancer in the cluster forwards the call request to the corresponding service node according to the load condition of each service node in the cluster.
  • the service node processes the client's call request and returns the corresponding processing result.
  • the embodiment of the present invention provides a method for client and load balancing.
  • the technical solution is as follows:
  • a method of load balancing comprising:
  • the client obtains a load configuration, where the load configuration includes at least a manner of accessing the service node;
  • the client receives the processing result returned by the service node.
  • the client before the sending, by the client, the calling request to the corresponding service node in the service cluster according to the load configuration, the client includes:
  • the client loads all the service nodes in the service cluster, and establishes communication communication with each service node one by one. Road.
  • the sending, by the client, the calling request to the corresponding service node in the service cluster according to the load configuration includes:
  • the sending, by the client according to the load configuration, a call request to a corresponding service node in the service cluster includes:
  • the client sequentially selects one service node from the service clusters in a preset order, and sends a call request to the selected service node.
  • the sending, by the client according to the load configuration, a call request to a corresponding service node in the service cluster includes:
  • the client randomly selects a service node from the service cluster and sends a call request to the selected service node.
  • a client, the client includes:
  • An obtaining module configured to obtain a load configuration, where the load configuration includes at least a manner of accessing a service node, and a requesting module, configured to send, according to the load configuration, a call request to a corresponding service node in the service cluster, to enable the service node Receiving and processing the call request, and returning the processing result;
  • a receiving module configured to receive the processing result returned by the service node.
  • the client further includes:
  • the establishing module is configured to load all the service nodes in the service cluster before establishing the request module, and establish communication channels with all the service nodes one by one.
  • the requesting module is further configured to determine whether a communication channel between itself and a corresponding service node in the service cluster is valid;
  • a call request is sent to the corresponding service node in the service cluster based on the load configuration.
  • the requesting module is specifically configured to sequentially select a service node from the service cluster according to a preset order. The selected service node sends a call request.
  • the requesting module is specifically configured to randomly select a service node from the service cluster to the selected service.
  • the node sends a call request.
  • the client obtains the load configuration, sends a call request to the corresponding service node in the service cluster according to the load configuration, and receives the processing result returned by the service node, that is, the load of the service node is completely dependent on the requested client, and the service cluster is indirectly implemented.
  • the load balancing improves the service capability of the cluster; and establishes a communication channel with all the service nodes in advance, and determines that the communication channel of a service node is valid, and then sends a call request to the service node to prevent load balancing on the cluster side.
  • the exception causes the client's call request to be abnormal, effectively enhancing the robustness of the entire service cluster, and implementing the adaptive call client.
  • Embodiment 1 is a flowchart of a method for load balancing provided in Embodiment 1 of the present invention
  • FIG. 2 is a schematic diagram of a network architecture of load balancing provided in Embodiment 1 of the present invention.
  • Embodiment 3 is an information interaction diagram of load balancing provided in Embodiment 1 of the present invention.
  • FIG. 4 is a schematic structural diagram of a client provided in Embodiment 2 of the present invention.
  • FIG. 5 is a schematic structural diagram of another client provided in Embodiment 2 of the present invention. detailed description
  • this embodiment provides a method for load balancing, including:
  • the client obtains a load configuration, where the load configuration includes at least a manner of accessing the service node;
  • the client sends a call request to a corresponding service node in the service cluster according to the load configuration, so that the service node receives and processes the call request, and returns a processing result;
  • the client receives the processing result returned by the service node.
  • the method provided in this embodiment obtains a load configuration by using a client, sends a call request to a corresponding service node in the service cluster according to the load configuration, and receives a processing result returned by the service node, that is, the load of the service node is completely dependent on the requested client.
  • the load balancing of the service cluster is realized indirectly, and the service capability of the cluster is improved. See the load balancing network architecture shown in Figure 2, including the client and the service cluster.
  • the client includes several specific clients, which are indicated by the client C1, the client C2, and the client Cn.
  • the service cluster is divided into several actual processes.
  • the client invokes the requested service node, and indicates the service node N1, the service node N2, the service node N3, and the service node Nn.
  • the client loads all the service nodes in the service cluster, and establishes communication channels with all the service nodes one by one; further, for security reasons, the establishment of the communication channel generally requires authentication between the client and the service cluster to ensure the legality of the channel.
  • this embodiment does not limit the specific authentication mode adopted.
  • the client obtains a load configuration, where the load configuration includes at least a manner of accessing the service node.
  • the load configuration may be preset on the client, or may be obtained by the client from a certain configuration server.
  • the load configuration is used to implement the load balancing of the service cluster. It specifies the information about the access mode and frequency of the service nodes of the service cluster. The embodiment does not limit the specific content of the load configuration.
  • the client determines whether the communication channel between the user and the corresponding service node in the service cluster is valid; the client determines that the corresponding service node is abnormal from the established communication channel failure, the service is unavailable, and the client calls instead.
  • the service of the available service node prevents the service node from being abnormal during the load balancing on the cluster side, causing the client's call request to be abnormal. This effectively enhances the robustness of the entire service cluster and implements the adaptive call client.
  • step 204 determines whether the communication channel between the user and the corresponding service node in the service cluster is valid; the client determines that the corresponding service node is abnormal from the established communication channel failure, the service is unavailable, and the client calls instead.
  • the service of the available service node prevents the service node from being abnormal during the load balancing on the cluster side, causing the client's call request to be abnormal. This effectively enhances the robustness of the entire service cluster and implements the adaptive call client.
  • step 204 determines whether the communication channel between the user and
  • the client may also directly perform step 204 without determining whether the communication channel is valid.
  • the client sends a call request to a corresponding service node in the service cluster according to the load configuration.
  • the client sequentially selects one service node from the service cluster according to a preset order, and sends a call request to the selected service node. If the way to access the service node included in the load configuration is random, the client randomly selects a service node from the service cluster and sends a call request to the selected service node.
  • the following is an example of distributing the load amount in a sequential manner by accessing the service node as an example to illustrate the process of load balancing.
  • the following load configuration is set, taking client C1 as an example, client C1 and service node Nl,
  • N2 and N3 respectively establish communication channels, according to the preset order Nl, N2, N3, the first call request of the client CI is sent to the service node Nl, and the second call request is sent to the service node N2, and the third call is made.
  • the request is sent to the service node N3, and then the fourth call request is sent to the service node N1, the fifth call request is sent to the service node N2, and the sixth call request is sent to the service node N3, and the service cluster is implemented again and again. Load balancing requirements for each service node.
  • the following is an example of randomly assigning the load amount in a random manner by accessing the service node, and illustrates the process of load balancing.
  • the following load configuration is set.
  • client C1 and service nodes N1, N2, and N3 respectively establish communication channels, and client C1 randomly selects one service node N2 from the service cluster, and Send the first call request to it, then randomly select a service node Nl from the service cluster, and send a second call request to it, and so on, and implement the load on each service node in the service cluster by random selection.
  • Equilibrium requirements Equilibrium requirements.
  • the request threshold can also be set in the load configuration to limit the number of requests sent by the user within a certain period of time to prevent the server from crashing due to excessive requests.
  • the service node receives and processes the call request, and returns a processing result.
  • the call request sent by the client and the processing result returned by the service node can be performed through the established communication channel. Transfer.
  • the client receives the processing result returned by the service node.
  • the method provided in this embodiment obtains a load configuration by using a client, sends a call request to a corresponding service node in the service cluster according to the load configuration, and receives a processing result returned by the service node, that is, the load of the service node is completely dependent on the requested client.
  • the load balancing of the service cluster is realized indirectly, and the service capability of the cluster is improved; and a communication channel is established in advance with all service nodes, and after determining that the communication channel of a service node is valid, a call request is sent to the cluster to prevent the cluster from being activated.
  • the load balancing is performed on the side, the service node is abnormal, causing the client's call request to be abnormal. This effectively enhances the robustness of the entire service cluster and implements the adaptive call client.
  • this embodiment provides a client, including:
  • the obtaining module 301 is configured to obtain a load configuration, where the load configuration includes at least a manner of accessing the service node, and the requesting module 302 is configured to send a call request to the corresponding service node in the service cluster according to the load configuration, so that the service node receives and processes Call the request, return the processing result;
  • the receiving module 303 is configured to receive a processing result returned by the service node.
  • the client further includes:
  • the establishing module 304 is configured to load all service nodes in the service cluster before performing the requesting module 302, and establish communication channels with each of the service nodes one by one.
  • the requesting module 302 is further configured to determine whether the communication channel between the user and the corresponding service node in the service cluster is valid;
  • a call request is sent to the corresponding service node in the service cluster based on the load configuration.
  • the module 302 is specifically configured to sequentially select a service node from the service cluster according to a preset sequence, and send a call request to the selected service node.
  • the requesting module 302 is specifically configured to randomly select a service node from the service cluster and send a call request to the selected service node.
  • the client provided in this embodiment is the same as the method embodiment, and the specific implementation process is described in the method embodiment, and details are not described herein again.
  • the client provided by this embodiment sends a call request to the corresponding service node in the service cluster according to the load configuration, and receives the processing result returned by the service node, that is, the load of the service node is completely dependent on the requested client.
  • the load balancing is performed, the service node is abnormal, causing the client's call request to be abnormal. This effectively enhances the robustness of the entire service cluster and implements the adaptive call client.
  • the client provided by the foregoing embodiment is only illustrated by dividing the foregoing functional modules when performing load balancing. In actual applications, the foregoing function allocation may be completed by different functional modules as needed. The internal structure of the client is divided into different functional modules to perform all or part of the functions described above.
  • All or part of the steps in the embodiments of the present invention may be implemented by using hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a readable storage medium, such as an optical disk or a hard disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种客户端及负载均衡的方法,属于集群领域。所述方法包括:客户端获取负载配置,该负载配置中至少包括访问服务节点的方式(101);客户端根据负载配置,向服务集群中相应的服务节点发送调用请求,使服务节点接收并处理调用请求,返回处理结果(102);客户端接收服务节点返回的处理结果(103)。所述客户端包括:获取模块、请求模块和接收模块。本发明通过客户端获取负载配置,根据负载配置向服务集群中相应的服务节点发送调用请求,并接收服务节点返回的处理结果,也即服务节点的负载完全依赖于请求的客户端,间接实现了服务集群的负载均衡,提高了集群的服务能力。

Description

一种客户端及负载均衡的方法 技术领域
本发明涉及集群领域, 特别涉及一种客户端及负载均衡的方法。 背景技术
随着大规模互联网络应用的蓬勃发展, 大规模分布式集群服务已经随着网络的普及开 始更多的应用到企业。 集群是由两台或多台服务器构成的一种松散耦合的服务节点集合, 可以为用户提供网络服务或应用程序等。 集群中非常重要的一个问题是负载均衡, 负载均 衡是指集群中的服务节点根据自身的计算能力, 承担相应的负载。
目前, 在实现负载均衡时, 通常在集群侧设置一负载均衡器, 由负载均衡器进行负载 均衡的控制, 具体过程如下:
客户端发送调用请求给提供服务的集群, 集群中的负载均衡器接收到客户端的调用请 求后, 根据集群中各个服务节点的负载情况, 转发调用请求给相应的服务节点。 该服务节 点处理客户端的调用请求, 并返回相应的处理结果。
在实现本发明的过程中, 发明人发现现有技术至少存在以下缺点:
现有技术在集群侧进行负载均衡, 会占用集群侧的处理资源, 降低集群的服务能力。 发明内容
为了提高集群的服务能力, 本发明实施例提供了一种客户端及负载均衡的方法。 所述 技术方案如下:
一种负载均衡的方法, 所述方法包括:
客户端获取负载配置, 所述负载配置中至少包括访问服务节点的方式;
所述客户端根据所述负载配置, 向服务集群中相应的服务节点发送调用请求, 使所述 服务节点接收并处理所述调用请求, 返回处理结果;
所述客户端接收所述服务节点返回的所述处理结果。
进一步的, 所述客户端根据所述负载配置, 向服务集群中相应的服务节点发送调用请 求之前包括:
所述客户端加载所述服务集群中所有服务节点, 逐一与所有服务节点分别建立通信通 道。
进一步的, 所述客户端根据所述负载配置, 向服务集群中相应的服务节点发送调用请 求包括:
所述客户端判断自身与所述服务集群中相应的服务节点之间的通信通道是否有效; 如果有效, 所述客户端根据所述负载配置, 向所述服务集群中相应的服务节点发送调 用请求。
进一步的, 所述负载配置中包括的访问服务节点的方式为顺序方式时, 所述客户端根 据所述负载配置, 向服务集群中相应的服务节点发送调用请求包括:
所述客户端按照预设顺序依次从所述服务集群中选择一个服务节点, 向所述选中的服 务节点发送调用请求。
进一步的, 所述负载配置中包括的访问服务节点的方式为随机方式时, 所述客户端根 据所述负载配置, 向服务集群中相应的服务节点发送调用请求包括:
所述客户端随机从所述服务集群中选择一个服务节点, 向所述选中的服务节点发送调 用请求。
一种客户端, 所述客户端包括:
获取模块, 用于获取负载配置, 所述负载配置中至少包括访问服务节点的方式; 请求模块, 用于根据所述负载配置, 向服务集群中相应的服务节点发送调用请求, 使 所述服务节点接收并处理所述调用请求, 返回处理结果;
接收模块, 用于接收所述服务节点返回的所述处理结果。
进一步的, 所述客户端还包括:
建立模块, 用于执行所述请求模块之前, 加载所述服务集群中所有服务节点, 逐一与 所有服务节点分别建立通信通道。
进一步的, 所述请求模块, 还用于判断自身与所述服务集群中相应的服务节点之间的 通信通道是否有效;
如果有效, 根据所述负载配置, 向所述服务集群中相应的服务节点发送调用请求。 进一步的, 所述获取模块获取到的负载配置中的访问服务节点的方式为顺序方式时, 所述请求模块, 具体用于按照预设顺序依次从所述服务集群中选择一个服务节点, 向所述 选中的服务节点发送调用请求。
进一步的, 所述获取模块获取到的负载配置中的访问服务节点的方式为随机方式时, 所述请求模块, 具体用于随机从所述服务集群中选择一个服务节点, 向所述选中的服务节 点发送调用请求。 本发明实施例提供的技术方案带来的有益效果是:
通过客户端获取负载配置, 根据负载配置向服务集群中相应的服务节点发送调用请求, 并接收服务节点返回的处理结果, 也即服务节点的负载完全依赖于请求的客户端, 间接实 现了服务集群的负载均衡, 提高了集群的服务能力; 并且预先与所有服务节点分别建立通 信通道, 判断某一服务节点的通信通道有效后, 再向其发送调用请求, 防止在集群侧进行 负载均衡时服务节点异常导致客户端的调用请求不正常, 有效的增强了整个服务集群的健 壮性, 实现了自适应调用的客户端。 附图说明
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所需要使用的 附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本 领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的 附图。
图 1是本发明实施例 1中提供的负载均衡的方法流程图;
图 2是本发明实施例 1中提供的负载均衡的网络架构示意图;
图 3是本发明实施例 1中提供的负载均衡的信息交互图;
图 4是本发明实施例 2中提供的客户端结构示意图;
图 5是本发明实施例 2中提供的另一种客户端结构示意图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明实施方式作 进一步地详细描述。
实施例 1
参见图 1, 本实施例提供了一种负载均衡的方法, 包括:
101: 客户端获取负载配置, 该负载配置中至少包括访问服务节点的方式;
102: 客户端根据负载配置, 向服务集群中相应的服务节点发送调用请求, 使服务节点 接收并处理调用请求, 返回处理结果;
103: 客户端接收服务节点返回的处理结果。
本实施例提供的方法, 通过客户端获取负载配置, 根据负载配置向服务集群中相应的 服务节点发送调用请求, 并接收服务节点返回的处理结果, 也即服务节点的负载完全依赖 于请求的客户端, 间接实现了服务集群的负载均衡, 提高了集群的服务能力。 参见图 2 所示的负载均衡网络架构, 包括客户端和服务集群, 客户端包括若干个具体 的客户端, 以客户端 Cl、 客户端 C2、 客户端 Cn进行示意, 服务集群划分为若干实际处理 客户端调用请求的服务节点, 以服务节点 Nl、 服务节点 N2、 服务节点 N3、 服务节点 Nn进 行示意。
基于上述网络架构, 参见图 3, 下面详细介绍负载均衡的实现过程。
201: 客户端加载服务集群中所有服务节点, 逐一与所有服务节点分别建立通信通道; 进一步的, 为了安全起见, 通信通道的建立一般需要客户端和服务集群双方鉴权, 以 保证通道的合法性, 对此, 本实施例不对采用的具体鉴权方式进行限定。
202: 客户端获取负载配置, 该负载配置中至少包括访问服务节点的方式;
具体的, 负载配置可以是预先设置在客户端的, 也可以是客户端从某一配置服务器预 先获取的。 负载配置用于实现服务集群的负载均衡, 其规定了一段时间内, 客户端对服务 集群各个服务节点的访问方式、 频率等信息, 本实施例并不限定负载配置的具体内容。
203 :可选的,客户端判断自身与服务集群中相应的服务节点之间的通信通道是否有效; 客户端从建立的通信通道失效来判定对应的服务节点异常, 服务不可用, 客户转而调 用可用的服务节点的服务, 防止在集群侧进行负载均衡时服务节点异常导致客户端的调用 请求不正常, 有效的增强了整个服务集群的健壮性, 实现了自适应调用的客户端。 相应的, 如果有效, 执行步骤 204。
进一步的, 客户端也可以不判断通信通道是否有效, 直接执行步骤 204。
204: 客户端根据负载配置, 向服务集群中相应的服务节点发送调用请求;
具体的, 如果负载配置中包括的访问服务节点的方式为顺序方式时, 客户端按照预设 顺序依次从服务集群中选择一个服务节点, 向选中的服务节点发送调用请求。 如果负载配 置中包括的访问服务节点的方式为随机方式时, 客户端随机从服务集群中选择一个服务节 点, 向选中的服务节点发送调用请求。
下面以访问服务节点的方式为顺序方式平均分配负载量为例, 说明负载均衡的过程。 对于每一客户端都设定如下负载配置, 以客户端 C1为例, 客户端 C1和服务节点 Nl、
N2、 N3 分别建立通信通道, 按照预设顺序 Nl、 N2、 N3 , 客户端 CI的第一个调用请求发送 给服务节点 Nl, 其第二个调用请求发送给服务节点 N2, 其第三个调用请求发送给服务节点 N3 , 然后其第四个调用请求又发送给服务节点 Nl, 其第五个调用请求发送给服务节点 N2, 第六个调用请求发送给服务节点 N3, 周而复始, 实现对服务集群中各服务节点的负载均衡 要求。
下面以访问服务节点的方式为随机方式平均分配负载量为例, 说明负载均衡的过程。 对于每一客户端都设定如下负载配置, 以客户端 C1为例, 客户端 C1和服务节点 Nl、 N2、 N3 分别建立通信通道, 客户端 C1从服务集群中随机选择一个服务节点 N2, 并向其发 送第一个调用请求, 然后从服务集群中再随机选择一个服务节点 Nl, 并向其发送第二个调 用请求, 依次类推, 通过随机选择的方式实现对服务集群中各服务节点的负载均衡要求。
另外, 还可以在负载配置中设置请求阈值, 用于限制用户在一定时间内发送请求的数 量, 防止过量请求导致服务器崩溃。
205: 服务节点接收并处理调用请求, 返回处理结果;
具体的, 通过上述步骤 201, 客户端加载服务集群中所有服务节点, 逐一与所有服务节 点分别建立通信通道之后, 客户端发送的调用请求及服务节点返回的处理结果均可通过建 立的通信通道进行传送。
206: 客户端接收服务节点返回的处理结果。
本实施例提供的方法, 通过客户端获取负载配置, 根据负载配置向服务集群中相应的 服务节点发送调用请求, 并接收服务节点返回的处理结果, 也即服务节点的负载完全依赖 于请求的客户端, 间接实现了服务集群的负载均衡, 提高了集群的服务能力; 并且预先与 所有服务节点分别建立通信通道, 判断某一服务节点的通信通道有效后, 再向其发送调用 请求, 防止在集群侧进行负载均衡时服务节点异常导致客户端的调用请求不正常, 有效的 增强了整个服务集群的健壮性, 实现了自适应调用的客户端。 实施例 2
参见图 4, 本实施例提供了一种客户端, 包括:
获取模块 301, 用于获取负载配置, 该负载配置中至少包括访问服务节点的方式; 请求模块 302, 用于根据负载配置, 向服务集群中相应的服务节点发送调用请求, 使服 务节点接收并处理调用请求, 返回处理结果;
接收模块 303, 用于接收服务节点返回的处理结果。
进一步的, 参见图 5, 客户端还包括:
建立模块 304, 用于执行请求模块 302之前, 加载服务集群中所有服务节点, 逐一与所 有服务节点分别建立通信通道。
进一步的, 请求模块 302, 还用于判断自身与服务集群中相应的服务节点之间的通信通 道是否有效;
如果有效, 根据负载配置, 向服务集群中相应的服务节点发送调用请求。
当获取模块 301 获取到的负载配置中包括的访问服务节点的方式为顺序方式时, 请求 模块 302, 具体用于按照预设顺序依次从服务集群中选择一个服务节点, 向选中的服务节 点发送调用请求。
当获取模块 301 获取到的负载配置中包括的访问服务节点的方式为随机方式时, 请求 模块 302,具体用于随机从服务集群中选择一个服务节点,向选中的服务节点发送调用请求。
本实施例提供的客户端, 与方法实施例属于同一构思, 其具体实现过程详见方法实施 例, 这里不再赘述。
本实施例提供的客户端, 通过获取负载配置, 根据负载配置向服务集群中相应的服务 节点发送调用请求, 并接收服务节点返回的处理结果, 也即服务节点的负载完全依赖于请 求的客户端, 间接实现了服务集群的负载均衡, 提高了集群的服务能力; 并且预先与所有 服务节点分别建立通信通道, 判断某一服务节点的通信通道有效后, 再向其发送调用请求, 防止在集群侧进行负载均衡时服务节点异常导致客户端的调用请求不正常, 有效的增强了 整个服务集群的健壮性, 实现了自适应调用的客户端。 需要说明的是: 上述实施例提供的客户端在进行负载均衡时, 仅以上述各功能模块的 划分进行举例说明, 实际应用中, 可以根据需要而将上述功能分配由不同的功能模块完成, 即将客户端的内部结构划分成不同的功能模块, 以完成以上描述的全部或者部分功能。
本发明实施例中的全部或部分步骤, 可以利用硬件实现, 也可以通过程序来指令相关 的硬件完成, 所述的程序可以存储在可读取的存储介质中, 如光盘或硬盘等。
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的精神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1、 一种负载均衡的方法, 其特征在于, 所述方法包括:
客户端获取负载配置, 所述负载配置中至少包括访问服务节点的方式;
所述客户端根据所述负载配置, 向服务集群中相应的服务节点发送调用请求, 使所述服 务节点接收并处理所述调用请求, 返回处理结果;
所述客户端接收所述服务节点返回的所述处理结果。
2、 如权利要求 1所述的方法, 其特征在于, 所述客户端根据所述负载配置, 向服务集群 中相应的服务节点发送调用请求之前包括:
所述客户端加载所述服务集群中所有服务节点,逐一与所有服务节点分别建立通信通道。
3、 如权利要求 2所述的方法, 其特征在于, 所述客户端根据所述负载配置, 向服务集群 中相应的服务节点发送调用请求包括:
所述客户端判断自身与所述服务集群中相应的服务节点之间的通信通道是否有效; 如果有效, 所述客户端根据所述负载配置, 向所述服务集群中相应的服务节点发送调用 请求。
4、 如权利要求 1所述的方法, 其特征在于, 所述负载配置中包括的访问服务节点的方式 为顺序方式时, 所述客户端根据所述负载配置, 向服务集群中相应的服务节点发送调用请求 包括:
所述客户端按照预设顺序依次从所述服务集群中选择一个服务节点, 向所述选中的服务 节点发送调用请求。
5、 如权利要求 1所述的方法, 其特征在于, 所述负载配置中包括的访问服务节点的方式 为随机方式时, 所述客户端根据所述负载配置, 向服务集群中相应的服务节点发送调用请求 包括:
所述客户端随机从所述服务集群中选择一个服务节点, 向所述选中的服务节点发送调用 请求。
6、 一种客户端, 其特征在于, 所述客户端包括: 获取模块, 用于获取负载配置, 所述负载配置中至少包括访问服务节点的方式; 请求模块, 用于根据所述负载配置, 向服务集群中相应的服务节点发送调用请求, 使所 述服务节点接收并处理所述调用请求, 返回处理结果;
接收模块, 用于接收所述服务节点返回的所述处理结果。
7、 如权利要求 6所述的客户端, 其特征在于, 所述客户端还包括:
建立模块, 用于执行所述请求模块之前, 加载所述服务集群中所有服务节点, 逐一与所 有服务节点分别建立通信通道。
8、 如权利要求 7所述的客户端, 其特征在于, 所述请求模块, 还用于判断自身与所述服 务集群中相应的服务节点之间的通信通道是否有效;
如果有效, 根据所述负载配置, 向所述服务集群中相应的服务节点发送调用请求。
9、 如权利要求 6所述的客户端, 其特征在于, 所述获取模块获取到的负载配置中的访问 服务节点的方式为顺序方式时, 所述请求模块, 具体用于按照预设顺序依次从所述服务集群 中选择一个服务节点, 向所述选中的服务节点发送调用请求。
10、 如权利要求 6所述的客户端, 其特征在于, 所述获取模块获取到的负载配置中的访 问服务节点的方式为随机方式时, 所述请求模块, 具体用于随机从所述服务集群中选择一个 服务节点, 向所述选中的服务节点发送调用请求。
PCT/CN2011/076770 2010-07-02 2011-07-01 一种客户端及负载均衡的方法 Ceased WO2012000455A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2010102232880A CN102316138A (zh) 2010-07-02 2010-07-02 一种客户端及负载均衡的方法
CN201010223288.0 2010-07-02

Publications (1)

Publication Number Publication Date
WO2012000455A1 true WO2012000455A1 (zh) 2012-01-05

Family

ID=45401406

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076770 Ceased WO2012000455A1 (zh) 2010-07-02 2011-07-01 一种客户端及负载均衡的方法

Country Status (2)

Country Link
CN (1) CN102316138A (zh)
WO (1) WO2012000455A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746894A (zh) * 2021-07-23 2021-12-03 济南浪潮数据技术有限公司 基于hdfs rbf路由层实现负载均衡方法、装置

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103248610B (zh) * 2012-02-06 2016-04-27 阿里巴巴集团控股有限公司 一种提供网络服务的方法和系统
CN102984084B (zh) * 2012-11-21 2016-06-29 北京奇虎科技有限公司 计算机集群中节点间数据传输方法和系统
CN104518985A (zh) * 2013-09-27 2015-04-15 国家广播电影电视总局广播科学研究院 一种分布式网络环境下服务节点的选择方法及终端
CN104079630A (zh) * 2014-06-09 2014-10-01 中国建设银行股份有限公司 一种业务服务端负载均衡方法、客户端、服务端以及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1455347A (zh) * 2002-04-30 2003-11-12 电子科技大学 一种分布式并行调度宽带网络服务器系统
US20040243709A1 (en) * 2003-05-27 2004-12-02 Sun Microsystems, Inc. System and method for cluster-sensitive sticky load balancing
WO2009059456A1 (en) * 2007-11-06 2009-05-14 Lucent Technologies Inc. Method for controlling load balance of network system, client, server and network system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100377554C (zh) * 2004-05-25 2008-03-26 华中科技大学 一种集群服务器的负载均衡方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1455347A (zh) * 2002-04-30 2003-11-12 电子科技大学 一种分布式并行调度宽带网络服务器系统
US20040243709A1 (en) * 2003-05-27 2004-12-02 Sun Microsystems, Inc. System and method for cluster-sensitive sticky load balancing
WO2009059456A1 (en) * 2007-11-06 2009-05-14 Lucent Technologies Inc. Method for controlling load balance of network system, client, server and network system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746894A (zh) * 2021-07-23 2021-12-03 济南浪潮数据技术有限公司 基于hdfs rbf路由层实现负载均衡方法、装置

Also Published As

Publication number Publication date
CN102316138A (zh) 2012-01-11

Similar Documents

Publication Publication Date Title
US20240235929A9 (en) Method for instantiating edge application server and apparatus
CN105245373B (zh) 一种容器云平台系统的搭建及运行方法
US10523748B2 (en) Managing health status of network devices in a distributed global server load balancing system
US8713186B2 (en) Server-side connection resource pooling
US9554276B2 (en) System and method for on the fly protocol conversion in obtaining policy enforcement information
US8434156B2 (en) Method, access node, and system for obtaining data
WO2013078875A1 (zh) 内容的管理方法的方法、装置和系统
CN106131138A (zh) 一种基于非阻塞队列的展示数据实时推送系统和方法
CN107517241A (zh) 请求调度方法及装置
WO2022022584A1 (zh) 算力共享方法及相关设备
CN112491066B (zh) 负载均衡方法、装置、系统、目标负载均衡设备及介质
WO2012000455A1 (zh) 一种客户端及负载均衡的方法
CN114006915B (zh) 资源请求方法、装置、设备及计算机可读存储介质
CN114490071A (zh) 一种基于云游戏的资源调度方法、装置、设备及介质
TWI640214B (zh) 一種網路接入方法、相關設備和系統
dos S. Lima et al. Peer-to-peer resource discovery in mobile grids
WO2016180284A1 (zh) 服务节点分配方法、装置、cdn管理服务器及系统
CN113596105B (zh) 内容的获取方法、边缘节点及计算机可读存储介质
CN105681266B (zh) 一种多媒体电话MMTel的通讯集群方法及装置
WO2014015525A1 (zh) 一种用户在线状态的查询方法和装置
WO2023016255A1 (zh) 一种网络功能服务授权方法及装置
CN107770203B (zh) 一种服务请求转发方法、装置及系统
CN112543150B (zh) 基于服务端控制的动态负载均衡方法
CN102387062B (zh) 动态桥接点改善p2p节点在跨网络时的传输速度的方法
RU2522995C2 (ru) Способ и устройство создания одноранговой группы в одноранговом приложении и способ применения одноранговой группы

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11800200

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 12/03/2013)

122 Ep: pct application non-entry in european phase

Ref document number: 11800200

Country of ref document: EP

Kind code of ref document: A1