WO2015192661A1 - 一种分布式存储系统中的数据同步方法、装置及系统 - Google Patents

一种分布式存储系统中的数据同步方法、装置及系统 Download PDF

Info

Publication number
WO2015192661A1
WO2015192661A1 PCT/CN2015/071859 CN2015071859W WO2015192661A1 WO 2015192661 A1 WO2015192661 A1 WO 2015192661A1 CN 2015071859 W CN2015071859 W CN 2015071859W WO 2015192661 A1 WO2015192661 A1 WO 2015192661A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
synchronization
storage service
service cluster
log
Prior art date
Application number
PCT/CN2015/071859
Other languages
English (en)
French (fr)
Inventor
郭斌
韩银俊
高洪
陈典强
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2015192661A1 publication Critical patent/WO2015192661A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to the field of cloud computing technologies, and in particular, to a data synchronization method, apparatus, and system in a distributed storage system.
  • Cloud Computing is Grid Computing, Distributed Computing, Parallel Computing, Utility Computing Network Storage Technologies, Virtualization, The integration of traditional computer technology and network technology such as load balancing (Load Balance). It aims to integrate multiple relatively low-cost computing entities into a system with powerful computing power through the network.
  • Distributed storage is an area in the field of cloud computing. Its role is to provide distributed storage services for massive data and high-speed read and write access.
  • a distributed storage system is composed of a plurality of server nodes and clients interconnected; a server node is responsible for storing data, and the client can perform operations such as writing, reading, updating, and deleting data to the server.
  • remote disaster recovery is a key problem that is difficult to solve, especially for remote disaster recovery that requires two-way data synchronization.
  • Remote disaster recovery refers to the distributed deployment of server nodes in two distant locations. At least one of the distributed storage clusters provides data read and write services. When a large-scale failure or disaster occurs in a certain place, the service can be switched to another location as soon as possible to continue to provide services.
  • the so-called two-way data synchronization means that when data reading and writing services are simultaneously provided in the two places, it is necessary to synchronize the changed data from the local cluster to the other party's cluster.
  • the remote disaster recovery has only one-way data synchronization mechanism. That is, the distributed storage service clusters of the two places, one of which provides read and write services for data, and the other provides only data read services.
  • the shortcomings of this technology are: First, it is impossible to make full use of all computing resources, and it is not possible to implement remote disaster recovery on the basis of limited computing resources. Secondly, if a business application that provides only a read service needs to write data, Requires real-time access to off-site distributed storage services Clustering, the latency will be high.
  • Embodiments of the present invention provide a data synchronization method, apparatus, and system in a distributed storage system to solve at least the above problems.
  • a data synchronization method in a distributed storage system including: receiving, by a first storage service cluster, a first data change request from a first client;
  • the first storage service cluster changes corresponding data in the first storage service cluster according to the first data change request; the first storage service cluster synchronizes the changed data as the first synchronization data to the second storage service.
  • the first storage service cluster receives the second synchronization data sent by the second storage service cluster; the first storage service cluster performs data synchronization according to the second synchronization data.
  • the method further includes: the first storage service cluster generates a first synchronization log corresponding to the change data according to changing corresponding data in the first storage service cluster;
  • the first storage service cluster synchronizes the first synchronization data corresponding to the change data to the second storage service cluster, and the first storage service cluster synchronizes the first synchronization data corresponding to the first synchronization log to the second Storage service cluster.
  • the first storage service cluster synchronizes the first synchronization data corresponding to the first synchronization log to the second storage service cluster, including: reading the first synchronization log, and reading according to the first synchronization log Corresponding data stored by the first storage service cluster, and synchronizing the read data to the second storage service cluster.
  • the reading the first synchronization log further includes: periodically checking whether a new first synchronization log is generated.
  • the first synchronization log includes metadata of the change data.
  • the method further includes: after the first storage service cluster changes the corresponding data in the first storage service cluster, notifying the first client of the change result.
  • a data synchronization device in a distributed storage system which is located in a first storage service cluster, and includes: a first receiving module configured to receive first data from the first client a change request; the first data management module is configured to change the corresponding data in the first storage service cluster according to the first data change request; and the synchronization module is configured to synchronize the changed data as the first synchronization data to the second a storage service cluster; a second receiving module, configured to receive second synchronization data sent by the second storage service cluster; and a second data management module configured to perform data synchronization according to the second synchronization data.
  • the first data management module is further configured to: change the data and simultaneously generate a first synchronization log corresponding to the change data; the synchronization module is further configured to: correspond to the first synchronization log The first synchronization data is synchronized to the second storage service cluster.
  • the synchronization module includes: a reading unit configured to read the first synchronization log, and read data corresponding to the first storage service cluster according to the first synchronization log; And being configured to synchronize the read data corresponding to the first storage service cluster to the second storage service cluster.
  • the reading unit further comprises: a timing component, configured to periodically check whether there is a new first synchronization log generation.
  • the first synchronization log includes metadata of the change data.
  • the first data management module includes: a feedback unit, configured to notify the first client of the change result.
  • a data synchronization system in a distributed storage system including: at least two storage service clusters and corresponding clients; and the client is configured to correspond to a corresponding storage service cluster.
  • the storage service cluster and the another storage service cluster respectively correspond to customers
  • the terminal is also arranged to read different parts of the same data and integrate according to a predetermined logic.
  • the embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
  • the embodiment of the invention enables data to be synchronized in two directions between different distributed storage service clusters, fully utilizes all computing resources, and implements remote disaster recovery on the basis of limited computing resources. Secondly, the business application is prevented from performing data writing operations in real time.
  • the problem of accessing distributed storage service clusters in different places overcomes the problems of high latency and limited bandwidth of remote access networks.
  • FIG. 1 is a flow chart of a data synchronization method according to an embodiment of the present invention.
  • FIG. 2 is a second flowchart of a data synchronization method according to an embodiment of the present invention.
  • FIG. 3 is a block diagram showing the structure of a data synchronization apparatus according to an embodiment of the present invention.
  • FIG. 4 is a structural block diagram of a data synchronization device synchronization module according to an embodiment of the present invention.
  • FIG. 5 is a structural block diagram of a data synchronization system according to an embodiment of the present invention.
  • Embodiments of the present invention provide a data synchronization method in a distributed storage system
  • FIG. 1 is a root
  • the first client sends a first data change request to the first storage service cluster.
  • the first storage service cluster receives the first data change request and changes data corresponding to the request.
  • the first storage service cluster synchronizes the first synchronization data corresponding to the change data to the second storage service cluster.
  • the second storage service cluster performs data synchronization according to the first synchronization data.
  • the second storage service cluster generates second synchronization data according to the same steps of S101-S103, and synchronizes to the first storage service cluster.
  • the first storage service cluster performs data synchronization according to the second synchronization data.
  • the first storage service cluster receives the first data change request from the first client; the first storage service cluster changes the corresponding data in the first storage service cluster according to the first data change request; The first storage service cluster synchronizes the changed data as the first synchronization data to the second storage service cluster; the first storage service cluster receives the second synchronization data sent by the second storage service cluster; A storage service cluster performs data synchronization based on the second synchronization data.
  • the two-way distributed storage service cluster can realize two-way data synchronization, make full use of all computing resources, and realize remote disaster recovery on the basis of limited computing resources. Secondly, it avoids the need for real-time access to data distribution by the business application.
  • the problem of storage service clusters overcomes the problems of high latency and limited bandwidth in remote access networks.
  • the first storage service cluster generates a first synchronization log corresponding to the change data while changing corresponding data in the first storage service cluster according to the first data change request.
  • the first storage service cluster synchronizes the first synchronization data corresponding to the change data to the second storage service cluster, including: reading the first synchronization log, and reading the corresponding first according to the first synchronization log Storing data stored by the service cluster and synchronizing the read data to the second storage service cluster.
  • FIG. 2 is a flowchart of a data synchronization method according to an embodiment of the present invention. As shown in FIG. 2, the method includes the following steps (S201-S210):
  • the first client sends a first data change request to the first storage service cluster.
  • the first storage service cluster receives the first data change request and changes the data of the request corresponding 10;
  • the first storage service cluster generates a first synchronization log corresponding to the change data.
  • the first storage service cluster returns the data change result to the first client.
  • the first storage service cluster reads the first synchronization log.
  • the first storage service cluster reads data stored by the corresponding first storage service cluster according to the first synchronization log.
  • the first storage service cluster sends the read data as the first synchronization data to the second storage service cluster.
  • the second storage service cluster performs data synchronization according to the first synchronization data.
  • the second storage service cluster generates second synchronization data according to the same steps of S201-S206, and sends the second synchronization data to the first storage service cluster;
  • the first storage service cluster performs data synchronization according to the second synchronization data.
  • the reading the first synchronization log further includes: periodically checking whether there is a new first synchronization log generation.
  • the first storage service cluster periodically checks whether there is a new first synchronization log generation, and synchronizing the corresponding data to the second storage service cluster according to the first synchronization log includes the following steps:
  • the data stored in the corresponding first storage service cluster is read according to the data information recorded in the first synchronization log.
  • the first synchronization log includes metadata of the change data, and does not need to include complete change data.
  • the beneficial effects of this embodiment are: (1) the number of elements According to the relatively small size, only the summary information and attributes of the change data are included to save storage space.
  • the distributed service cluster is composed of multiple storage servers. The storage server may be down and running for a long time. In the case of the network, etc., this may cause multiple modification operations on the same data, and multiple storage server nodes are respectively synchronized to different places, and the order of synchronization is not necessarily consistent with the order of the initial writing. Therefore, in the first synchronization log, only the metadata is saved instead of the complete data. Before the synchronization, the first storage service cluster retrieves the latest complete data according to the metadata for data synchronization, thereby avoiding synchronizing outdated data to the remote location.
  • the first storage service cluster changes the corresponding data in the first storage service cluster according to the first data change request, and further includes: notifying the first client of the change result. That is, after the data of the first storage service cluster is successfully changed, the information of “data change success” is returned to the first client; after the data change of the first storage service cluster fails, the data change failure is also returned to the first client. "and remind "re-operation" information.
  • FIG. 2 is a structural block diagram of a data synchronization device according to an embodiment of the present invention.
  • the device includes: a first receiving module 301.
  • the first receiving module 301 is configured to receive a first data change request from the first client.
  • the first data management module 302 is configured to change the corresponding data in the first storage service cluster according to the first data change request.
  • the synchronization module 303 is configured to synchronize the change data as the first synchronization data to the second storage service cluster; the second receiving module 304 is configured to receive the second synchronization data sent by the second storage service cluster; the second data management Module 305 is configured to perform data synchronization based on the second synchronization data.
  • the first receiving module 301 receives the first data change request sent by the first client, and the first data management module 302 then performs the corresponding data in the first storage service cluster according to the first data change request.
  • the change, the synchronization module 303 is responsible for synchronizing the change data as the first synchronization data to the second storage service cluster; in addition, the second receiving module 304 can receive the second synchronization data sent by the second storage service cluster, and then the second data management module
  • the data in the first storage cluster is synchronized according to the second synchronization data described above.
  • the two-way distributed storage service cluster can realize two-way data synchronization, make full use of all computing resources, and implement remote disaster recovery on the basis of limited computing resources. Secondly, it avoids the need for business applications to write data.
  • the problem of real-time access to remote distributed storage service clusters overcomes the problems of high latency and limited bandwidth in remote access networks.
  • the first data management module is further configured to simultaneously generate a first synchronization log corresponding to the change data; the synchronization module is further configured to correspond to the first synchronization log
  • the first synchronization data is synchronized to the second storage service cluster.
  • the synchronization module includes: a reading unit 3031 and a synchronization unit 3032.
  • the reading unit 3031 reads the data information of the first synchronization log, and reads the data corresponding to the first storage service cluster according to the data information recorded by the first synchronization log; the synchronization unit 3032, the reading unit
  • the data stored in the read first storage service cluster is synchronized to the second storage service cluster.
  • the reading unit 3031 further includes a timing checking component 30311 that periodically checks whether there is a new first synchronization log generation.
  • the timing check component 30311 may preset an interval period, such as 1 second, 5 seconds, 10 seconds, 15 seconds, etc.; after a preset interval period elapses, it starts to check whether a new first synchronization log is generated, if If not, the reading unit 3031 does not perform the reading of the first synchronization log operation, and if so, the reading unit 3031 performs the operation of reading the first synchronization log.
  • the first data management module 302 further includes: a feedback unit, notifying the first client of the data change result of the first data management module 302. That is, after the first data management module 302 successfully changes the data, the information of the “number 20 data change success” is returned to the first client; after the first data management module 302 fails to change the data, the first data management module 302 also returns to the first client. "Data change failed" and reminded "re-operation" information.
  • the embodiment of the present invention further provides a data synchronization system in a distributed storage system.
  • the method includes: at least two storage service clusters and corresponding clients; and the client is configured to correspond to the storage.
  • the service cluster sends a data change request;
  • the storage service cluster is configured to receive a data change request sent by the client, change corresponding data, and synchronize the corresponding data to another storage service cluster;
  • the storage service cluster It is further configured to receive the synchronization data sent by the another storage service cluster and perform corresponding data synchronization.
  • the embodiments of the present invention enable data synchronization between the distributed storage service clusters in different places, fully utilize all computing resources, and implement remote disaster recovery on the basis of limited computing resources. Secondly, the service application is prevented from writing data. The operation requires real-time access to the distributed storage service cluster in different places, and overcomes the problem of high delay and limited bandwidth of the remote access network.
  • the storage service cluster and the another storage service cluster change are respectively directed to different parts of the same data
  • the storage service cluster and the another storage service The corresponding clients of the cluster also read different parts of the same data and integrate according to preset logic.
  • the data synchronization system of the embodiment of the present invention can ensure normal operation in the case that the data changed by the storage service cluster and the another storage service cluster are respectively directed to different parts of the same data.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the embodiment of the invention enables data to be synchronized in two directions between different distributed storage service clusters, fully utilizes all computing resources, and implements remote disaster recovery on the basis of limited computing resources. Secondly, the business application is prevented from performing data writing operations in real time.
  • the problem of accessing distributed storage service clusters in different places overcomes the problems of high latency and limited bandwidth of remote access networks.

