A method and device for routing requests of a distributed cluster
By analyzing client information, forwarding requests and recording subcluster connection information, and sending client information when service failure, the availability problem of request routing in Hadoop federated scenarios is solved, and fast positioning service failure and load balancing analysis is realized, improving Availability of distributed clusters.
Patent Information
- Application Number
- CN202110714798.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-25
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-06-25
AI Technical Summary
In Hadoop's Router-based federated scenario, client requests cannot quickly locate service failures and input and output blocking, and it is difficult to analyze load balancing of federated clusters, resulting in poor availability.
By receiving service requests from the distributed file system from the client, parsing and recording client information; determining the corresponding subcluster based on the service request, forwarding and recording the connection information of the subcluster; receiving feedback information and combining it with client information; Associated records; send client information to the subcluster when service execution fails.
It realizes rapid location service failure and input and output blocking, helps analyze load balancing of federated clusters and improves the availability of distributed clusters.
Smart Images

Figure CN113590573B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of routing, and more specifically, to a method and device for routing requests of a distributed cluster. Background Art
[0002] For Hadoop's Router-based federation scenario, when the client accesses HDFS (Hadoop-based distributed file system), the Router needs to respond to the client request and forward the request proxy to the correct NameNode. If multiple clients access HDFS at the same time, the Router will proxy the client to make requests to the server NameNode, and some of the server NameNodes will have exceptions when processing requests. Since the Router hides the client information from the server NameNode, the server NameNode cannot identify which client's request has an error, which is not conducive to locating the abnormal operation failure problem and troubleshooting the network input and output blocking problem. It is also impossible to analyze the load balancing of the Router in the entire federation cluster, making it difficult for the federation cluster to handle errors and analyze loads, and the availability is poor.
[0003] There is currently no effective solution to the problem that distributed clusters in existing technologies are difficult to handle errors and analysis loads and have poor availability. Summary of the invention
[0004] In view of this, the purpose of the embodiments of the present invention is to propose a method and device for routing requests of a distributed cluster, which can facilitate the rapid location of service failures and input and output blockages, and help analyze the load balancing of the federated cluster and improve the availability of the distributed cluster.
[0005] Based on the above purpose, a first aspect of an embodiment of the present invention provides a method for routing requests of a distributed cluster, comprising executing the following steps:
[0006] Receive a distributed file system service request from a client, parse the client information from the service request and record the client information in a log;
[0007] Determine the corresponding subcluster in the distributed file system based on the service request, forward the service request to the subcluster and record the subcluster connection information in the log;
[0008] receiving feedback information for the service request from the sub-cluster, and recording the feedback information in a log in association with client information corresponding to the feedback information;
[0009] In response to the feedback information including the service execution failure, client information corresponding to the feedback information is sent to the sub-cluster based on the connection information.
[0010] In some implementations, parsing the client information from the service request includes parsing at least one of the following: the initiation time of the service request, the network address of the client, the remote procedure call method requested by the client, and method parameters of the remote procedure call method.
[0011] In some embodiments, determining a corresponding subcluster in a distributed file system based on a service request, forwarding the service request to the subcluster, and recording connection information of the subcluster in a log includes: determining a corresponding subcluster in a distributed file system based on the service request, determining an active name node in the subcluster, forwarding the service request to the name node, and recording the network address of the name node in a log.
[0012] In some implementations, receiving feedback information for the service request from the sub-cluster includes receiving at least one of the following: whether the service request is successfully executed, and the end time of the service request.
[0013] In some embodiments, recording the feedback information in a log in association with the client information corresponding to the feedback information includes: determining the overall time consumed by the service request based on the end time of the service request and the initiation time of the service request, and recording in the log whether the service request is successfully executed, the end time of the service request, and the overall time consumed by the service request in association with the client information corresponding to the feedback information.
[0014] In some implementations, the method further includes executing the following step: in response to the feedback information including success or failure of service execution, feeding back the feedback information to the client based on the client information.
[0015] In some embodiments, the method further includes executing the following steps: in response to receiving a remote procedure call query request, parsing a remote procedure call method from the remote procedure call query request, and returning client information and feedback information related to the remote procedure call method recorded in the log as a result.
[0016] In some implementations, the distributed cluster is a Hadoop cluster, and the sub-clusters are subordinate to the Hadoop cluster.
[0017] In some implementations, the client and the sub-clusters form a federated cluster of the Hadoop cluster.
[0018] A second aspect of an embodiment of the present invention provides a device, including:
[0019] processor;
[0020] The controller stores program codes executable by the processor. When the processor runs the program codes, the processor performs the following steps:
[0021] Receive a distributed file system service request from a client, parse the client information from the service request and record the client information in a log;
[0022] Determine the corresponding subcluster in the distributed file system based on the service request, forward the service request to the subcluster and record the subcluster connection information in the log;
[0023] receiving feedback information for the service request from the sub-cluster, and recording the feedback information in a log in association with client information corresponding to the feedback information;
[0024] In response to the feedback information including the service execution failure, client information corresponding to the feedback information is sent to the sub-cluster based on the connection information.
[0025] In some implementations, parsing the client information from the service request includes parsing at least one of the following: the initiation time of the service request, the network address of the client, the remote procedure call method requested by the client, and method parameters of the remote procedure call method.
[0026] In some embodiments, determining a corresponding subcluster in a distributed file system based on a service request, forwarding the service request to the subcluster, and recording connection information of the subcluster in a log includes: determining a corresponding subcluster in a distributed file system based on the service request, determining an active name node in the subcluster, forwarding the service request to the name node, and recording the network address of the name node in a log.
[0027] In some implementations, receiving feedback information for the service request from the sub-cluster includes receiving at least one of the following: whether the service request is successfully executed, and the end time of the service request.
[0028] In some embodiments, recording the feedback information in a log in association with the client information corresponding to the feedback information includes: determining the overall time consumed by the service request based on the end time of the service request and the initiation time of the service request, and recording in the log whether the service request is successfully executed, the end time of the service request, and the overall time consumed by the service request in association with the client information corresponding to the feedback information.
[0029] In some implementations, the method further includes executing the following step: in response to the feedback information including success or failure of service execution, feeding back the feedback information to the client based on the client information.
[0030] In some implementations, the following steps are also included: in response to receiving a remote procedure call query request, a remote procedure call method is parsed from the remote procedure call query request, and client information and feedback information related to the remote procedure call method recorded in the log are returned as a result.
[0031] In some implementations, the distributed cluster is a Hadoop cluster, and the sub-clusters are subordinate to the Hadoop cluster.
[0032] In some implementations, the client and the sub-clusters form a federated cluster of the Hadoop cluster.
[0033] The present invention has the following beneficial technical effects: the method and device for routing requests of a distributed cluster provided by an embodiment of the present invention receive a service request of a distributed file system from a client, parse the client information from the service request and record the client information in a log; determine the corresponding subcluster in the distributed file system based on the service request, forward the service request to the subcluster and record the connection information of the subcluster in a log; receive feedback information for the service request from the subcluster, and record the feedback information in a log in association with the client information corresponding to the feedback information; in response to the feedback information including a service execution failure, the technical solution of sending the client information corresponding to the feedback information to the subcluster based on the connection information can facilitate rapid positioning of service failures and input / output congestion, and is helpful for analyzing the load balancing of the federated cluster and improving the availability of the distributed cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A schematic diagram of a process flow of a distributed cluster request routing method provided by the present invention;
[0036] Figure 2 A data transmission diagram of a distributed cluster request routing method provided by the present invention. DETAILED DESCRIPTION
[0037] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0038] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0039] Based on the above objectives, the first aspect of the embodiments of the present invention proposes an embodiment of a method for routing requests of a distributed cluster, which is convenient for quickly locating service failures and input and output congestion, helps to analyze the load balancing of the federated cluster, and improves the availability of the distributed cluster. Figure 1 Shown is a schematic flow chart of a method for routing requests of a distributed cluster provided by the present invention.
[0040] The routing method of the distributed cluster request is as follows: Figure 1 As shown, the following steps are included:
[0041] Step S101, receiving a service request of a distributed file system from a client, parsing the client information from the service request and recording the client information into a log;
[0042] Step S103, determining the corresponding sub-cluster in the distributed file system based on the service request, forwarding the service request to the sub-cluster and recording the connection information of the sub-cluster into a log;
[0043] Step S105, receiving feedback information for the service request from the sub-cluster, and recording the feedback information in a log in association with client information corresponding to the feedback information;
[0044] Step S107: in response to the feedback information including the service execution failure, the client information corresponding to the feedback information is sent to the sub-cluster based on the connection information.
[0045] In Hadoop's distributed file system HDFS, for Router-based federation scenarios, a method is designed for Router to record client IP, client request information, forwarded server IP, server processing results, and the overall time consumption of RPC calls. This improves the efficiency of problem location and troubleshooting when abnormalities occur in accessing HDFS, while ensuring that log audits are completely detailed.
[0046] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The embodiment of the computer program can achieve the same or similar effect as any of the above-mentioned method embodiments corresponding thereto.
[0047] In some implementations, parsing the client information from the service request includes parsing at least one of the following: the initiation time of the service request, the network address of the client, the remote procedure call method requested by the client, and method parameters of the remote procedure call method.
[0048] In some embodiments, determining a corresponding subcluster in a distributed file system based on a service request, forwarding the service request to the subcluster, and recording connection information of the subcluster in a log includes: determining a corresponding subcluster in a distributed file system based on the service request, determining an active name node in the subcluster, forwarding the service request to the name node, and recording the network address of the name node in a log.
[0049] In some implementations, receiving feedback information for the service request from the sub-cluster includes receiving at least one of the following: whether the service request is successfully executed, and the end time of the service request.
[0050] In some embodiments, recording the feedback information in a log in association with the client information corresponding to the feedback information includes: determining the overall time consumed by the service request based on the end time of the service request and the initiation time of the service request, and recording in the log whether the service request is successfully executed, the end time of the service request, and the overall time consumed by the service request in association with the client information corresponding to the feedback information.
[0051] Various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the described function in various ways for every specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0052] In some implementations, the method further includes executing the following step: in response to the feedback information including success or failure of service execution, feeding back the feedback information to the client based on the client information.
[0053] In some embodiments, the method further includes executing the following steps: in response to receiving a remote procedure call query request, parsing a remote procedure call method from the remote procedure call query request, and returning client information and feedback information related to the remote procedure call method recorded in the log as a result.
[0054] In some implementations, the distributed cluster is a Hadoop cluster, and the sub-clusters are subordinate to the Hadoop cluster.
[0055] The computer-readable storage medium (e.g., memory) described herein may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. As an example and not by way of limitation, a nonvolatile memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. A volatile memory may include a random access memory (RAM), which may act as an external cache memory. As an example and not by way of limitation, RAM may be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
[0056] According to the following Figure 2 The specific embodiments shown further illustrate the specific implementation of the present invention. Figure 2 First, the client initiates a request to HDFS. When the Router's RPC (remote procedure call) receives the client request, it records the client's request initiation time stime, the client's IP address src (host:port), the requested RPC method method, and the method parameters paramers according to the client's request information.
[0057] Then, when forwarding the request, the Router will find the correct subcluster based on the request information submitted by the client, and forward the request to the active NameNode of the subcluster, recording the IP address dst (host:port) of the target NameNode during forwarding.
[0058] When the NameNode request returns, the Router returns the result of the NameNode request, records whether the execution is successful (result (succeed / failed)), the time etime when the execution ends, and calculates the overall time T (etime-atime) of the request based on the client's request initiation time stime and the time etime when the execution ends, and records them together.
[0059] In addition, the method disclosed in the embodiment of the present invention can also be implemented as a computer program executed by a CPU, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above functions defined in the method disclosed in the embodiment of the present invention are performed. The above method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
[0060] It can be seen from the above embodiments that the routing method for distributed cluster requests provided by the embodiments of the present invention receives a service request of a distributed file system from a client, parses the client information from the service request and records the client information in a log; determines the corresponding subcluster in the distributed file system based on the service request, forwards the service request to the subcluster and records the connection information of the subcluster in a log; receives feedback information for the service request from the subcluster, and records the feedback information in a log in association with the client information corresponding to the feedback information; in response to the feedback information including a service execution failure, the technical solution of sending the client information corresponding to the feedback information to the subcluster based on the connection information can facilitate rapid positioning of service failures and input and output congestion, and is helpful to analyze the load balancing of the federated cluster and improve the availability of the distributed cluster.
[0061] It should be pointed out in particular that the various steps in the various embodiments of the above-mentioned distributed cluster request routing method can be cross-linked, replaced, added, and deleted. Therefore, these reasonable permutations, combinations and transformations of the distributed cluster request routing method should also fall within the scope of protection of the present invention, and the scope of protection of the present invention should not be limited to the embodiments.
[0062] Based on the above purpose, the second aspect of the embodiment of the present invention proposes an embodiment of a routing device for distributed cluster requests that facilitates rapid location of service failures and input / output blocking, helps analyze the load balancing of federated clusters, and improves the availability of distributed clusters. The device includes:
[0063] processor;
[0064] The controller stores program codes executable by the processor. When the processor runs the program codes, the processor performs the following steps:
[0065] Receive a distributed file system service request from a client, parse the client information from the service request and record the client information in a log;
[0066] Determine the corresponding subcluster in the distributed file system based on the service request, forward the service request to the subcluster and record the subcluster connection information in the log;
[0067] receiving feedback information for the service request from the sub-cluster, and recording the feedback information in a log in association with client information corresponding to the feedback information;
[0068] In response to the feedback information including the service execution failure, client information corresponding to the feedback information is sent to the sub-cluster based on the connection information.
[0069] The step of the method or algorithm described in conjunction with the disclosure here can be directly included in hardware, in a software module executed by a processor, or in a combination of the two. The software module can reside in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or a storage medium of any other form known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium or write information to the storage medium. In an alternative, the storage medium can be integrated with the processor. The processor and the storage medium can reside in an ASIC. The ASIC can reside in a user terminal. In an alternative, the processor and the storage medium can reside in a user terminal as discrete components.
[0070] In some implementations, parsing the client information from the service request includes parsing at least one of the following: the initiation time of the service request, the network address of the client, the remote procedure call method requested by the client, and method parameters of the remote procedure call method.
[0071] In some embodiments, determining a corresponding subcluster in a distributed file system based on a service request, forwarding the service request to the subcluster, and recording connection information of the subcluster in a log includes: determining a corresponding subcluster in a distributed file system based on the service request, determining an active name node in the subcluster, forwarding the service request to the name node, and recording the network address of the name node in a log.
[0072] In some implementations, receiving feedback information for the service request from the sub-cluster includes receiving at least one of the following: whether the service request is successfully executed, and the end time of the service request.
[0073] In some embodiments, recording the feedback information in a log in association with the client information corresponding to the feedback information includes: determining the overall time consumed by the service request based on the end time of the service request and the initiation time of the service request, and recording in the log whether the service request is successfully executed, the end time of the service request, and the overall time consumed by the service request in association with the client information corresponding to the feedback information.
[0074] In one or more exemplary designs, the functions can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored on a computer-readable medium or transmitted via a computer-readable medium as one or more instructions or codes. Computer-readable media include computer storage media and communication media, and the communication media include any media that helps to transfer a computer program from one location to another. The storage medium can be any available medium that can be accessed by a general or special-purpose computer. As an example and not limiting, the computer-readable medium can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, disk storage devices or other magnetic storage devices, or can be used to carry or store the required program code in the form of instructions or data structures and can be accessed by a general or special-purpose computer or a general or special-purpose processor. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwaves are used to send software from a website, server or other remote source, the above-mentioned coaxial cable, optical fiber cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwaves are all included in the definition of the medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, Blu-ray disc, wherein disks usually reproduce data magnetically, while optical discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0075] In some implementations, the method further includes executing the following step: in response to the feedback information including success or failure of service execution, feeding back the feedback information to the client based on the client information.
[0076] In some implementations, the following steps are also included: in response to receiving a remote procedure call query request, a remote procedure call method is parsed from the remote procedure call query request, and client information and feedback information related to the remote procedure call method recorded in the log are returned as a result.
[0077] In some implementations, the distributed cluster is a Hadoop cluster, and the sub-clusters are subordinate to the Hadoop cluster.
[0078] In some implementations, the client and the sub-clusters form a federated cluster of the Hadoop cluster.
[0079] The devices and equipment disclosed in the examples of the present invention may be various electronic terminal devices, such as mobile phones, personal digital assistants (PDAs), tablet computers (PADs), smart TVs, etc., or large terminal devices, such as servers, etc. Therefore, the scope of protection disclosed in the embodiments of the present invention should not be limited to a specific type of device or equipment. The client disclosed in the embodiments of the present invention may be applied to any of the above electronic terminal devices in the form of electronic hardware, computer software, or a combination of the two.
[0080] It can be seen from the above embodiments that the routing device for distributed cluster requests provided by the embodiments of the present invention receives a service request of a distributed file system from a client, parses the client information from the service request and records the client information in a log; determines the corresponding subcluster in the distributed file system based on the service request, forwards the service request to the subcluster and records the connection information of the subcluster in a log; receives feedback information for the service request from the subcluster, and records the feedback information in a log in association with the client information corresponding to the feedback information; in response to the feedback information including a service execution failure, the technical solution of sending the client information corresponding to the feedback information to the subcluster based on the connection information can facilitate rapid positioning of service failures and input and output congestion, and is helpful to analyze the load balancing of the federated cluster and improve the availability of the distributed cluster.
[0081] It should be particularly pointed out that the embodiment of the above-mentioned device uses the embodiment of the routing method of the distributed cluster request to specifically illustrate the working process of each module, and those skilled in the art can easily think of applying these modules to other embodiments of the routing method of the distributed cluster request. Of course, since the various steps in the embodiment of the routing method of the distributed cluster request can be mutually crossed, replaced, added, and deleted, these reasonable permutations and combinations of the device should also fall within the scope of protection of the present invention, and the scope of protection of the present invention should not be limited to the embodiments.
[0082] The embodiment of the present invention may also include a corresponding computer device. The computer device includes a memory, at least one processor, and a computer program stored in the memory and executable on the processor, and the processor executes any one of the above methods when executing the program.
[0083] Among them, the memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the routing method for distributed cluster requests in the embodiment of the present application. The processor executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory, that is, the routing method for distributed cluster requests of the above method embodiment is implemented.
[0084] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the use of a routing device according to a request of a distributed cluster, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0085] The embodiment of the present invention may also include a corresponding computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions may execute the routing method of the distributed cluster request in any of the above-mentioned method embodiments and the routing device for implementing the distributed cluster request in any of the above-mentioned device embodiments. The embodiment of the computer-readable storage medium may achieve the same or similar effect as any of the above-mentioned method and device embodiments corresponding thereto.
[0086] The embodiments of the present invention may also include a corresponding computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes instructions, which, when executed by a computer, enable the computer to execute the routing method for distributed cluster requests in any of the above-mentioned method embodiments and the routing device for distributed cluster requests in any of the above-mentioned device embodiments. The embodiments of the computer program product can achieve the same or similar effects as the corresponding embodiments of any of the above-mentioned methods and devices.
[0087] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The embodiment of the computer program can achieve the same or similar effect as any of the above-mentioned method embodiments corresponding thereto.
[0088] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0089] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as described above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for routing requests of a distributed cluster, characterized in that: This involves performing the following steps: Receiving a service request of a distributed file system from a client, parsing the client information from the service request, including parsing at least one of the following: the initiation time of the service request, the network address of the client, the remote procedure call method requested by the client, and the method parameters of the remote procedure call method, and recording the client information in a log; Determine a corresponding subcluster in the distributed file system based on the service request, determine an active name node in the subcluster, forward the service request to the name node, and record connection information of the subcluster in the log; Receiving feedback information for the service request from the sub-cluster, including receiving at least one of the following: whether the service request is successfully executed, and an end time of the service request, and recording the feedback information in the log in association with the client information corresponding to the feedback information; In response to the feedback information including a service execution failure, the client information corresponding to the feedback information is sent to the sub-cluster based on the connection information.
2. The method according to claim 1, characterized in that Determining a corresponding subcluster in a distributed file system based on the service request, forwarding the service request to the subcluster and recording connection information of the subcluster in the log includes: determining a corresponding subcluster in a distributed file system based on the service request, and recording a network address of the name node in the log.
3. The method according to claim 1, characterized in that Recording the feedback information in the log in association with the client information corresponding to the feedback information includes: determining the overall time consumption of the service request based on the end time of the service request and the initiation time of the service request, and recording in the log whether the service request is successfully executed, the end time of the service request, and the overall time consumption of the service request in association with the client information corresponding to the feedback information.
4. The method according to claim 1, characterized in that: It also includes performing the following steps: In response to the feedback information including success or failure of service execution, the feedback information is fed back to the client based on the client information.
5. The method according to claim 1, characterized in that It also includes performing the following steps: In response to receiving a remote procedure call query request, a remote procedure call method is parsed from the remote procedure call query request, and the client information and the feedback information related to the remote procedure call method recorded in the log are returned as a result.
6. The method according to claim 1, characterized in that The distributed cluster is a Hadoop cluster, and the sub-cluster is subordinate to the Hadoop cluster.
7. The method according to claim 6, characterized in that The client and the sub-cluster constitute a federated cluster of the Hadoop cluster.
8. A routing device for distributed cluster requests, characterized in that: include: processor; A controller stores program codes executable by the processor, wherein the processor executes the following steps when executing the program codes: Receiving a service request of a distributed file system from a client, parsing the client information from the service request, including parsing at least one of the following: the initiation time of the service request, the network address of the client, the remote procedure call method requested by the client, and the method parameters of the remote procedure call method, and recording the client information in a log; Determine a corresponding subcluster in the distributed file system based on the service request, determine an active name node in the subcluster, forward the service request to the name node, and record connection information of the subcluster in the log; Receiving feedback information for the service request from the sub-cluster, including receiving at least one of the following: whether the service request is successfully executed, and an end time of the service request, and recording the feedback information in the log in association with the client information corresponding to the feedback information; In response to the feedback information including a service execution failure, the client information corresponding to the feedback information is sent to the sub-cluster based on the connection information.
Citation Information
Patent Citations
Maintenance method and device of cluster server
CN104243216A
Cluster log based feedback type node fault processing method and system
CN108521339A