Cluster access method, device and electronic device

By replacing the IP address with the node domain name information when the client connects to the cluster, the problem of node IP address leakage in the cloud computing environment is solved, a secure cluster access method is achieved, and the stability and security of the network connection are enhanced.

CN115499430BActive Publication Date: 2025-01-21BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110616875.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-02
Publication Date
2025-01-21
Estimated Expiration
2041-06-02

AI Technical Summary

Technical Problem

In cloud computing environments, network isolation between clients and Redis clusters increases the risk of node IP address leakage. Existing technologies expose cluster node IP addresses through address mapping and translation.

Method used

The IP address is replaced with the node domain name information. Data access requests are received through the target node in the cluster, and the node domain name information is returned. This allows the client to access the node based on the domain name information, thus blocking the IP address.

Benefits of technology

It reduces the risk of node IP address leakage, improves network connection security and migration robustness, and avoids potential risks associated with address translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115499430B_ABST
    Figure CN115499430B_ABST
Patent Text Reader

Abstract

The present invention provides a cluster access method, device and electronic device, the method comprising: receiving a data access request from a client by a target node in a preset cluster, and determining a first node in the cluster where the target data accessed by the data access request is located; then returning the node domain name information of the first node to the client, so that the client queries the node address of the first node based on the node domain name information, and accesses the first node based on the node address of the first node. In this method, when a client accesses a cluster, the client can establish a connection with the node through the node domain name information of the node in the cluster. Compared with the method of establishing a connection between the client and the cluster node through address conversion, this method shields the IP address of the node in the cluster, and there is no need to convert the IP address, thereby reducing the risk of node IP address leakage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cluster connection, and in particular to a cluster access method, device and electronic device. Background Art

[0002] In the related technology, redis cluster clusters usually use IP address plus port to connect directly to the cluster. When the client directly accesses the redis cluster, the client needs to know the cluster node information of the redis cluster in advance, that is, which data is stored on which nodes. However, with the deployment and implementation of cloud computing environments, there is network isolation between the client and the redis cluster deployment, and network access is generally isolated through network address translation. Therefore, it is necessary to establish a connection between the client and the cluster through address mapping and address translation, which will expose the IP addresses of the nodes in the cluster and increase the risk of node IP address leakage. Summary of the invention

[0003] The object of the present invention is to provide a cluster access method, device and electronic device to avoid exposing the IP addresses of nodes in the cluster when establishing a connection between a client and a cluster, thereby reducing the risk of node IP address leakage.

[0004] In a first aspect, the present invention provides a cluster access method, which is applied to a target node in a preset cluster; the method includes: receiving a data access request from a client, determining from the cluster a first node where the target data accessed by the data access request is located; returning the node domain name information of the first node to the client, so that the client queries the node address of the first node based on the node domain name information, and accesses the first node based on the node address of the first node.

[0005] In an optional embodiment, the step of returning the node domain name information of the first node to the client includes: querying the node domain name information corresponding to the physical address of the first node from a pre-stored first mapping relationship; wherein the first mapping relationship stores the physical address of each node device in the cluster and the node domain name information corresponding to each physical address; and returning the queried node domain name information to the client.

[0006] In an optional implementation, after the above step of returning the queried node domain name information to the client, the method further includes: saving the queried node domain name information of the first node to a designated location.

[0007] In an optional implementation, the method further includes: if it is determined that the target data accessed by the data access request is located at the target node, the target node processes the data access request and returns the processing result to the client.

[0008] In a second aspect, the present invention provides a cluster access method, which is applied to a client, and the method includes: sending a data access request to a target node in a preset cluster, so that the target node determines the first node where the target data accessed by the data access request is located from the cluster, and returns the node domain name information of the first node; querying the node address of the first node based on the received node domain name information, and accessing the first node based on the node address of the first node.

[0009] In an optional embodiment, the above-mentioned step of querying the node address of the first node based on the received node domain name information includes: querying the node address corresponding to the node domain name information from a pre-stored second mapping relationship; wherein the second mapping relationship stores the node address of each node device in the cluster, and the node domain name information corresponding to the node address.

[0010] In an optional embodiment, the above-mentioned step of accessing the first node based on the node address of the first node includes: based on a pre-stored correspondence between the physical address and the node address of each node device in the cluster, routing the data access request to the first node according to the node address of the first node to access the first node.

