WO2016101759A1 - 一种数据路由方法、数据管理装置和分布式存储系统 - Google Patents

一种数据路由方法、数据管理装置和分布式存储系统 Download PDF

Info

Publication number
WO2016101759A1
WO2016101759A1 PCT/CN2015/095507 CN2015095507W WO2016101759A1 WO 2016101759 A1 WO2016101759 A1 WO 2016101759A1 CN 2015095507 W CN2015095507 W CN 2015095507W WO 2016101759 A1 WO2016101759 A1 WO 2016101759A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
node
information
data node
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2015/095507
Other languages
English (en)
French (fr)
Inventor
陈营
李明昊
宋昭
陈宗志
王超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Publication of WO2016101759A1 publication Critical patent/WO2016101759A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Definitions

  • the present invention relates to the field of distributed storage technologies, and in particular, to a data routing method, a data management apparatus, and a distributed storage system.
  • GFS Google File System
  • MapReduce Map Simplification
  • GFS divides nodes of the entire system into three types of roles: Client (Client), Master (Master Server), and Chunk Server (Data Block Server); Client is the access interface provided by GFS to the application; Master is the management node of GFS, there is only one logic, it saves the metadata of the system and is responsible for the management of the entire file system; Chunk Server is responsible for the specific storage work, the data is filed. The form is stored on the Chunk Server, and the number of Chunk Servers can be multiple.
  • the client When the client accesses the GFS, the client first sends a metadata routing request to the master, where the metadata routing request carries key (keyword) information, and the master obtains the Chunk Server information corresponding to the key according to the stored metadata table, and then directly Access these Chunk Servers to complete data access.
  • This design method of GFS realizes the separation of control flow and data flow. There is only control flow between the Client and the Master, and there is no data flow, which greatly reduces the load of the Master, so that it does not become a bottleneck of system performance.
  • the client and the Chunk Server directly transmit data streams.
  • the Client can access multiple Chunk Servers at the same time, so that the I/O of the entire system is highly parallel and the overall performance of the system is improved.
  • the present invention has been made in order to provide a data routing method, a data management apparatus, and a distributed storage system that overcome the above problems or at least partially solve the above problems.
  • a data routing method including:
  • the data node obtains data node information corresponding to the first keyword information according to the first keyword information matching the metadata table of the first keyword information; wherein the metadata table stores data node information corresponding to the keyword,
  • the metadata table is maintained based on communication between data nodes;
  • the data node returns the data node information to the client.
  • a computer program comprising computer readable code that, when executed on a computing device, causes the computing device to perform a data routing method as described above.
  • a computer readable medium storing a computer program as described above.
  • a data management apparatus including:
  • a first receiving module configured to receive a metadata routing request from the client, where the metadata routing request carries first keyword information of the data
  • the first matching module is configured to obtain data node information corresponding to the first keyword information according to the first keyword information matching the metadata table of the first keyword information, where the metadata table stores data corresponding to the keyword Node information, which is obtained based on communication maintenance between data nodes;
  • a first return module configured to return the data node information to the client.
  • a data node can process metadata of a client by using a metadata table stored by itself. Routing request; since the data node can maintain the metadata table based on the communication between the data nodes, the maintained metadata table can reflect the change of the node state in time, thereby ensuring that the correct data node information is fed back to the client, thereby improving The accuracy of the metadata routing; and the use of the dedicated master to store and maintain the metadata table acquisition in the prior art, the embodiment of the present invention reduces the role of the master, thereby reducing the operation and maintenance deployment of the distributed storage system. cost.
  • FIG. 1 is a schematic structural view of a prior art GFS
  • FIG. 2 is a flow chart showing the steps of a data routing method according to an embodiment of the present invention.
  • FIG. 3 is a block diagram showing the structure of a distributed storage system according to an example of the present invention.
  • FIG. 4 is a flow chart showing the steps of a data routing method according to an embodiment of the present invention.
  • FIG. 5 is a flow chart showing the steps of a data routing method according to an embodiment of the present invention.
  • FIG. 6 is a flow chart showing the steps of maintaining a data table based on communication between data nodes according to an embodiment of the present invention
  • FIG. 7 is a flow chart showing the steps of a data routing method according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a data management apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a data management apparatus according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a data management apparatus according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a distributed storage system according to an embodiment of the present invention.
  • Figure 12 schematically shows a block diagram of a computing device for performing the method according to the invention
  • Fig. 13 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • FIG. 2 a schematic flowchart of a step of a data routing method according to an embodiment of the present invention is shown, which may include the following steps:
  • Step 201 The data node receives a metadata routing request from the client, where the metadata routing request carries the first keyword information of the data.
  • Step 202 The data node matches the metadata table of the first keyword information to obtain data node information corresponding to the first keyword information, where the metadata table stores data corresponding to the keyword. Node information, which is obtained based on communication maintenance between data nodes;
  • Step 203 The data node returns the data node information to the client.
  • the embodiments of the present invention can be applied to distributed storage systems of various services for improving the accuracy of metadata routing.
  • the method includes: a client 301 and a data node 302.
  • the client 301 serves as an initiator of a service request and can pass the element.
  • the data routing request acquires the data node information corresponding to the metadata routing request from the data node 302, so that the data node information corresponding data node 302 can be accessed to complete the data access operation; the data node 302 can store the metadata.
  • Table, And the data nodes 302 can communicate with each other, so that the metadata table can be maintained based on communication between the data nodes 302 to ensure that the metadata table can reflect changes in node status in time.
  • the step of the data node obtaining the data node information corresponding to the first keyword information according to the first keyword information matching the metadata table of the first keyword information may specifically include :
  • Sub-step A1 calculating a hash value of the first keyword information
  • Sub-step A2 matching the metadata table according to the hash value, to obtain the hash value corresponding data node information.
  • a hash algorithm such as a one-way hash algorithm may be used to calculate a hash value of the first keyword information, and the specific hash algorithm is not limited in the embodiment of the present invention.
  • the data node information may specifically include one or more of the following information: node number information, node attribute information, and node communication rate information.
  • the node attribute information may specifically include: information that the node is available or the node is unavailable, and the node communication rate information may be a communication rate value of the node or the like.
  • the node number information of the data node corresponding to the hash value may be the number of the data node itself, or may be the number of other data nodes, whichever is the case, the data node
  • the hash value corresponding to the node number of the data node may be returned to the client to satisfy the client's further node access request.
  • the data node can use its stored metadata table to process the client's metadata routing request; since the data node can maintain the metadata table based on the communication between the data nodes, the maintained metadata table can reflect the node in time.
  • the change of the state therefore, can ensure that the correct data node information is fed back to the client, and the accuracy of the metadata routing is improved; and the implementation of the present invention is implemented by using a dedicated Master to store and maintain the metadata table acquisition in the prior art. This reduces the role of the Master, thus reducing the operating and deployment costs of distributed storage systems.
  • FIG. 4 a schematic flowchart of a step of a data routing method according to an embodiment of the present invention is shown, which may include the following steps:
  • Step 401 The data node receives a metadata routing request from a client, where the element The data routing request carries the first keyword information of the data;
  • Step 402 The data node matches the metadata table of the first keyword information to obtain data node information corresponding to the first keyword information, where the metadata table stores data corresponding to the keyword. Node information, which is obtained based on communication maintenance between data nodes;
  • Step 403 The data node returns the data node information to the client.
  • Step 404 When the data node information corresponding to the first keyword information is not the data node itself, the data node returns the metadata table to the client.
  • the data node when the data node information corresponding to the first keyword information is not the data node itself, the data node may further return the metadata table to the client. End, that is, the current metadata table can be provided to the client, so that the client can query the metadata by querying its own metadata table.
  • the metadata can be routed in the following two ways: the first method is to perform metadata routing by sending a metadata routing request to the data node, and the second method is to query the metadata table of the user by querying its own metadata table.
  • the routing of metadata in which the first method has the advantage of high accuracy, the second method has the advantage of saving traffic. It can be understood that any one or both of the above two methods may be determined by a person skilled in the art according to actual needs. For example, when the accuracy requirement is strict, the foregoing method 1 may be adopted, and, for example, the traffic demand is strict. In the above manner, the second method may be adopted, or in order to ensure the success rate of the route, the foregoing manners 1 and 2 may be simultaneously adopted.
  • FIG. 5 a schematic flowchart of a step of a data routing method according to an embodiment of the present invention is shown, which may specifically include the following steps:
  • Step 501 The data node receives a metadata routing request from the client, where the metadata routing request carries the first keyword information of the data.
  • Step 502 The data node matches the metadata table of the first keyword information to obtain data node information corresponding to the first keyword information.
  • the metadata table stores data corresponding to the keyword. Node information, which is based on communication maintenance between data nodes get;
  • Step 503 The data node returns the data node information to the client.
  • Step 504 The data node performs maintenance on the metadata table based on communication between data nodes.
  • a flow chart of steps for maintaining a data table based on communication between data nodes is performed according to an embodiment of the present invention, which may specifically include the following steps:
  • Sub-step 541 the coordinator node sends a preparation message to all participant nodes executing the transaction T;
  • each participant node determines whether to submit a transaction T, and if so, returns a ready message to the coordinator node; otherwise, returns an abnormal abort message to the coordinator node;
  • Sub-step 543 when the messages obtained from all participant nodes are ready messages, the coordinator node sends a formal commit message to all participant nodes;
  • Sub-step 544 after receiving the formal submission message, each participant node officially completes the transaction T, releases the occupation during the entire transaction T, and sends a completion message to the coordinator node;
  • Sub-step 545 the coordinator node completes the transaction after receiving the completion message fed back by all the participant nodes;
  • Sub-step 546 when the coordinator node has an abnormal abort message in the message obtained from all the participant nodes, or when the response message of all the participant nodes cannot be acquired before the timeout, the coordinator node to all the participant nodes Issue a rollback message;
  • the timeout can indicate that the official submission message has been issued until the preset period is exceeded.
  • Sub-step 547 after receiving the rollback message, each participant node performs a rollback operation on the transaction T, releases the resources occupied during the entire T transaction, and sends a rollback completion message to the coordinator node;
  • Sub-step 548 after the coordinator node receives the rollback completion message fed back by all the participant nodes, cancels the transaction T.
  • the data node of this embodiment may specifically include: a coordinator node and a participant node, and adding that the data node maintains the metadata table based on communication between data nodes.
  • the metadata maintenance involved in the above sub-step 541 - sub-step 548 The process specifically guarantees the consistency and integrity of the metadata tables maintained by all participant nodes through a two-phase commit protocol.
  • the main idea of the two-phase commit protocol can be: when a transaction T is to operate on multiple databases, it must be ensured that the database of the multiple participant nodes is successfully submitted, and the transaction T can succeed. Therefore, the coordination node can firstly The participant node issues a pre-submission, and the multiple participant nodes return whether they can submit. If all the participant nodes can submit, the coordination node can formally submit the transaction T.
  • sub-step 541 - sub-step 542 is the first stage step
  • sub-step 543 - sub-step 548 is the second stage step.
  • the coordinator node will notify the participant node of the transaction to prepare to commit or cancel the transaction, and the participant node informs the coordinator node of its decision: consent (ready message) or cancellation (abnormal abort message);
  • the coordinator node will make decisions based on information fed back by all participant nodes: commit or cancel, and the coordinator node notifies all participant nodes to commit the transaction if and only if all participant nodes agree to commit the transaction. Otherwise, the coordinator node will notify all participant nodes to cancel the transaction.
  • FIG. 7 a flow chart of steps of a data routing method according to an embodiment of the present invention is shown, which may specifically include the following steps:
  • Step 701 The data node receives a metadata routing request from the client, where the metadata routing request carries the first keyword information of the data.
  • Step 702 The data node matches the metadata table of the first keyword information to obtain data node information corresponding to the first keyword information, where the metadata table stores Data node information corresponding to the keyword, the metadata table is obtained based on communication maintenance between the data nodes;
  • Step 703 The data node returns the data node information to the client.
  • Step 704 The data node receives a read request from a client, where the read request carries second keyword information of data.
  • Step 705 The data node matches its own metadata table according to the second keyword information carried by the read request, to obtain data node information corresponding to the second keyword information.
  • Step 706 The data node determines, according to the data node information corresponding to the second keyword information, whether the read request corresponding data is in the data node itself;
  • Step 707 When the data node information corresponding to the second keyword information is the data node itself, the data node queries its own data engine according to the read request, and returns the data obtained by the query to the client. end;
  • Step 708 When the data node information corresponding to the second keyword information is not the data node itself, forwarding the read request to the first data node corresponding to the data node information corresponding to the second keyword information;
  • Step 709 Receive data corresponding to the read request returned by the first data node, and return the data to the client.
  • the embodiment may also process the read request from the client through steps 704-step 709, in particular, In the process of processing the read request, when the data node information corresponding to the second keyword information carried in the read request is not the data node itself, the data node may also play the role of a network proxy, that is, And forwarding the read request to the first data node corresponding to the data node information corresponding to the second keyword information, and the data corresponding to the read request returned by the first data node is returned to the client;
  • the process in which the proxy client forwards the read request and returns the read data to the client can prevent the client from attempting to send a read request to multiple different data nodes, thereby saving the traffic of the client.
  • the data node may also forward the write request to the client and return the response result to the client.
  • the process of forwarding the write request to the proxy client is similar to the process of forwarding the read request by the proxy client, so it will not be described here and cross-referenced.
  • FIG. 8 is a schematic structural diagram of a data management apparatus according to an embodiment of the present invention, which may specifically include the following modules:
  • the first receiving module 801 is configured to receive a metadata routing request from the client, where the metadata routing request carries the first keyword information of the data;
  • the first matching module 802 is configured to obtain data node information corresponding to the first keyword information according to the first keyword information matching the metadata table of the first keyword information, where the metadata table stores a keyword corresponding Data node information obtained based on communication maintenance between data nodes;
  • the first returning module 803 is configured to return the data node information to the client.
  • the data management device may be a data node itself or a device for managing each data node.
  • the specific location of the data management device is not limited in the embodiment of the present invention.
  • the first matching module 802 may specifically include:
  • a hash calculation submodule configured to calculate a hash value of the first keyword information
  • the hash matching submodule is configured to match the metadata table according to the hash value to obtain the hash value corresponding data node information.
  • the data node may further include:
  • a second returning module configured to: when the data node information corresponding to the first keyword information is not the data node itself, the data node returns the metadata table to the client.
  • FIG. 9 is a schematic structural diagram of a data management apparatus according to an embodiment of the present invention, which may specifically include: a coordinator node 901 and a participant node 902;
  • the coordinator node 901 may specifically include: a first maintenance module 911 configured to perform maintenance on the metadata table based on communication between data nodes;
  • the participant node 902 may specifically include the following modules:
  • the first receiving module 921 is configured to receive a metadata routing request from the client, where the metadata routing request carries the first keyword information of the data;
  • the first matching module 922 is configured to obtain the data node information corresponding to the first keyword information according to the first keyword information matching the metadata table of the first keyword information, where the metadata table stores the keyword corresponding Data node information, which is obtained based on communication maintenance between data nodes;
  • a first returning module 923 configured to return the data node information to the client
  • the second maintenance module 924 is configured to perform maintenance on the metadata table based on communication between data nodes;
  • the first maintenance module 911 may specifically include:
  • the formal submission sending sub-module 9112 is configured to issue a formal submission message to all participant nodes when the messages obtained from all the participant nodes are ready messages;
  • the transaction completion sub-module 9113 is configured to complete the transaction after receiving the completion message fed back by all the participant nodes;
  • Rollback sending sub-module 9114 configured to have an abort message in a message obtained from all participant nodes, or to obtain a response message of all participant nodes before timing out, the coordinator node to all participant nodes Issue a rollback message;
  • the transaction cancellation sub-module 9115 is configured to cancel the transaction T after receiving the rollback completion message fed back by all the participant nodes;
  • the second maintenance module 924 may specifically include:
  • Preparing a response sub-module 9241 configured to determine whether to submit a transaction T, and if so, to the association
  • the caller node returns a ready message, otherwise, returns an abort message to the coordinator node;
  • the transaction execution sub-module 9242 is configured to formally complete the transaction T after receiving the formal submission message, release the occupation during the entire transaction T, and send the completion message to the coordinator node;
  • the rollback submodule 9243 is configured to perform, by each participant node, a rollback operation on the transaction T after receiving the rollback message, release the resources occupied during the entire T transaction, and send back to the coordinator node. Roll the completion message.
  • FIG. 10 a schematic structural diagram of a data management apparatus according to an embodiment of the present invention is shown, which may specifically include the following modules:
  • the first receiving module 1001 is configured to receive a metadata routing request from the client, where the metadata routing request carries first keyword information of the data;
  • the first matching module 1002 is configured to obtain data node information corresponding to the first keyword information according to the first keyword information matching the metadata table of the first keyword information, where the metadata table stores a keyword corresponding Data node information, which is obtained based on communication maintenance between data nodes;
  • the first returning module 1003 is configured to return the data node information to the client
  • the second receiving module 1004 is configured to receive a read request from the client, where the read request carries the second keyword information of the data;
  • the second matching module 1005 is configured to match the metadata table of the second keyword information carried by the read request to obtain the data node information corresponding to the second keyword information;
  • the determining module 1006 is configured to determine, according to the data node information corresponding to the second keyword information, whether the read request corresponding data is in the data node itself;
  • the query module 1007 is configured to: when the data node information corresponding to the second keyword information is the data node itself, the data node queries its own data engine according to the read request, and returns the data obtained by the query to The client;
  • the forwarding module 1008 is configured to: when the data node information corresponding to the second keyword information is not the data node itself, forward the read request to the first data corresponding to the data node information corresponding to the second keyword information Node;
  • the third returning module 1009 is configured to receive data corresponding to the read request returned by the first data node, and return the data to the client.
  • the present invention also provides a distributed storage system, which may specifically include: a client and the foregoing data management device.
  • FIG. 11 is a schematic structural diagram of a distributed storage system according to an embodiment of the present invention, which may specifically include: a client 1101 and a plurality of data nodes 1102;
  • the data node 1102 may specifically include the following modules:
  • the first receiving module 1121 is configured to receive a metadata routing request from the client, where the metadata routing request carries the first keyword information of the data;
  • the first matching module 1122 is configured to obtain data node information corresponding to the first keyword information according to the first keyword information matching the metadata table of the first keyword information, where the metadata table stores a keyword corresponding Data node information obtained based on communication maintenance between data nodes;
  • the first return module 1123 is configured to return the data node information to the client.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the components of the data routing method, data management apparatus, and distributed storage system in accordance with embodiments of the present invention. Some or all of the features.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals.
  • Such signals may be downloaded from an internet platform, provided on a carrier signal, or provided in any other form.
  • Figure 12 illustrates a computing device, such as a search, that can implement the above method in accordance with the present invention.
  • the computing device conventionally includes a processor 1210 and a computer program product or computer readable medium in the form of a memory 1230.
  • the memory 1230 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 1230 has a storage space 1250 that stores program code 1251 for performing any of the method steps described above.
  • storage space 1250 storing program code may include various program codes 1251 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit such as that shown in FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 1230 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit comprises computer readable code 1251' for performing the steps of the method according to the invention, ie code that can be read by a processor such as 1210, which when executed by the server causes the server to execute Each step in the described method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供了一种数据路由方法、数据管理装置和分布式存储系统,其中的方法具体包括:数据节点接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;以及所述数据节点将所述数据节点信息返回给所述客户端。本发明实施例能够保证向客户端反馈正确的数据节点信息,提高元数据路由的准确率,且能够降低分布式存储系统的运维成本。