Landscapes

  • Engineering & Computer Science (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)
  • Hardware Redundancy (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种分布式存储系统中的数据同步方法、装置及系统,该方法包括:第一存储服务集群接收第一客户端发送的第一数据变更请求;所述第一存储服务集群根据所述第一数据变更请求,变更所述第一存储服务集群中的对应数据;所述第一存储服务集群将变更后的数据作为第一同步数据同步至第二存储服务集群;所述第一存储服务集群接收所述第二存储服务集群发送的第二同步数据;所述第一存储服务集群根据所述第二同步数据进行数据同步。

Description

一种分布式存储系统中的数据同步方法、装置及系统 技术领域
本发明涉及云计算技术领域,尤其涉及一种分布式存储系统中的数据同步方法、装置及系统。
背景技术
云计算(Cloud Computing)是网格计算(Grid Computing)、分布式计算(Distributed Computing)、并行计算(Parallel Computing)、效用计算(Utility Computing)网络存储(Network Storage Technologies)、虚拟化(Virtualization)、负载均衡(Load Balance)等传统计算机技术和网络技术发展融合的产物。它旨在通过网络把多个成本相对较低的计算实体整合成一个具有强大计算能力的系统。分布式存储是云计算范畴中的一个领域,其作用是提供海量数据的分布式存储服务以及高速读写访问的能力。分布式存储系统是由若干服务器节点和客户端互相连接构成的;服务器节点负责数据的存储,客户端可以对服务器做数据的写入、读取、更新、删除等操作。
在分布式存储系统中,异地容灾是比较难以解决的关键问题,尤其是需要双向数据同步的异地容灾。异地容灾是指,将服务器节点分布式的部署于相隔较远的两地,至少有其中一地的分布式存储集群对外提供数据的读写服务。当某一地出现大范围故障或灾害时,可尽快将业务切换至另一地继续提供服务。所谓双向数据同步,是指当两地同时提供数据读写服务时,需要将发生变更的数据从本地集群同步到对方的集群。
相关技术中,异地容灾只有单向数据同步的机制。即两地的分布式存储服务集群,其中一地提供数据的读写服务,另外一地仅提供数据的读服务。这种技术的缺点在于:首先,无法充分利用所有的计算资源,不能在有限的计算资源基础上实现异地容灾;其次,如果只提供读服务的一地的业务应用需要对数据进行写操作,需要实时的访问异地的分布式存储服务 集群,延迟会很高。
发明内容
本发明实施例提供了一种分布式存储系统中的数据同步方法、装置及系统,以至少解决上述问题。
根据本发明的一个实施例,提供了一种分布式存储系统中的数据同步方法,包括:第一存储服务集群接收来自第一客户端的第一数据变更请求;
所述第一存储服务集群根据所述第一数据变更请求,变更第一存储服务集群中的对应数据;所述第一存储服务集群将变更后的数据作为第一同步数据同步至第二存储服务集群;所述第一存储服务集群接收所述第二存储服务集群发送的第二同步数据;所述第一存储服务集群根据所述第二同步数据进行数据同步。
可选地,该方法还包括:所述第一存储服务集群根据变更第一存储服务集群中的对应数据的同时生成与所述变更数据对应的第一同步日志;
所述第一存储服务集群将变更数据对应的第一同步数据同步至第二存储服务集群,包括:所述第一存储服务集群将所述第一同步日志对应的第一同步数据同步至第二存储服务集群。
可选地,所述第一存储服务集群将第一同步日志对应的第一同步数据同步至第二存储服务集群,包括:读取所述第一同步日志,根据所述第一同步日志读取对应的所述第一存储服务集群存储的数据,并将所述读取数据同步至所述第二存储服务集群。
可选地,所述读取第一同步日志,还包括:定时检查是否有新的第一同步日志生成。
可选地,所述第一同步日志包含所述变更数据的元数据。
可选地,上述方法还包括:第一存储服务集群变更第一存储服务集群中的对应数据之后,将变更结果通知所述第一客户端。
根据本发明的另一个实施例,还提供了一种分布式存储系统中的数据同步装置,位于第一存储服务集群中,包括:第一接收模块,设置为接收来自第一客户端的第一数据变更请求;第一数据管理模块,设置为根据所述第一数据变更请求,变更第一存储服务集群中对应的数据;同步模块,设置为将变更后的数据作为第一同步数据同步至第二存储服务集群;第二接收模块,设置为接收所述第二存储服务集群发送的第二同步数据;第二数据管理模块,设置为根据所述第二同步数据进行数据同步。
可选地,所述第一数据管理模块,还设置为:变更数据同时生成与所述变更数据对应的第一同步日志;所述同步模块,还设置为:将所述第一同步日志对应的第一同步数据同步至第二存储服务集群。
可选地,所述同步模块包括:读取单元,设置为读取所述第一同步日志,根据所述第一同步日志读取对应的所述第一存储服务集群存储的数据;同步单元,设置为将所述读取的对应所述第一存储服务集群的数据同步至所述第二存储服务集群。
可选地,所述读取单元还包括:定时元件,设置为定时检查是否有新的第一同步日志生成。
可选地,所述第一同步日志包含所述变更数据的元数据。
可选地,所述第一数据管理模块包括:反馈单元,设置为将变更结果通知所述第一客户端。
根据本发明的再一个实施例,提供了一种分布式存储系统中的数据同步系统,包括:至少两个存储服务集群和对应的客户端;所述客户端,设置为向对应的存储服务集群发送数据变更请求;所述存储服务集群,设置为接收所述客户端发送的数据变更请求,变更对应的数据,并同步所述对应数据至另一存储服务集群;所述存储服务集群,还设置为接收所述另一存储服务集群发送的同步数据,并进行对应的数据同步。
可选地,如果所述存储服务集群和所述另一存储服务集群变更的数据分别针对同一数据的不同部分,双向同步后:所述存储服务集群和所述另一存储服务集群分别对应的客户端,还设置为读取所述同一数据的不同部分,按照预先设定的逻辑整合。
本发明实施例还提供一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上面所述的方法。
本发明实施例使得异地分布式存储服务集群之间实现数据双向同步,充分利用所有的计算资源,在有限的计算资源基础上实现异地容灾;其次,避免了业务应用进行数据的写操作需要实时访问异地分布式存储服务集群的问题,克服了异地访问网络延迟较高、带宽有限等问题。
附图概述
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的数据同步方法的流程图;
图2是根据本发明实施例的数据同步方法的流程图二;
图3是根据本发明实施例的数据同步装置的结构框图;
图4是根据本发明实施例的数据同步装置同步模块的结构框图;
图5是根据本发明实施例的数据同步系统的结构框图。
本发明的较佳实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
本发明实施例提供了一种分布式存储系统中的数据同步方法,图1是根 据本发明实施例的数据同步方法的流程图,如图1所示,该方法包括以下步骤(S101至S106):
S101,第一客户端向第一存储服务集群发送第一数据变更请求;
S102,第一存储服务集群接收第一数据变更请求并变更所述请求对应的数据;
S103,第一存储服务集群将变更数据对应的第一同步数据同步至第二存储服务集群;
S104,第二存储服务集群根据上述第一同步数据进行数据同步;
S105,第二存储服务集群按照S101—S103相同的步骤产生第二同步数据,同步至所述第一存储服务集群;
S106,第一存储服务集群根据上述第二同步数据进行数据同步。
通过本发明实施例,第一存储服务集群接收来自第一客户端的第一数据变更请求;所述第一存储服务集群根据所述第一数据变更请求,变更第一存储服务集群中的对应数据;所述第一存储服务集群将变更后的数据作为第一同步数据同步至第二存储服务集群;所述第一存储服务集群接收所述第二存储服务集群发送的第二同步数据;所述第一存储服务集群根据所述第二同步数据进行数据同步。使得异地分布式存储服务集群之间可以实现数据双向同步,充分利用所有的计算资源,在有限的计算资源基础上实现异地容灾;其次,避免了业务应用进行数据的写操作需要实时访问异地分布式存储服务集群的问题,克服了异地访问网络延迟较高、带宽有限等问题。
在本发明的一个实施例中,所述第一存储服务集群根据所述第一数据变更请求,变更第一存储服务集群中的对应数据的同时生成与所述变更数据对应的第一同步日志。所述第一存储服务集群将变更数据对应的第一同步数据同步至第二存储服务集群,包括:读取所述第一同步日志,根据所述第一同步日志读取对应的所述第一存储服务集群存储的数据,并将所述读取数据同步至所述第二存储服务集群。
图2是根据本发明实施例的数据同步方法的流程图,如图2所示,该方法包括以下步骤(S201—S210):
S201,第一客户端向第一存储服务集群发送第一数据变更请求;
S202,第一存储服务集群接收第一数据变更请求并变更所述请求对应10的数据;
S203,第一存储服务集群生成与上述变更数据对应的第一同步日志;
S204,第一存储服务集群将数据的变更结果返回上述第一客户端;
S205,第一存储服务集群读取上述第一同步日志;
S206,第一存储服务集群根据上述第一同步日志读取对应的第一存储服务集群存储的数据;
S207,第一存储服务集群将上述读取的数据作为第一同步数据发送至第二存储服务集群;
S208第二存储服务集群根据上述第一同步数据进行数据同步;
S209,第二存储服务集群按照S201—S206相同的步骤产生第二同步数据,发送至所述第一存储服务集群;
S210,第一存储服务集群根据上述第二同步数据进行数据同步。
在本发明的一个实施例中,所述读取第一同步日志,还包括:定时检查是否有新的第一同步日志生成。其中,第一存储服务集群定时检查是否有新的第一同步日志生成,并根据第一同步日志将对应的数据同步至第二存储服务集群包括以下步骤:
S301,设置一个定时检查元件,预先设定一个间隔时间段,比如1秒、5秒、10秒、15秒等;
S302,预先设定的间隔时间段经过后,启动检查是否有新的第一同步日志生成,若无,则不执行读取第一同步日志操作,若有则执行读取第一同步日志操作;
S303,读取第一同步日志中记录的数据信息;
S304,根据第一同步日志中记录的数据信息,读取对应的第一存储服务集群存储的数据。
S305,将所述读取对应第一存储服务集群存储的数据同步至第二存储服务集群。
在本发明的一个实施方式中,所述第一同步日志中包含所述变更数据的元数据,不需要包含完整的变更数据。本实施例的有益效果在于:(1)元数 据的尺寸相对较小,只包含变更数据的摘要信息和属性等,节省存储空间;(2)分布式服务集群是由多台存储服务器组成,长时间运行中存储服务器可能会发生宕机、断网等情况,这有可能会造成对同一个数据的多次修改操作,先后由多个存储服务器节点分别向异地同步,而且同步的顺序不一定与最初写入的顺序一致。因此在第一同步日志只保存了元数据而不是完整数据,第一存储服务集群在同步之前根据元数据去取当时最新的完整数据进行数据同步,避免了向异地同步过时的数据。
在本发明的一个实施方式中,第一存储服务集群根据所述第一数据变更请求,变更第一存储服务集群中的对应数据,还包括:将所述变更结果通知所述第一客户端。也即,第一存储服务集群数据变更成功后,会向第一客户端返回“数据变更成功”的信息;第一存储服务集群数据变更失败后,也会向第一客户端返回“数据变更失败”及提醒“重新操作”的信息。
本发明实施例还提供了一种分布式存储系统中的数据同步装置,图2是根据本发明实施例的数据同步装置的结构框图,如图2所示,该装置包括:第一接收模块301、第一数据管理模块302、同步模块303、第二接收模块304、第二数据管理模块305。其中,第一接收模块301,设置为接收来自第一客户端的第一数据变更请求;第一数据管理模块302,设置为根据所述第一数据变更请求,变更第一存储服务集群中对应的数据;同步模块303,设置为将变更数据作为第一同步数据同步至第二存储服务集群;第二接收模块304,设置为接收所述第二存储服务集群发送的第二同步数据;第二数据管理模块305,设置为根据所述第二同步数据进行数据同步。
通过本发明实施例,第一接收模块301接收第一客户端发送的第一数据变更请求,第一数据管理模块302随即根据上述第一数据变更请求,将第一存储服务集群中对应的数据进行变更,同步模块303负责将变更数据作为第一同步数据同步至第二存储服务集群;此外,第二接收模块304能够接收第二存储服务集群发送的第二同步数据,随即,第二数据管理模块会根据上述第二同步数据将第一存储集群中的数据进行同步。使得异地分布式存储服务集群之间可以实现数据双向同步,充分利用所有的计算资源,在有限的计算资源基础上实现异地容灾;其次,避免了业务应用进行数据的写操作需要 实时访问异地分布式存储服务集群的问题,克服了异地访问网络延迟较高、带宽有限等问题。
在本发明的一个实施方式中,所述第一数据管理模块,还设置为同时生成与所述变更数据对应的第一同步日志;所述同步模块,还设置为将所述第一同步日志对应的第一同步数据同步至第二存储服务集群。如图3所示,所述同步模块包括:读取单元3031、同步单元3032。其中,读取单元3031,读取第一同步日志记录的数据信息,根据第一同步日志记录的数据信息读取对应第一存储服务集群中存储的数据;同步单元3032,将上述读取单元所读取的第一存储服务集群中存储的数据同步至第二存储服务集群。读取单元3031还包括:定时检查元件30311,定时检查是否有新的第一同步日志生成。定时检查元件30311可以预先设定一个间隔时间段,比如1秒、5秒、10秒、15秒等;预先设定的间隔时间段经过后,启动检查是否有新的第一同步日志生成,若无,则读取单元3031不执行读取第一同步日志操作,若有则读取单元3031执行读取第一同步日志操作。
在本发明的一个实施方式中,所述第一数据管理模块302还包括:反馈单元,将所述第一数据管理模块302的数据变更结果通知所述第一客户端。也即,第一数据管理模302变更数据成功后,会向第一客户端返回“数20据变更成功”的信息;第一数据管理模块302变更数据失败后,也会向第一客户端返回“数据变更失败”及提醒“重新操作”的信息。
本发明实施例还提供了一种分布式存储系统中的数据同步系统,如图4所示,包括:至少两个存储服务集群和对应的客户端;所述客户端,设置为向对应的存储服务集群发送数据变更请求;所述存储服务集群,设置为接收所述客户端发送的数据变更请求,变更对应的数据,并同步所述对应数据至另一存储服务集群;所述存储服务集群,还设置为接收所述另一存储服务集群发送的同步数据,并进行对应的数据同步。
通过本发明实施例,使得异地分布式存储服务集群之间可以实现数据双向同步,充分利用所有的计算资源,在有限的计算资源基础上实现异地容灾;其次,避免了业务应用进行数据的写操作需要实时访问异地分布式存储服务集群的问题,克服了异地访问网络延迟较高、带宽有限的问题。
在本发明的一个实施方式中,如果所述存储服务集群和所述另一存储服务集群变更的数据分别针对同一数据的不同部分,双向同步后:所述存储服务集群和所述另一存储服务集群分别对应的客户端,还读取所述同一数据的不同部分,按照预先设定的逻辑整合。这样,本发明实施例的数据同步系统在存储服务集群和所述另一存储服务集群变更的数据分别针对同一数据不同部分的情况下能保证正常运行。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
工业实用性
本发明实施例使得异地分布式存储服务集群之间实现数据双向同步,充分利用所有的计算资源,在有限的计算资源基础上实现异地容灾;其次,避免了业务应用进行数据的写操作需要实时访问异地分布式存储服务集群的问题,克服了异地访问网络延迟较高、带宽有限等问题。

Claims (15)

  1. 一种分布式存储系统中的数据同步方法,包括:
    第一存储服务集群接收第一客户端发送的第一数据变更请求;
    所述第一存储服务集群根据所述第一数据变更请求,变更所述第一存储服务集群中的对应数据;
    所述第一存储服务集群将变更后的数据作为第一同步数据同步至第二存储服务集群;
    所述第一存储服务集群接收所述第二存储服务集群发送的第二同步数据;
    所述第一存储服务集群根据所述第二同步数据进行数据同步。
  2. 根据权利要求1所述的数据同步方法,还包括:
    所述第一存储服务集群变更第一存储服务集群中的对应数据的同时生成与所述变更后的数据对应的第一同步日志;
    所述第一存储服务集群将变更后的数据作为第一同步数据同步至第二存储服务集群,包括:所述第一存储服务集群将所述第一同步日志对应的第一同步数据同步至第二存储服务集群。
  3. 根据权利要求2所述的数据同步方法,其中,所述第一存储服务集群将所述第一同步日志对应的第一同步数据同步至第二存储服务集群,包括:
    读取所述第一同步日志,根据所述第一同步日志读取对应的所述第一存储服务集群存储的数据,并将所述读取数据同步至所述第二存储服务集群。
  4. 根据权利要求3所述的数据同步方法,其中,所述读取第一同步日志,还包括:定时检查是否有新的第一同步日志生成。
  5. 根据权利要求2至4任一项所述的数据同步方法,其中,所述第一同步日志包含所述变更数据的元数据。
  6. 根据权利要求1所述的数据同步方法,还包括:所述第一存储服务集群变更所述第一存储服务集群中的对应数据之后,将变更结果通知所述第 一客户端。
  7. 一种分布式存储系统中的数据同步装置,位于第一存储服务集群中,包括:
    第一接收模块,设置为接收来自第一客户端的第一数据变更请求;
    第一数据管理模块,设置为根据所述第一数据变更请求,变更第一存储服务集群中对应的数据;
    同步模块,设置为将变更后的数据作为第一同步数据同步至第二存储服务集群;
    第二接收模块,设置为接收所述第二存储服务集群发送的第二同步数据;以及
    第二数据管理模块,设置为根据所述第二同步数据进行数据同步。
  8. 根据权利要求7所述的数据同步装置,其中,
    所述第一数据管理模块,还设置为变更数据的同时生成与所述变更后的数据对应的第一同步日志;
    所述同步模块,是设置为将所述第一同步日志对应的第一同步数据同步至第二存储服务集群。
  9. 根据权利要求8所述的数据同步装置,其中,所述同步模块包括:
    读取单元,设置为读取所述第一同步日志,根据所述第一同步日志读取对应的所述第一存储服务集群存储的数据;以及
    同步单元,设置为将所述读取的对应所述第一存储服务集群的数据同步至所述第二存储服务集群。
  10. 根据权利要求9所述的数据同步装置,其中,所述读取单元,还包括:
    定时检查元件,设置为定时检查是否有新的第一同步日志生成。
  11. 根据权利要求8至10任一项所述的数据同步装置,其中,所述第一同步日志包含所述变更数据的元数据。
  12. 根据权利要求7所述的数据同步装置,其中,所述第一数据管理 模块,包括:
    反馈单元,设置为将变更结果通知所述第一客户端。
  13. 一种分布式存储系统中的数据同步系统,包括:
    至少两个存储服务集群和对应的客户端;
    所述客户端,设置为向对应的存储服务集群发送数据变更请求;
    所述存储服务集群,设置为接收所述客户端发送的数据变更请求,变更对应的数据,并同步所述变更后的数据至另一存储服务集群;
    所述存储服务集群,还设置为接收所述另一存储服务集群发送的同步数据,并进行对应的数据同步。
  14. 根据权利要求13所述的数据同步系统,其中,
    如果所述存储服务集群和所述另一存储服务集群变更的数据分别针对同一数据的不同部分,双向同步后:
    所述存储服务集群和所述另一存储服务集群分别对应的客户端,还设置为读取所述同一数据的不同部分,按照预先设定的逻辑整合。
  15. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求1-6任一项所述的方法。
PCT/CN2015/071859 2014-06-19 2015-01-29 一种分布式存储系统中的数据同步方法、装置及系统 WO2015192661A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410277500.XA CN105187464B (zh) 2014-06-19 2014-06-19 一种分布式存储系统中的数据同步方法、装置及系统
CN201410277500.X 2014-06-19

Publications (1)

Publication Number Publication Date
WO2015192661A1 true WO2015192661A1 (zh) 2015-12-23

Family

ID=54909308

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/071859 WO2015192661A1 (zh) 2014-06-19 2015-01-29 一种分布式存储系统中的数据同步方法、装置及系统

Country Status (2)

Country Link
CN (1) CN105187464B (zh)
WO (1) WO2015192661A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115599747A (zh) * 2022-04-22 2023-01-13 北京志凌海纳科技有限公司(Cn) 一种分布式存储系统的元数据同步方法、系统及设备

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106888245B (zh) * 2016-06-07 2020-04-24 阿里巴巴集团控股有限公司 一种数据处理方法、装置及系统
EP3260991A1 (en) * 2016-06-20 2017-12-27 Siemens Aktiengesellschaft System and method configured to execute data model transformations on data for cloud based applications
CN106506586B (zh) * 2016-09-21 2019-05-03 东软集团股份有限公司 分布式缓存同步方法、装置、节点和系统
CN108123967A (zh) * 2016-11-28 2018-06-05 中国石油天然气股份有限公司 一种集群系统的数据同步方法和系统
CN108280080B (zh) * 2017-01-06 2022-02-22 阿里巴巴集团控股有限公司 一种数据同步方法、装置以及电子设备
CN106850821A (zh) * 2017-02-21 2017-06-13 山东浪潮云服务信息科技有限公司 一种数据管理方法、数据发送装置、数据接收装置及系统
CN110377577B (zh) * 2018-04-11 2022-03-04 北京嘀嘀无限科技发展有限公司 数据同步方法、装置、系统和计算机可读存储介质
CN109522364B (zh) * 2018-10-18 2019-12-24 恒峰信息技术有限公司 一种异地数据双向同步方法及系统
CN109597687B (zh) * 2018-10-31 2020-11-13 东软集团股份有限公司 数据同步的资源分配方法、装置、存储介质和电子设备
CN109542540A (zh) * 2018-11-26 2019-03-29 北京粉笔未来科技有限公司 一种实现交互的方法、装置及系统
CN109561151B (zh) * 2018-12-12 2021-09-17 北京达佳互联信息技术有限公司 数据存储方法、装置、服务器和存储介质
CN109639849B (zh) * 2018-12-28 2022-06-21 北京奇艺世纪科技有限公司 一种地址查询处理方法及服务发现装置
CN112015804A (zh) * 2019-05-28 2020-12-01 阿里巴巴集团控股有限公司 数据同步方法、装置、设备及存储介质
CN111708787A (zh) * 2020-05-07 2020-09-25 中国人民财产保险股份有限公司 多中心业务数据管理系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778134A (zh) * 2010-01-11 2010-07-14 青岛海信移动通信技术股份有限公司 数据同步方法及移动通信终端
CN102402562A (zh) * 2010-09-14 2012-04-04 中兴通讯股份有限公司 数据库异地容灾方法及系统
CN103488721A (zh) * 2013-09-12 2014-01-01 京信通信系统(中国)有限公司 主备板的数据库双向同步方法和系统
US20140156595A1 (en) * 2012-11-30 2014-06-05 Metaswitch Networks Ltd. Synchronisation system and method
US20140164325A1 (en) * 2012-12-07 2014-06-12 Institute For Information Industry Data synchronization system and method for synchronizing data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436207B (zh) * 2008-12-16 2011-01-19 浪潮通信信息系统有限公司 一种基于日志快照的数据恢复和同步方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778134A (zh) * 2010-01-11 2010-07-14 青岛海信移动通信技术股份有限公司 数据同步方法及移动通信终端
CN102402562A (zh) * 2010-09-14 2012-04-04 中兴通讯股份有限公司 数据库异地容灾方法及系统
US20140156595A1 (en) * 2012-11-30 2014-06-05 Metaswitch Networks Ltd. Synchronisation system and method
US20140164325A1 (en) * 2012-12-07 2014-06-12 Institute For Information Industry Data synchronization system and method for synchronizing data
CN103488721A (zh) * 2013-09-12 2014-01-01 京信通信系统(中国)有限公司 主备板的数据库双向同步方法和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HUANG, LIANG ET AL.: "Research on Bidirectional Replication Function of Oracle Streams", CHINA WATER TRANSPORT, vol. 10, no. 6, 30 June 2010 (2010-06-30), pages 85 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115599747A (zh) * 2022-04-22 2023-01-13 北京志凌海纳科技有限公司(Cn) 一种分布式存储系统的元数据同步方法、系统及设备
CN115599747B (zh) * 2022-04-22 2023-06-06 北京志凌海纳科技有限公司 一种分布式存储系统的元数据同步方法、系统及设备

Also Published As

Publication number Publication date
CN105187464A (zh) 2015-12-23
CN105187464B (zh) 2019-11-05

Similar Documents

Publication Publication Date Title
WO2015192661A1 (zh) 一种分布式存储系统中的数据同步方法、装置及系统
CN102098342B (zh) 一种基于事务级的数据同步方法、装置及系统
WO2017124938A1 (zh) 一种数据同步方法、装置及系统
US11068499B2 (en) Method, device, and system for peer-to-peer data replication and method, device, and system for master node switching
CN106250270A (zh) 一种云计算平台下的数据备份方法
CN103138912B (zh) 数据同步方法及系统
CN107888666B (zh) 一种跨地域数据存储系统以及数据同步方法和装置
WO2014101424A1 (zh) 分布式数据库同步方法和系统
CN109376197B (zh) 一种数据同步方法、服务器及计算机存储介质
CN105025053A (zh) 基于云存储技术的分布式文件的上传方法及其系统
CN104320401A (zh) 一种基于分布式文件系统的大数据存储访问系统及方法
CN105208060B (zh) 业务数据同步方法、装置及系统
US20120278429A1 (en) Cluster system, synchronization controlling method, server, and synchronization controlling program
WO2016029744A1 (zh) 一种元数据恢复方法及相关装置
CN103986789A (zh) 一种实现基于nfs的hadoop ha集群中nfs节点双机冗余的方法
CN105978948B (zh) 一种云服务的方法和系统
WO2015106656A1 (zh) 一种跨数据中心的数据同步方法
CN103795801A (zh) 一种基于实时应用集群的元数据集群设计方法
CN104104739A (zh) 一种云存储系统元数据服务集群的数据同步方法
CN105069152A (zh) 数据处理方法及装置
WO2014135011A1 (zh) 数据库系统以及数据同步方法
CN109145060A (zh) 数据处理方法及装置
CN103428288A (zh) 基于分区状态表和协调节点的副本同步方法
CN114201362A (zh) 基于Prometheus的企业级高可用监控系统及实现方法
CN104778214B (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: 15809119

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: 15809119

Country of ref document: EP

Kind code of ref document: A1