[0011] In a third aspect, the present invention provides a cluster access device, which is arranged at a target node in a preset cluster; the device includes: a node determination module, used to receive a data access request from a client, and determine from the cluster a first node where the target data accessed by the data access request is located; a domain name sending module, used to return the node domain name information of the first node to the client, so that the client can query the node address of the first node based on the node domain name information, and access the first node based on the node address of the first node.

[0012] In a fourth aspect, the present invention provides a cluster access device, which is arranged on a client, and includes: a request sending module, used to send a data access request to a target node in a preset cluster, so that the target node determines the first node where the target data accessed by the data access request is located from the cluster, and returns the node domain name information of the first node; a domain name query module, used to query the node address of the first node based on the received node domain name information, and access the first node based on the node address of the first node.

[0013] In a fifth aspect, the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the cluster access method described in any one of the aforementioned implementations.

[0014] In a sixth aspect, the present invention provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the cluster access method described in any one of the aforementioned implementations.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The present invention provides a cluster access method, device and electronic device, firstly, a target node in a preset cluster receives a data access request from a client, and determines the first node where the target data accessed by the data access request is located from the cluster; then, the node domain name information of the first node is returned to the client, so that the client queries the node address of the first node based on the node domain name information, and accesses the first node based on the node address of the first node. In this method, when a client accesses a cluster, the client can establish a connection with the node through the node domain name information of the node in the cluster. Compared with the method of establishing a connection between the client and the cluster node through address conversion, this method shields the IP address of the node in the cluster, and there is no need to convert the IP address, thereby reducing the risk of node IP address leakage.

[0017] Other features and advantages of the present invention will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present invention.

[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A flow chart of a cluster access method provided by an embodiment of the present invention;

[0021] Figure 2 A flowchart of another cluster access method provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of cluster access provided by an embodiment of the present invention;

[0023] Figure 4A flowchart of another cluster access method provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of the structure of a cluster access device provided by an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of the structure of another cluster access device provided by an embodiment of the present invention;

[0026] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0028] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] In the related art, the connection between the client and the cluster usually includes two modes, one is the proxy mode and the other is the direct connection mode. At present, most of the redis clusters in cloud computing environments use the proxy mode (equivalent to the proxy mode) to shield the redis backend cluster, but this causes the performance of the proxy to become the bottleneck of the redis cluster, so that the distributed access and write performance of the normal redis cluster cannot be fully formed.

[0030] Redis clusters usually use IP (Internet Protocol) address plus port for cluster direct connection (equivalent to direct connection mode). When the client directly accesses the redis cluster, the client needs to know the cluster node information of the redis cluster in advance, that is, which data is stored on which nodes. However, with the deployment and implementation of cloud computing environments, there is network isolation between the client and the redis cluster deployment, and network access is generally isolated through network address translation to prevent the exposure of internal network information. At the same time, the client manages VPC (Virtual Private Cloud) addresses. Therefore, it is necessary to establish a connection between the client and the cluster through address mapping and address translation, which will expose the IP addresses of the nodes in the cluster and increase the risk of node IP address leakage.

[0031] Based on the above problems, the embodiments of the present invention provide a cluster access method, device and electronic device. The technology can be applied to cluster direct connection and network isolation scenarios of various clusters.

[0032] To facilitate understanding of this embodiment, a cluster access method disclosed in an embodiment of the present invention is first introduced in detail. The method can be applied to a target node in a preset cluster. The preset cluster can be various clusters, such as a redis cluster or a Zookeeper cluster. The cluster usually includes multiple node devices, and the multiple node devices can be communicated and connected. The target node can be any node device in the cluster, or a node device (also called an entry node) specified in advance by the user from multiple node devices included in the cluster. Figure 1 As shown, the method comprises the following specific steps:

[0033] Step S102: receiving a data access request from a client, and determining a first node in the cluster where target data accessed by the data access request is located.

[0034] In a specific implementation, a user can send a data access request to a target node in a cluster through a client, which can be a mobile terminal (e.g., a mobile phone, a tablet computer, a smart bracelet, etc.) or a computer. The data access request can be a data read request, a data write request, or other data processing request.

[0035] When the target node receives a data access request sent by the client, the target node can determine the first node in the cluster where the target data accessed by the data access request is located. If the first node is the target node itself, the target node directly establishes a connection with the client and processes the data access request. If the first node is a node device other than the target node in the cluster, it is necessary to determine the node domain name information of the first node.