Description

一种数据路由方法、数据管理装置和分布式存储系统 技术领域
本发明涉及分布式存储技术领域,特别是涉及一种数据路由方法、一种数据管理装置和一种分布式存储系统。
背景技术
GFS(Google文件系统,Google File System)是一个大型的分布式文件系统,它为Google云计算提供海量存储,并且与MapReduce(映射化简)技术结合十分紧密。
参照图1,示出了现有技术一种GFS的结构示意图,GFS将整个系统的节点分为三类角色:Client(客户端)、Master(主服务器)和Chunk Server(数据块服务器);其中,Client是GFS提供给应用程序的访问接口;Master是GFS的管理节点,在逻辑上只有一个,它保存系统的元数据,负责整个文件系统的管理;Chunk Server负责具体的存储工作,数据以文件的形式存储在Chunk Server上,Chunk Server的个数可以有多个。
客户端在访问GFS时,首先向Master发送元数据路由请求,所述元数据路由请求中携带有key(关键字)信息,由Master依据存储的元数据表获取key对应的Chunk Server信息,然后直接访问这些Chunk Server完成数据存取。GFS的这种设计方法实现了控制流和数据流的分离。Client与Master之间只有控制流,而无数据流,这样就极大地降低了Master的负载,使之不成为系统性能的一个瓶颈。Client与Chunk Server之间直接传输数据流,同时由于文件被分成多个Chunk进行分布式存储,Client可以同时访问多个Chunk Server,从而使得整个系统的I/O高度并行,系统整体性能得到提高。
然而,网络抖动、节点故障等因素容易导致key对应的Chunk Server发生变化,而Master作为管理节点不能及时获知上述情况下元数据的变化,因此,不能保证向客户端反馈正确的Chunk Server信息。通常情况下,客户端在元数据请求失败时,还需要向Master发送更新元数据表的请求,并持续等待Master依据更新后元数据表返回的Chunk Server信息。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种数据路由方法、一种数据管理装置和一种分布式存储系统。
依据本发明的一个方面,提供了一种数据路由方法,包括:
数据节点接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;以及
所述数据节点将所述数据节点信息返回给所述客户端。
根据本发明的另一方面,提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行如上文所述的数据路由方法。
根据本发明的再一方面,提供了一种计算机可读介质,其中存储了如上文所述的计算机程序。
根据本发明的又一方面,提供了一种数据管理装置,包括:
第一接收模块,配置为接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
第一匹配模块,配置为依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;以及
第一返回模块,配置为将所述数据节点信息返回给所述客户端。
根据本发明实施例的一种数据路由方法、一种数据管理装置和一种分布式存储系统,数据节点可以利用自身存储的元数据表来处理客户端的元数据 路由请求;由于数据节点可以基于数据节点之间的通信进行元数据表的维护,使得维护的元数据表能够及时反映节点状态的变化,因此,能够保证向客户端反馈正确的数据节点信息,提高元数据路由的准确率;并且,相对于现有技术中采用专门的Master来存储并维护元数据表获取,本发明实施例减少了Master这一角色,因此能够降低分布式存储系统的运维部署成本。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文可选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出可选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了现有技术一种GFS的结构示意图;
图2示出了根据本发明一个实施例的一种数据路由方法的步骤流程示意图;
图3示出了根据本发明一个示例的一种分布式存储系统的结构示意图;
图4示出了根据本发明一个实施例的一种数据路由方法的步骤流程示意图;
图5示出了根据本发明一个实施例的一种数据路由方法的步骤流程示意图;
图6示出了根据本发明一个实施例的一种数据节点基于数据节点之间的通信对所述元数据表进行维护的步骤流程示意图;
图7示出了根据本发明一个实施例的一种数据路由方法的步骤流程示意图;
图8示出了根据本发明一个实施例的一种数据管理装置的结构示意图;
图9示出了根据本发明一个实施例的一种数据管理装置的结构示意图;
图10示出了根据本发明一个实施例的一种数据管理装置的结构示意图;
图11示出了根据本发明一个实施例的一种分布式存储系统的结构示意图;
图12示意性地示出了用于执行根据本发明的方法的计算设备的框图;以及
图13示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
参照图2,示出了根据本发明一个实施例的一种数据路由方法的步骤流程示意图,具体可以包括如下步骤:
步骤201、数据节点接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
步骤202、所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;
步骤203、所述数据节点将所述数据节点信息返回给所述客户端。
本发明实施例可以应用于各种业务的分布式存储系统中,用于提高元数据路由的准确率。
参照图3,示出了根据本发明一个示例的一种分布式存储系统的结构示意图,具体可以包括:客户端301和数据节点302;其中,客户端301作为业务请求的发起方,可以通过元数据路由请求从所述数据节点302获取所述元数据路由请求对应的数据节点信息,从而可以访问所述数据节点信息对应数据节点302以完成数据存取操作;数据节点302上可以存储有元数据表, 且数据节点302之间可以通信,从而可以基于数据节点302之间的通信维护所述元数据表,以保证所述元数据表能够及时反映节点状态的变化。
在本发明的一种可选实施例中,所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息的步骤,具体可以包括:
子步骤A1、计算所述第一关键字信息的哈希值;
子步骤A2、依据所述哈希值匹配所述元数据表,得到所述哈希值对应数据节点信息。
在具体实现中,可以采用单向散列算法等哈希算法计算所述第一关键字信息的哈希值,本发明实施例对具体的哈希算法不加以限制。
在实际应用中,所述数据节点信息具体可以包括如下信息中的一项或多项:节点编号信息、节点属性信息和节点通信速率信息。其中,节点属性信息具体可以包括:节点可用或节点不可用等信息,节点通信速率信息可以为节点的通信速率值等等。
在本发明的一种应用示例中,所述哈希值对应数据节点的节点编号信息可以为所述数据节点自身的编号,也可以为其它数据节点的编号,无论何种情况,所述数据节点均可以将所述哈希值对应数据节点的节点编号返回给客户端,以满足客户端进一步的节点访问请求。
综上,数据节点可以利用自身存储的元数据表来处理客户端的元数据路由请求;由于数据节点可以基于数据节点之间的通信进行元数据表的维护,使得维护的元数据表能够及时反映节点状态的变化,因此,能够保证向客户端反馈正确的数据节点信息,提高元数据路由的准确率;并且,相对于现有技术中采用专门的Master来存储并维护元数据表获取,本发明实施例减少了Master这一角色,因此能够降低分布式存储系统的运维部署成本。
参照图4,示出了根据本发明一个实施例的一种数据路由方法的步骤流程示意图,具体可以包括如下步骤:
步骤401、数据节点接收来自客户端的元数据路由请求;其中,所述元 数据路由请求中携带有数据的第一关键字信息;
步骤402、所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;
步骤403、所述数据节点将所述数据节点信息返回给所述客户端;
步骤404、当所述第一关键字信息对应的数据节点信息非所述数据节点自身时,所述数据节点将所述元数据表返回给所述客户端。
相对于图2所示实施例,本实施例在所述第一关键字信息对应的数据节点信息非所述数据节点自身时,所述数据节点还可以将所述元数据表返回给所述客户端,也即,可以向客户端提供当前最新的元数据表,方便客户端通过查询自身的元数据表来进行元数据的路由。
对于客户端而言,其可以通过如下两种方式进行元数据的路由:方式一为通过向数据节点发送元数据路由请求来进行元数据的路由,方式二为通过查询自身的元数据表来进行元数据的路由,其中方式一具有准确率高的优点,方式二具有节省流量的优点。可以理解,本领域技术人员可以根据实际需求确定采用上述两种方式中的任一或全部,例如,在对准确率要求比较严格时,可以采用上述方式一,又如,在对流量要求比较严格时,可以采用上述方式二,或者,为了保证路由的成功率,可以同时采用上述方式一和方式二等等。
参照图5,示出了根据本发明一个实施例的一种数据路由方法的步骤流程示意图,具体可以包括如下步骤:
步骤501、数据节点接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
步骤502、所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护 得到;
步骤503、所述数据节点将所述数据节点信息返回给所述客户端;
步骤504、所述数据节点基于数据节点之间的通信对所述元数据表进行维护。
参照图6,示出了根据本发明一个实施例的一种数据节点基于数据节点之间的通信对所述元数据表进行维护的步骤流程图,具体可以包括如下步骤:
子步骤541、协调者节点向所有执行事务T的参与者节点发送准备消息;
子步骤542、各参与者节点确定是否提交事务T,若是,则向所述协调者节点返回准备就绪消息,否则,向所述协调者节点返回异常中止消息;
子步骤543、当从所有参与者节点获得的消息均为准备就绪消息时,所述协调者节点向所有参与者节点发出正式提交消息;
子步骤544、在接收到正式提交消息后,各参与者节点正式完成事务T,释放在整个事务T期间内占用的,并向协调者节点发送完成消息;
子步骤545、所述协调者节点在收到所有参与者节点反馈的完成消息后,完成事务;
子步骤546、当所述协调者节点从所有参与者节点获得的消息中存在异常中止消息,或者,在超时之前无法获取所有参与者节点的响应消息时,所述协调者节点向所有参与者节点发出回滚消息;
这里,超时可以表示从发出正式提交消息到现在超出了预置周期。
子步骤547、各参与者节点在接收到所述回滚消息后,对事务T执行回滚操作,释放在整个T事务期间内占用的资源,并向所述协调者节点发送回滚完成消息;
子步骤548、协调者节点接收到所有参与者节点反馈的回滚完成消息后,取消事务T。
相对于图1所示实施例,本实施例的数据节点具体可以包括:协调者节点和参与者节点,并且,增加了所述数据节点基于数据节点之间的通信对所述元数据表进行维护;其中,上述子步骤541-子步骤548涉及的元数据维护 过程具体通过两阶段提交协议来保证所有参与者节点所维护元数据表的一致性和完整性。
两阶段提交协议的主要思想可以为:当一个事务T要对多个数据库进行操作,必须确保该多个参与者节点的数据库都提交成功,事务T才能成功,所以,协调节点可以先对多个参与者节点发出预提交,多个参与者节点返回是否可以提交,如果所有参与者节点都能提交,则协调节点可以正式提交事务T。
上述子步骤541-子步骤548涉及的元数据维护过程中,子步骤541-子步骤542为第一阶段的步骤,子步骤543-子步骤548为第二阶段的步骤。其中,在第一阶段,协调者节点将通知事务的参与者节点准备提交或取消事务,由参与者节点向协调者节点告知自己的决策:同意(准备就绪消息)或取消(异常中止消息);在第二阶段,协调者节点将基于所有参与者节点反馈的信息进行决策:提交或取消,当且仅当所有的参与者节点同意提交事务时,协调者节点才通知所有的参与者节点提交事务,否则协调者节点将通知所有的参与者节点取消事务。
需要说明的是,上述通过两阶段提交协议来保证所有参与者节点所维护元数据表的一致性和完整性的方案只是作为保证所有参与者节点所维护元数据表的一致性和完整性的可选方案,可以理解,本领域技术人员还可以根据实际需要,采用其它方案来保证所有参与者节点所维护元数据表的一致性和完整性,如三阶段提交协议等等,本发明实施例对保证所有参与者节点所维护元数据表的一致性和完整性的具体方案不加以限制。
参照图7,示出了根据本发明一个实施例的一种数据路由方法的步骤流程图,具体可以包括如下步骤:
步骤701、数据节点接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
步骤702、所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有 关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;
步骤703、所述数据节点将所述数据节点信息返回给所述客户端;
步骤704、所述数据节点接收来自客户端的读请求;其中,所述读请求中携带有数据的第二关键字信息;
步骤705、所述数据节点依据所述读请求携带的第二关键字信息匹配自身的元数据表,得到所述第二关键字信息对应的数据节点信息;
步骤706、所述数据节点依据所述第二关键字信息对应的数据节点信息,判定所述读请求对应数据是否在所述数据节点自身;
步骤707、当所述第二关键字信息对应的数据节点信息为所述数据节点自身时,所述数据节点依据所述读请求查询自身的数据引擎,并将查询得到的数据返回给所述客户端;
步骤708、当所述第二关键字信息对应的数据节点信息非所述数据节点自身时,将所述读请求转发给第二关键字信息对应的数据节点信息所对应的第一数据节点;
步骤709、接收所述第一数据节点返回的所述读请求对应的数据,并返回给所述客户端。
相对于图1所示实施例,本实施例除了可以通过执行步骤701-步骤703来处理来自客户端的元数据路由请求外,还可以通过步骤704-步骤709处理来自客户端的读请求,特别地,在处理所述读请求的过程中,当所述读请求中所携带第二关键字信息对应的数据节点信息非所述数据节点自身时,所述数据节点还可以担当网络代理的角色,也即,将所述读请求转发给第二关键字信息对应的数据节点信息所对应的第一数据节点,所述第一数据节点返回的所述读请求对应的数据,并返回给所述客户端;所述代理客户端转发读请求并向客户端返回读出数据的过程,能够避免客户端尝试向多个不同的数据节点发送读请求,从而节省了客户端的流量。
需要说明的是,数据节点除了可以代理客户端转发读请求并向客户端返回读出数据外,还可以代理客户端转发写请求并向客户端返回响应结果,由 于代理客户端转发写请求的过程与代理客户端转发读请求的过程类似,故在此不作赘述,相互参照即可。
对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作并不一定是本发明实施例所必须的。
参照图8,示出了根据本发明一个实施例的一种数据管理装置的结构示意图,具体可以包括如下模块:
第一接收模块801,配置为接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
第一匹配模块802,配置为依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;以及
第一返回模块803,配置为将所述数据节点信息返回给所述客户端。
在实际应用中,上述数据管理装置可以为数据节点本身,也可以为管理各数据节点的装置,本发明实施例对上述数据管理装置的具体位置不加以限制。
在本发明的一种可选实施例中,所述第一匹配模块802,具体可以包括:
哈希计算子模块,配置为计算所述第一关键字信息的哈希值;及
哈希匹配子模块,配置为依据所述哈希值匹配所述元数据表,得到所述哈希值对应数据节点信息。
在本发明的另一种可选实施例中,所述数据节点还可以包括:
第二返回模块,配置为当所述第一关键字信息对应的数据节点信息非所述数据节点自身时,所述数据节点将所述元数据表返回给所述客户端。
参照图9,示出了根据本发明一个实施例的一种数据管理装置的结构示意图,具体可以包括:协调者节点901和参与者节点902;
其中,所述协调者节点901具体可以包括:配置为基于数据节点之间的通信对所述元数据表进行维护的第一维护模块911;
所述参与者节点902具体可以包括如下模块:
第一接收模块921,配置为接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
第一匹配模块922,配置为依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;
第一返回模块923,配置为将所述数据节点信息返回给所述客户端;及
第二维护模块924,配置为基于数据节点之间的通信对所述元数据表进行维护的;
其中,所述第一维护模块911,具体可以包括:
准备发送子模块9111,配置为向所有执行事务T的参与者节点发送准备消息;
正式提交发送子模块9112,配置为当从所有参与者节点获得的消息均为准备就绪消息时,向所有参与者节点发出正式提交消息;
事务完成子模块9113,配置为在收到所有参与者节点反馈的完成消息后,完成事务;
回滚发送子模块9114,配置为当从所有参与者节点获得的消息中存在异常中止消息,或者,在超时之前无法获取所有参与者节点的响应消息时,所述协调者节点向所有参与者节点发出回滚消息;及
事务取消子模块9115,配置为在接收到所有参与者节点反馈的回滚完成消息后,取消事务T;
其中,所述第二维护模块924,具体可以包括:
准备响应子模块9241,配置为确定是否提交事务T,若是,则向所述协 调者节点返回准备就绪消息,否则,向所述协调者节点返回异常中止消息;
事务执行子模块9242,配置为在接收到正式提交消息后,正式完成事务T,释放在整个事务T期间内占用的,并向协调者节点发送完成消息;及
回滚子模块9243,配置为各参与者节点在接收到所述回滚消息后,对事务T执行回滚操作,释放在整个T事务期间内占用的资源,并向所述协调者节点发送回滚完成消息。
参照图10,示出了根据本发明一个实施例的一种数据管理装置的结构示意图,具体可以包括如下模块:
第一接收模块1001,配置为接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
第一匹配模块1002,配置为依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;
第一返回模块1003,配置为将所述数据节点信息返回给所述客户端;
第二接收模块1004,配置为接收来自客户端的读请求;其中,所述读请求中携带有数据的第二关键字信息;
第二匹配模块1005,配置为依据所述读请求携带的第二关键字信息匹配自身的元数据表,得到所述第二关键字信息对应的数据节点信息;
判定模块1006,配置为依据所述第二关键字信息对应的数据节点信息,判定所述读请求对应数据是否在所述数据节点自身;
查询模块1007,配置为当所述第二关键字信息对应的数据节点信息为所述数据节点自身时,所述数据节点依据所述读请求查询自身的数据引擎,并将查询得到的数据返回给所述客户端;
转发模块1008,配置为当所述第二关键字信息对应的数据节点信息非所述数据节点自身时,将所述读请求转发给第二关键字信息对应的数据节点信息所对应的第一数据节点;以及
第三返回模块1009,配置为接收所述第一数据节点返回的所述读请求对应的数据,并返回给所述客户端。
本发明还提供了一种分布式存储系统,其具体可以包括:客户端和前述的数据管理装置。
参照图11,示出了根据本发明一个实施例的一种分布式存储系统的结构示意图,具体可以包括:客户端1101和多个数据节点1102;
其中,所述数据节点1102具体可以包括如下模块:
第一接收模块1121,配置为接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
第一匹配模块1122,配置为依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;以及
第一返回模块1123,配置为将所述数据节点信息返回给所述客户端。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的数据路由方法、数据管理装置和分布式存储系统中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网平台上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图12示出了可以实现根据本发明上述方法的计算设备,例如搜 索引擎服务器。该计算设备传统上包括处理器1210和以存储器1230形式的计算机程序产品或者计算机可读介质。存储器1230可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1230具有存储用于执行上述方法中的任何方法步骤的程序代码1251的存储空间1250。例如,存储程序代码的存储空间1250可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1251。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为例如图13所示的便携式或者固定存储单元。该存储单元可以具有与图12的计算设备中的存储器1230类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括用于执行根据本发明的方法步骤的计算机可读代码1251’,即可以由诸如1210之类的处理器读取的代码,当这些代码由服务器运行时,导致该服务器执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。 在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。