[0036] Step S104: Return the node domain name information of the first node to the client, so that the client queries the node address of the first node based on the node domain name information and accesses the first node based on the node address of the first node.

[0037] In specific implementation, the cluster contains node domain name information corresponding to each node device, and the node domain name information is unique, that is, one node device uniquely corresponds to one node domain name information. The setting rules of the node domain name information corresponding to each node device can be set according to R&D requirements. For example, assuming that the cluster contains three node devices, node a, node b and node c, then the node domain name information corresponding to node a can be cluster-node-a-cn, the node domain name information corresponding to node b can be cluster-node-b-cn, and the node domain name information corresponding to node c can be cluster-node-c-cn.

[0038] The target node can return the node domain name information of the first node to the client in the form of an instruction (for example, a moved instruction or a cluster instruction, etc.). After receiving the node domain name information, the client can query the node address of the first node from the correspondence between the pre-saved node domain name information and the node address, and then re-send a data acquisition request to the first node based on the node address to access the first node. In a specific implementation, the client pre-saved the node address corresponding to each node device in the cluster, and the node domain name information corresponding to each node address.

[0039] In the related art, when the cluster is directly connected, the node information is usually returned to the client in the form of instructions. However, the returned node information includes the actual IP address and port number of the node, which easily exposes the actual IP address of the node. The present invention uses the node domain name information to hide the corresponding IP address information in all the places where the IP address is returned in the related art in the instruction. That is, the node domain name information is used to replace the IP address information in the existing instruction, thereby shielding the IP topology information of the VPC network and reducing the user's division of the internal network.

[0040] A cluster access method provided by an embodiment of the present invention first receives a data access request from a client by a target node in a preset cluster, and determines the first node where the target data accessed by the data access request is located from the cluster; then returns the node domain name information of the first node to the client, so that the client queries the node address of the first node based on the node domain name information, and accesses the first node based on the node address of the first node. In this method, when a client accesses a cluster, the client can establish a connection with the node through the node domain name information of the node in the cluster. Compared with the method of establishing a connection between the client and the cluster node through address conversion, this method shields the IP address of the node in the cluster, and there is no need to convert the IP address, thereby reducing the risk of node IP address leakage.

[0041] The embodiment of the present invention also provides another cluster access method, which is implemented on the basis of the above embodiment method; the method focuses on describing the specific process of returning the node domain name information of the first node to the client (implemented by the following steps S210-S212); Figure 2 As shown, the method comprises the following specific steps:

[0042] Step S202: receiving a data access request from a client.

[0043] Step S204, determining whether the target data accessed by the data access request is located in the target node, if yes, executing step S206; otherwise, executing step S208.

[0044] When the target node receives a data access request from a client point, it will first determine whether the target data accessed by the data access request is located on its own node (that is, the target node). If so, the data access request will be processed by the target node; if not, it is necessary to determine from the cluster the node device where the target data accessed by the data access request is located, so that the data access request can be processed by the node device.

[0045] Step S206, the target node processes the data access request and returns the processing result to the client; end.

[0046] In the specific implementation, when the target node processes a data access request, if the data access request is a data read request, the target node will return the target data to be read by the data read request to the client; if the data access request is a data write request, the target node will write the data to be written carried by the data write request into the target data.

[0047] Step S208: determining, from the cluster, a first node where the target data accessed by the data access request is located.

[0048] Since each node device in the cluster knows the data stored in other node devices, the first node where the target data is located can be determined according to the target data accessed by the data access request.

[0049] Step S210: query the node domain name information corresponding to the physical address of the first node from the pre-stored first mapping relationship.

[0050] The first mapping relationship stores the physical address of each node device in the cluster and the node domain name information corresponding to each physical address. The physical address can also be called the actual IP address of the node device. In specific implementation, the first mapping relationship can be stored in the resource memory DNS (Domain Name System) in the cluster. Figure 3 The figure shows a schematic diagram of cluster access. Figure 3 The cluster in includes three node devices: node a, node b and node c. The first mapping relationship (which can also be understood as resource memory DNS) stores the physical address 192.168.1.1 and node domain name information cluster-node-a-cn corresponding to node a, the physical address 192.168.1.3 and node domain name information cluster-node-b-cn corresponding to node b, and the physical address 192.168.1.3 and node domain name information cluster-node-c-cn corresponding to node c.

[0051] Step S212: Return the queried node domain name information to the client, so that the client queries the node address of the first node based on the node domain name information, and accesses the first node based on the node address of the first node.

[0052] Since each node device in the cluster knows the physical addresses of other node devices, the target node can query the node domain name information corresponding to the physical address of the first node from the first mapping relationship based on the physical address of the first node, and return the node domain name information to the client. In specific implementation, after the target node returns the queried node domain name information of the first node to the client, the target node will also save the queried node domain name information of the first node to a specified location, so that the next time it is determined that the first node needs to be accessed, the node domain name information of the first node can be directly obtained from the specified location without having to query from the first mapping relationship again, thereby improving the request processing efficiency. The specified location can be the memory or database of the target node, etc.

[0053] In specific implementation, the target node can return the node domain name information to the client in the form of an instruction, which usually carries the node domain name information and the node port number. It can also be understood that the present invention replaces the cluster direct connection mode using IP address plus port in the prior art with the cluster direct connection mode using node domain name information plus port.

[0054] In the above cluster access method, first, the target node receives a data access request from the client, and then determines whether the target data accessed by the data access request is located in the target node. If so, the target node processes the data access request and returns the processing result to the client; otherwise, the first node where the target data accessed by the data access request is located is determined from the cluster, and then the node domain name information corresponding to the physical address of the first node is queried from the pre-stored first mapping relationship, and the queried node domain name information is returned to the client, so that the client can query the node address of the first node based on the node domain name information and access the first node based on the node address of the first node. When performing cluster direct connection, this method uses node domain name information to replace the physical address of the node in the prior art, so that the mapped physical address can be dynamically modified by modifying the node domain name, so as to enhance the robustness of migration and reduce the risk of network physical address leakage.

[0055] The embodiment of the present invention also provides another cluster access method, which is implemented on the basis of the method in the above embodiment; the method is applied to the client, such as Figure 4 As shown, the method comprises the following specific steps:

[0056] Step S402, sending a data access request to a target node in a preset cluster, so that the target node determines from the cluster the first node where the target data accessed by the data access request is located, and returns the node domain name information of the first node.

[0057] The specific steps of the target node determining and returning the node domain name information of the first node can refer to the above embodiment and will not be repeated here.

[0058] Step S404: query the node address of the first node based on the received node domain name information, and access the first node based on the node address of the first node.

[0059] In specific implementation, the above step S404 can also be implemented through the following steps 10-11:

[0060] Step 10: query the node address corresponding to the node domain name information from the pre-stored second mapping relationship; wherein the second mapping relationship stores the node address of each node device in the cluster and the node domain name information corresponding to the node address.

[0061] The node address can be understood as the VPC intranet IP address, or as the intranet IP. In specific implementation, the second mapping relationship can be stored in a preset user-side DNS. For example, Figure 3 The cluster includes three node devices: node a, node b and node c. The second mapping relationship (which can also be understood as the user-side DNS) stores the node address 17.1.1.1 and node domain name information cluster-node-a-cn corresponding to node a, the node address 17.1.1.2 and node domain name information cluster-node-b-cn corresponding to node b, and the node address 17.1.1.3 and node domain name information cluster-node-c-cn corresponding to node c.

[0062] Step 11: Based on the pre-stored correspondence between the physical address and the node address of each node device in the cluster, the data access request is routed to the first node according to the node address of the first node to access the first node.

[0063] In a specific implementation, the network load balancing layer stores the correspondence between the physical address and the node address of each node device in the cluster.

[0064] In order to facilitate understanding of the embodiments of the present invention, Figure 3 The cluster access method in the present invention is introduced. First, node c in the cluster is used as the entry node (equivalent to the above-mentioned target node). When node c receives a data read and write request sent by the client, if it is found that the target data specified by the data read and write request is not in this node (that is, not in node c), then the node where the target data is located will be determined in the cluster, for example, in node a; then node c will return a moved command, and the moved instruction carries the node domain name information and port number of node a. When the client receives the moved instruction, it will parse the moved instruction, that is, query the node address corresponding to the node domain name information carried by the moved instruction from the user-side DNS, and find that the node address of node a is 17.1.1.1. Then the client tries to reconnect to the address 17.1.1.1 of node A, and resends the read and write data request. Since the address 17.1.1.1 in the network load balancing layer is mapped to the physical address 192.168.1.1, the resent data read and write request can be routed to node a, so that node a processes the data read request and returns the processing result.