Claims (15)

  1. 一种数据路由方法,包括:
    数据节点接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
    所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;以及
    所述数据节点将所述数据节点信息返回给所述客户端。
  2. 如权利要求1所述的方法,其中,所述方法还包括:
    当所述第一关键字信息对应的数据节点信息非所述数据节点自身时,所述数据节点将所述元数据表返回给所述客户端。
  3. 如权利要求1或2所述的方法,其中,所述数据节点包括:协调者节点和参与者节点;
    则所述方法还包括:所述数据节点基于数据节点之间的通信对所述元数据表进行维护;
    其中,所述数据节点基于数据节点之间的通信对所述元数据表进行维护的步骤,包括:
    所述协调者节点向所有执行事务T的参与者节点发送准备消息;
    各参与者节点确定是否提交事务T,若是,则向所述协调者节点返回准备就绪消息,否则,向所述协调者节点返回异常中止消息;
    当从所有参与者节点获得的消息均为准备就绪消息时,所述协调者节点向所有参与者节点发出正式提交消息;
    在接收到正式提交消息后,各参与者节点正式完成事务T,释放在整个事务T期间内占用的,并向协调者节点发送完成消息;
    所述协调者节点在收到所有参与者节点反馈的完成消息后,完成事务;
    当从所有参与者节点获得的消息中存在异常中止消息,或者,在超时之前无法获取所有参与者节点的响应消息时,所述协调者节点向所有参与者节点发出回滚消息;
    各参与者节点在接收到所述回滚消息后,对事务T执行回滚操作,释放在整个T事务期间内占用的资源,并向所述协调者节点发送回滚完成消息;
    协调者节点接收到所有参与者节点反馈的回滚完成消息后,取消事务T。
  4. 如权利要求1或2或3所述的方法,其中,所述方法还包括:
    所述数据节点接收来自客户端的读请求;其中,所述读请求中携带有数据的第二关键字信息;
    所述数据节点依据所述读请求携带的第二关键字信息匹配自身的元数据表,得到所述第二关键字信息对应的数据节点信息;
    所述数据节点依据所述第二关键字信息对应的数据节点信息,判定所述读请求对应数据是否在所述数据节点自身;
    当所述第二关键字信息对应的数据节点信息为所述数据节点自身时,所述数据节点依据所述读请求查询自身的数据引擎,并将查询得到的数据返回给所述客户端;
    当所述第二关键字信息对应的数据节点信息非所述数据节点自身时,将所述读请求转发给第二关键字信息对应的数据节点信息所对应的第一数据节点;
    接收所述第一数据节点返回的所述读请求对应的数据,并返回给所述客户端。
  5. 如权利要求1或2或3所述的方法,其中,所述数据节点依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息的步骤,包括:
    计算所述第一关键字信息的哈希值;
    依据所述哈希值匹配所述元数据表,得到与所述哈希值对应的数据节点的数据节点信息。
  6. 如权利要求1或2或3所述的方法,其中,所述数据节点信息包括如下信息中的一项或多项:节点编号信息、节点属性信息和节点通信速率信息。
  7. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在 计算设备上运行时,导致所述计算设备执行根据权利要求1至6中的任一项所述的数据路由方法。
  8. 一种计算机可读介质,其中存储了如权利要求7所述的计算机程序。
  9. 一种数据管理装置,包括:
    第一接收模块,配置为接收来自客户端的元数据路由请求;其中,所述元数据路由请求中携带有数据的第一关键字信息;
    第一匹配模块,配置为依据所述第一关键字信息匹配自身的元数据表,得到所述第一关键字信息对应的数据节点信息;其中,所述元数据表存储有关键字对应的数据节点信息,所述元数据表为基于数据节点之间的通信维护得到;以及
    第一返回模块,配置为将所述数据节点信息返回给所述客户端。
  10. 如权利要求9所述的数据管理装置,其中,所述数据管理装置还包括:
    第二返回模块,配置为当所述第一关键字信息对应的数据节点信息非所述数据节点自身时,所述数据节点将所述元数据表返回给所述客户端。
  11. 如权利要求9或10所述的数据管理装置,其中,所述数据管理装置包括:协调者节点和参与者节点;
    则所述协调者节点包括:配置为基于数据节点之间的通信对所述元数据表进行维护的第一维护模块;
    所述参与者节点包括:前述第一接收模块、第一匹配模块、第一返回模块、以及配置为基于数据节点之间的通信对所述元数据表进行维护的第二维护模块;
    其中,所述第一维护模块,包括:
    准备发送子模块,配置为向所有执行事务T的参与者节点发送准备消息;
    正式提交发送子模块,配置为当从所有参与者节点获得的消息均为准备就绪消息时,向所有参与者节点发出正式提交消息;
    事务完成子模块,配置为在收到所有参与者节点反馈的完成消息后,完成事务;
    回滚发送子模块,配置为当从所有参与者节点获得的消息中存在异常中止消息,或者,在超时之前无法获取所有参与者节点的响应消息时,所述协调者节点向所有参与者节点发出回滚消息;及
    事务取消子模块,配置为在接收到所有参与者节点反馈的回滚完成消息后,取消事务T;
    其中,所述第二维护模块,包括:
    准备响应子模块,配置为确定是否提交事务T,若是,则向所述协调者节点返回准备就绪消息,否则,向所述协调者节点返回异常中止消息;
    事务执行子模块,配置为在接收到正式提交消息后,正式完成事务T,释放在整个事务T期间内占用的,并向协调者节点发送完成消息;及
    回滚子模块,配置为各参与者节点在接收到所述回滚消息后,对事务T执行回滚操作,释放在整个T事务期间内占用的资源,并向所述协调者节点发送回滚完成消息。
  12. 如权利要求9或10或11所述的数据管理装置,其中,所述数据管理装置还包括:
    第二接收模块,配置为接收来自客户端的读请求;其中,所述读请求中携带有数据的第二关键字信息;
    第二匹配模块,配置为依据所述读请求携带的第二关键字信息匹配自身的元数据表,得到所述第二关键字信息对应的数据节点信息;
    判定模块,配置为依据所述第二关键字信息对应的数据节点信息,判定所述读请求对应数据是否在所述数据节点自身;
    查询模块,配置为当所述第二关键字信息对应的数据节点信息为所述数据节点自身时,所述数据节点依据所述读请求查询自身的数据引擎,并将查询得到的数据返回给所述客户端;
    转发模块,配置为当所述第二关键字信息对应的数据节点信息非所述数据节点自身时,将所述读请求转发给第二关键字信息对应的数据节点信息所 对应的第一数据节点;
    第三返回模块,配置为接收所述第一数据节点返回的所述读请求对应的数据,并返回给所述客户端。
  13. 如权利要求9或10或11所述的数据管理装置,其中,所述第一匹配模块,包括:
    哈希计算子模块,配置为计算所述第一关键字信息的哈希值;及
    哈希匹配子模块,配置为依据所述哈希值匹配所述元数据表,得到与所述哈希值对应的数据节点的数据节点信息。
  14. 如权利要求9或10或11所述的数据管理装置,其中,所述数据节点信息包括如下信息中的一项或多项:节点编号信息、节点属性信息和节点通信速率信息。
  15. 一种分布式存储系统,包括:客户端和前述权利要求9至14中任一所述的数据管理装置。
PCT/CN2015/095507 2014-12-27 2015-11-25 一种数据路由方法、数据管理装置和分布式存储系统 Ceased WO2016101759A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410832192.2 2014-12-27
CN201410832192.2A CN104580428B (zh) 2014-12-27 2014-12-27 一种数据路由方法、数据管理装置和分布式存储系统

Publications (1)

Publication Number Publication Date
WO2016101759A1 true WO2016101759A1 (zh) 2016-06-30

Family

ID=53095585

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/095507 Ceased WO2016101759A1 (zh) 2014-12-27 2015-11-25 一种数据路由方法、数据管理装置和分布式存储系统

Country Status (2)

Country Link
CN (1) CN104580428B (zh)
WO (1) WO2016101759A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119388A (zh) * 2019-05-14 2019-08-13 深信服科技股份有限公司 文件读写方法、装置、系统、设备及计算机可读存储介质
CN112702270A (zh) * 2020-12-18 2021-04-23 深圳赛安特技术服务有限公司 基于事件分发机制的节点调用方法、系统及存储介质
CN113535851A (zh) * 2019-03-28 2021-10-22 北京忆芯科技有限公司 分布式kv存储系统的更新与查询

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109691065B (zh) * 2018-08-23 2021-11-09 袁振南 分布式存储系统及其数据读写方法、存储终端及存储介质
CN109783204A (zh) * 2018-12-28 2019-05-21 咪咕文化科技有限公司 一种分布式事务处理方法、装置及存储介质
CN116366664A (zh) * 2021-12-28 2023-06-30 中国电信股份有限公司 网元数据处理方法及装置、存储介质及电子设备
CN115904253B (zh) * 2023-01-09 2023-06-13 苏州浪潮智能科技有限公司 一种数据传输方法、装置、一种存储系统及设备和介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984280A (zh) * 2012-12-18 2013-03-20 北京工业大学 针对社交类云存储网络应用的数据备份系统和方法
CN103019960A (zh) * 2012-12-03 2013-04-03 华为技术有限公司 分布式缓存方法及系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080209007A1 (en) * 2007-02-27 2008-08-28 Tekelec Methods, systems, and computer program products for accessing data associated with a plurality of similarly structured distributed databases
CN100576809C (zh) * 2007-08-21 2009-12-30 北京航空航天大学 大规模动态异构混合无线自组织网络中的接入及路由计算方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019960A (zh) * 2012-12-03 2013-04-03 华为技术有限公司 分布式缓存方法及系统
CN102984280A (zh) * 2012-12-18 2013-03-20 北京工业大学 针对社交类云存储网络应用的数据备份系统和方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535851A (zh) * 2019-03-28 2021-10-22 北京忆芯科技有限公司 分布式kv存储系统的更新与查询
CN110119388A (zh) * 2019-05-14 2019-08-13 深信服科技股份有限公司 文件读写方法、装置、系统、设备及计算机可读存储介质
CN110119388B (zh) * 2019-05-14 2023-07-11 深信服科技股份有限公司 文件读写方法、装置、系统、设备及计算机可读存储介质
CN112702270A (zh) * 2020-12-18 2021-04-23 深圳赛安特技术服务有限公司 基于事件分发机制的节点调用方法、系统及存储介质