[0065] In the above cluster access method, the client first sends a data access request to the target node in the preset cluster, so that the target node determines the first node where the target data accessed by the data access request is located from the cluster, and returns the node domain name information of the first node; then, based on the received node domain name information, the node address of the first node is queried, and the first node is accessed based on the node address of the first node. In this method, the client establishes a connection with the node through the node domain name information of the node in the cluster. Compared with the method of establishing a connection between the client and the cluster node through address conversion, this method shields the IP address of the node in the cluster, and there is no need to convert the IP address, thereby reducing the risk of node IP address leakage.

[0066] In view of the above-mentioned cluster access method embodiment, the present invention provides a cluster access device, which is set at a target node in a preset cluster; Figure 5 As shown, the device comprises:

[0067] The node determination module 50 is used to receive a data access request from a client, and determine a first node in the cluster where target data accessed by the data access request is located.

[0068] The domain name sending module 51 is used to return the node domain name information of the first node to the client, so that the client can query the node address of the first node based on the node domain name information and access the first node based on the node address of the first node.

[0069] The above cluster access device first receives the data access request from the client by the target node in the preset cluster, and determines the first node where the target data accessed by the data access request is located from the cluster; then returns the node domain name information of the first node to the client, so that the client queries the node address of the first node based on the node domain name information, and accesses the first node based on the node address of the first node. In this method, when the client accesses the cluster, the client can establish a connection with the node through the node domain name information of the node in the cluster. Compared with the method of establishing a connection between the client and the cluster node through address conversion, this method shields the IP address of the node in the cluster, and there is no need to convert the IP address, thereby reducing the risk of node IP address leakage.

[0070] Furthermore, the above-mentioned domain name sending module 51 is also used to: query the node domain name information corresponding to the physical address of the first node from a pre-stored first mapping relationship; wherein the first mapping relationship stores the physical address of each node device in the cluster, and the node domain name information corresponding to each physical address; and return the queried node domain name information to the client.

[0071] Specifically, the above-mentioned device also includes a domain name saving module, which is used to: after returning the queried node domain name information to the client, save the queried node domain name information of the first node to a designated location.

[0072] In a specific implementation, the above device also includes a data return module, which is used to: if it is determined that the target data accessed by the data access request is located at the target node, the target node processes the data access request and returns the processing result to the client.

[0073] The cluster access device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0074] In view of the above-mentioned cluster access method embodiment, the present invention provides another cluster access device, which is arranged at a client, such as Figure 6 As shown, the device comprises:

[0075] The request sending module 60 is used to send a data access request to a target node in a preset cluster, so that the target node determines the first node where the target data accessed by the data access request is located from the cluster, and returns the node domain name information of the first node.

[0076] The domain name query module 61 is used to query the node address of the first node based on the received node domain name information, and access the first node based on the node address of the first node.

[0077] In the above cluster access device, the client first sends a data access request to the target node in the preset cluster, so that the target node determines the first node where the target data accessed by the data access request is located from the cluster, and returns the node domain name information of the first node; then the node address of the first node is queried based on the received node domain name information, and the first node is accessed based on the node address of the first node. In this method, the client establishes a connection with the node through the node domain name information of the node in the cluster. Compared with the method of establishing a connection between the client and the cluster node through address conversion, this method shields the IP address of the node in the cluster, and there is no need to convert the IP address, thereby reducing the risk of node IP address leakage.

[0078] Furthermore, the domain name query module 61 is used to query the node address corresponding to the node domain name information from a pre-stored second mapping relationship; wherein the second mapping relationship stores the node address of each node device in the cluster and the node domain name information corresponding to the node address.

[0079] Specifically, the above-mentioned domain name query module 61 is also used to: after querying the node address of the first node, based on the pre-stored correspondence between the physical address and the node address of each node device in the cluster, route the data access request to the first node according to the node address of the first node to access the first node.

[0080] The cluster access device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned cluster access method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0081] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, the electronic device includes a processor 101 and a memory 100 , wherein the memory 100 stores machine executable instructions that can be executed by the processor 101 , and the processor 101 executes the machine executable instructions to implement the above cluster access method.

[0082] Further, Figure 7 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .

[0083] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0084] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.

[0085] An embodiment of the present invention further provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned cluster access method. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0086] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0087] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A cluster access method, characterized in that: The method is applied to a target node in a preset cluster; wherein the cluster includes a plurality of node devices, and the plurality of node devices are communicatively connected with each other, wherein the target node is any node device in the cluster, or is a node device specified in advance by a user from the plurality of node devices included in the cluster; the method comprises: receiving a data access request from a client, and determining from the cluster a first node where target data accessed by the data access request is located; If it is determined that the target data accessed by the data access request is located at the target node, the target node processes the data access request and returns the processing result to the client; If the first node is a node device other than the target node in the cluster, the node domain name information of the first node is returned to the client, so that the client queries the node address of the first node based on the node domain name information and accesses the first node based on the node address of the first node.

2. The method according to claim 1, characterized in that The step of returning the node domain name information of the first node to the client includes: Querying the node domain name information corresponding to the physical address of the first node from a pre-stored first mapping relationship; wherein the first mapping relationship stores the physical address of each node device in the cluster and the node domain name information corresponding to each physical address; The queried node domain name information is returned to the client.

3. The method according to claim 2, characterized in that After the step of returning the queried node domain name information to the client, the method further includes: The node domain name information of the first node found out is saved to a specified location.

4. A cluster access method, characterized in that: The method is applied to a client, and the method comprises: A data access request is sent to a target node in a preset cluster, so that the target node determines from the cluster a first node where the target data accessed by the data access request is located, and returns the node domain name information of the first node; wherein, if the target node determines that the target data accessed by the data access request is located at the target node, the target node processes the data access request and returns the processing result to the client; if the first node is a node device other than the target node in the cluster, the target node returns the node domain name information of the first node to the client; the cluster includes a plurality of node devices, and the plurality of node devices are communicatively connected with each other, wherein the target node is any node device in the cluster, or is a node device specified in advance by the user from the plurality of node devices included in the cluster; The node address of the first node is queried based on the received node domain name information, and the first node is accessed based on the node address of the first node.

5. The method according to claim 4, characterized in that The step of querying the node address of the first node based on the received node domain name information includes: The node address corresponding to the node domain name information is queried from a pre-stored second mapping relationship; wherein the second mapping relationship stores the node address of each node device in the cluster and the node domain name information corresponding to the node address.

6. The method according to claim 4, characterized in that The step of accessing the first node based on the node address of the first node comprises: Based on the pre-stored correspondence between the physical address and the node address of each node device in the cluster, the data access request is routed to the first node according to the node address of the first node to access the first node.

7. A cluster access device, characterized in that: The device is set at a target node in a preset cluster; wherein the cluster includes a plurality of node devices, and the plurality of node devices are communicatively connected with each other, wherein the target node is any node device in the cluster, or is a node device specified in advance by a user from the plurality of node devices included in the cluster; the device includes: a node determination module, configured to receive a data access request from a client, and determine from the cluster a first node where target data accessed by the data access request is located; if it is determined that the target data accessed by the data access request is located at the target node, the target node processes the data access request and returns the processing result to the client; A domain name sending module is used to return the node domain name information of the first node to the client if the first node is a node device other than the target node in the cluster, so that the client can query the node address of the first node based on the node domain name information and access the first node based on the node address of the first node.

8. A cluster access device, characterized in that: The device is arranged at a client, and comprises: A request sending module, used for sending a data access request to a target node in a preset cluster, so that the target node determines from the cluster a first node where the target data accessed by the data access request is located, and returns the node domain name information of the first node; wherein, if the target node determines that the target data accessed by the data access request is located at the target node, the target node processes the data access request and returns the processing result to the client; if the first node is a node device other than the target node in the cluster, the target node returns the node domain name information of the first node to the client; the cluster includes a plurality of node devices, and the plurality of node devices are communicatively connected with each other, wherein the target node is any node device in the cluster, or is a node device specified in advance by the user from the plurality of node devices included in the cluster; A domain name query module is used to query the node address of the first node based on the received node domain name information, and access the first node based on the node address of the first node.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the cluster access method according to any one of claims 1 to 6.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the cluster access method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Apparatus, system and method for distributing stream medium content

    CN101252590A

  • Domain name resolution method and system

    CN106936938A

  • Data access method and device of NAS cluster, equipment and storage medium

    CN110650204A