Also Published As

Publication number Publication date
CN104580428A (zh) 2015-04-29
CN104580428B (zh) 2018-09-04

Similar Documents

Publication Publication Date Title
US10733176B2 (en) Detecting phantom items in distributed replicated database
EP3188051B1 (en) Systems and methods for search template generation
CN104376127B (zh) 一种数据操作方法及装置
CN110543448A (zh) 数据同步方法、装置、设备及计算机可读存储介质
WO2020134615A1 (zh) 跨链存证方法及访问方法、装置、电子设备
CN104580428B (zh) 一种数据路由方法、数据管理装置和分布式存储系统
CN111460474B (zh) 去中心化的预言机实现方法、装置、存储器和计算机
US20230185559A1 (en) Managing a federated software repository across multiple devices
TW201229795A (en) Web service patterns for globally distributed service fabric
JP6700308B2 (ja) データ・コピー方法及びデバイス
CN106982236A (zh) 一种信息处理方法、装置和系统
KR20160147909A (ko) 트랜잭셔널 환경에서 리소스 관리자(rm) 인스턴스 인지에 기초하여 공통 트랜잭션 식별자(xid) 최적화 및 트랜잭션 친화성을 지원하기 위한 시스템 및 방법
CN108833610B (zh) 一种信息更新方法、装置及系统
WO2018233630A1 (zh) 故障发现
US9110820B1 (en) Hybrid data storage system in an HPC exascale environment
CN107633016A (zh) 数据处理方法及装置和电子设备
US11093477B1 (en) Multiple source database system consolidation
CN105550306A (zh) 多副本数据的读写方法及系统
CN105205182A (zh) 多机房部署系统及跨机房的业务数据处理方法
CN103514298A (zh) 一种实现文件锁的方法及元数据服务器
CN104636437A (zh) 一种事件通知方法、监听器的处理方法及装置
WO2017092384A1 (zh) 一种集群数据库分布式存储的方法和装置
CN107295030A (zh) 一种数据写入方法、装置、数据处理方法、装置及系统
US20110016349A1 (en) Replication in a network environment
CN110837499A (zh) 数据访问处理方法、装置、电子设备和存储介质

Legal Events

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

Ref document number: 15871828

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15871828

Country of ref document: EP

Kind code of ref document: A1