WO2018201832A1 - 一种分布式缓存数据库数据迁移的方法及系统 - Google Patents

一种分布式缓存数据库数据迁移的方法及系统 Download PDF

Info

Publication number
WO2018201832A1
WO2018201832A1 PCT/CN2018/081535 CN2018081535W WO2018201832A1 WO 2018201832 A1 WO2018201832 A1 WO 2018201832A1 CN 2018081535 W CN2018081535 W CN 2018081535W WO 2018201832 A1 WO2018201832 A1 WO 2018201832A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
copy
data
migration
cdb
Prior art date
Application number
PCT/CN2018/081535
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 WO2018201832A1 publication Critical patent/WO2018201832A1/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 disclosure relates to the field of data migration, and in particular, to a method and system for data migration of a distributed cache database.
  • a table of a database is divided into multiple sub-tables, each of which stores a part of the data.
  • a subtable is called a partition.
  • the entire distributed data is managed in a way that is fragmented by memory.
  • a shard can have multiple copies simultaneously on a distributed node. When migrating data, you can migrate one or more shards at a time.
  • CDN cached database data node
  • a method for data migration of a distributed cache database including: determining, during a data migration of a Cache Database (CDB), steady state data after completion of CDB data migration by a CDB control node a slice distribution; the CDB control node determines, according to the steady state data slice distribution, a first copy of the data slice that needs to be migrated to the ingress node; and the CDB control node notifies the move node that the The moving in node obtains the fragment data related to the first copy.
  • CDB Cache Database
  • a system for distributed cache database data migration including a cache database CDB control node, an ingress node, and an egress node, wherein the cache database (CDB) control node
  • CDB cache database
  • the cache database (CDB) control node For determining a steady-state data slice distribution after the CDB data migration is completed during the CDB data migration, determining, according to the steady-state data slice distribution, a first copy of the data slice that needs to be migrated to the migrated node, and notifying the And moving to the node; and the moving in node is configured to acquire the fragment data related to the first copy according to the notification from the CDB control node.
  • a computer storage medium storing a computer executable program, wherein the method described above is performed when the computer executable program is run on a processor.
  • FIG. 1 is a flowchart of a method for data migration of a distributed cache database according to an embodiment of the present disclosure
  • FIG. 2 is a structural diagram of a distributed cache database data migration system according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a slice distribution pattern before migration according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of an average first copy in a slice distribution migration algorithm for adding a node scene according to an embodiment of the present disclosure
  • FIG. 4b is a schematic diagram of a first copy of the same-domain and cross-domain movement in a slice distribution migration algorithm for adding a node scenario according to an embodiment of the present disclosure
  • 4c is a schematic diagram of adjusting a second copy in a slice distribution migration algorithm for adding a node scenario according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a fragment distribution replica after the migration is completed in the fragment distribution migration algorithm of the node scenario according to the embodiment of the present disclosure
  • FIG. 5a is a schematic diagram of a fragment copy before deleting a node scenario according to an embodiment of the present disclosure
  • FIG. 5b is a schematic diagram of a fragment copy after deleting a node scenario according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of a data migration process for adding a node scenario according to an embodiment of the present disclosure.
  • Embodiments of the present disclosure are an extension of traditional distributed database migration and replication technologies. According to an embodiment of the present disclosure, all data is automatically cut into multiple data fragments according to an MD5HASH algorithm of an identifier or a user-independent table ID, and data between data fragments is different, and the same data fragment is in the same data fragment. Contains partial data for all users, and multiple copies of each data fragment can exist at the same time.
  • the first copy represents the steady state of the data
  • the second copy serves as a backup of the data slice
  • the third copy serves as the temporary copy in the migration
  • the fourth copy is the temporary copy to be deleted after the data migration.
  • roles of multiple copies of the same slice can be converted to each other to implement the data migration method described herein.
  • the slice distribution of CDB data is calculated and released by the CDB Control Node (CCC).
  • CCC CDB Control Node
  • a complete data management area has three distributions in memory, including: current temporary distribution, continuous interaction with data nodes (CDB Data Node, CDN), business nodes, etc.; Steady-state slice distribution; and initial slice distribution of backups before data migration.
  • the pre-storage method is used to back up the source data of the database during the business trough, and then recover on the destination node.
  • the log operation file is used for incremental loading to achieve the purpose of migration.
  • the shards to be migrated are cascading master-slave replication to destination shards.
  • the master-slave switchover mode is used to change the relationship between the master device and the slave device, and then the database tool is used to parse and execute the operation log generated during the switchover process.
  • the above-mentioned conventional distributed cache data migration method has a relatively large amount of data and requires additional resources. Therefore, the conventional distributed cache data migration method cannot fully meet the requirements of real-time, adaptive data migration.
  • FIG. 1 is a flowchart of a method for data migration of a distributed cache database according to an embodiment of the present disclosure. As shown in FIG. 1, the method includes the following steps:
  • Step S101 determining, during the CDB data migration, a steady state data slice distribution after the CDB data migration is completed by the CDB control node;
  • Step S102 The CDB control node determines, according to the steady state data fragment distribution, a first copy of the data fragment that needs to be migrated to the ingress node;
  • Step S103 The CDB control node notifies the ingress node, so that the ingress node acquires fragment data related to the first copy.
  • step S101 if the CDB control node acquires a newly added data node, in the scenario of adding a new data node, the node with the largest number of the first copy is selected from the original data node, and then a first one is selected from the node. A copy. If the difference between the number of node fragments of the second copy corresponding to the first copy and the number of copies of other nodes in the same domain is less than or equal to 1, the first copy may be selected as the first copy to be migrated.
  • the CDB control node acquires the newly added data node, the CDB control node selects the first data copy to be migrated from the original data node, and determines the original data node. And whether the newly added data node is a same-domain data node, and the first copy of the original data node in the initial fragment distribution before migration is adjusted to be the first copy of the newly added data node. In an exemplary embodiment, if the original data node and the newly added data node are the same domain data node, the first copy of the original data node in the initial fragment distribution before the migration is placed.
  • the CDB control node receives a notification from the server load balancing (SLB) that needs to delete the data node, in the scenario of deleting the data node, the CDB control node first calculates the remaining data node after the deleted data node is deleted. The number of the first copies to be distributed is adjusted, and the first copy of the data node to be deleted in the initial fragment distribution before the migration is adjusted to the remaining data according to the number of the first copies to be distributed on the remaining data nodes. The first copy of the node. In an exemplary embodiment, if the original data node and the data node to be deleted are the same domain node, the first copy of the data node to be deleted in the initial fragment distribution before the migration is placed.
  • SLB server load balancing
  • step S102 in the scenario of adding a data node, the CDB control node determines, according to the current running data fragment distribution and the steady state data fragment distribution, that the newly added data node is an inbound node and needs to be migrated to the location. The first copy of the new data node.
  • the method further includes: the CDB control node determining, according to a second copy quantity balancing policy of each data node in the same domain, a second copy that needs to be migrated to the newly added data node, and notifying the Add a new data node.
  • the CDB control node determines, according to the current running data fragment distribution and the steady state data fragment distribution, that the remaining data node is an ingress node and needs to migrate from the to-be-deleted data node to the A first copy of the remaining data nodes.
  • the method further includes: the CDB control node determines, according to the second copy quantity balancing policy of each data node in the same domain, the second copy that needs to be migrated to the remaining data nodes in the same domain, and notifies the remaining Data node.
  • step S103 in the scenario of adding a data node, the newly added data node as the ingress node sequentially acquires the fragment data related to the first copy that needs to be moved as the third copy through online recovery and asynchronous replication.
  • the newly added data node sequentially acquires the fragment data related to the second copy that needs to be moved as the third through online recovery and asynchronous replication.
  • a copy If the original data node where the first copy is located and the new data node are the same domain data node, the original data node where the first copy is located is the same domain data node during the acquisition of the fragment data related to the first copy that needs to be moved by asynchronous replication.
  • the first copy is converted into a fourth copy to be deleted after the migration, and the fourth copy is deleted after the migration is completed. If the original data node where the first copy is located and the new data node are not the same domain data node, the first copy is converted into a second copy for backup. During the acquisition of the fragment data related to the second copy that needs to be moved by asynchronous replication, the second copy is converted into the fourth copy to be deleted after the migration, and the fourth copy is deleted after the migration is completed.
  • the remaining data nodes that are the ingress nodes sequentially obtain the fragment data related to the first copy that needs to be moved as the third copy through online recovery and asynchronous replication.
  • the remaining data node sequentially acquires the fragment data related to the second copy that needs to be moved as the third copy by online recovery and asynchronous replication.
  • the first copy of the to-be-deleted data node is converted into the fourth copy to be deleted after being migrated, and is deleted after the migration is completed, when the fragmentation data related to the first copy to be migrated is obtained by asynchronous replication.
  • the fourth copy converting the third copy of the remaining data node into a first copy; and obtaining, by asynchronous copying, the piece of data related to the second copy that needs to be moved, the data node to be deleted
  • the second copy is converted into a fourth copy to be deleted after the migration, and the fourth copy is deleted after the migration is completed; and the third copy of the remaining data node is converted into the second copy.
  • an embodiment of the present disclosure further provides a computer readable storage medium having a program executable by a processor stored on a computer readable storage medium.
  • the storage medium may be a ROM/RAM, a magnetic disk, a USB flash drive, an optical disk, or the like.
  • Embodiments of the present disclosure also provide a system for distributed cache database data migration, including a memory and a processor coupled to the memory, wherein the processor implements the following steps when running the program stored by the memory :
  • the steady state data slice distribution after the CDB data migration is completed is determined by the CDB control node; the CDB control node determines the data fragment to be migrated to the migrated node according to the steady state data slice distribution a first copy; and the CDB control node notifying the move-in node, so that the move-in node acquires fragment data related to the first copy.
  • FIG. 2 is a structural diagram of a distributed cache database data migration system according to an embodiment of the present disclosure. As shown in FIG. 2, the system includes a cache database CDB control node, an ingress node, and an egress node, wherein:
  • the CDB control node is configured to determine a steady state data fragment distribution after the CDB data migration is completed during the CDB data migration, and determine, according to the steady state data fragment distribution, a data fragment that needs to be migrated to the ingress node. Replicating and notifying the move-in node; and the move-in node is configured to acquire the slice data related to the first copy according to a notification from the CDB control node.
  • the move-in node is a new data node
  • the move-out node is an original data node.
  • the data fragments of the original data node are uniformly migrated to the newly added data node.
  • the move-in node is a remaining data node
  • the move-out node is a data node to be deleted.
  • the data fragments of the data node to be deleted are uniformly migrated to the remaining data nodes.
  • FIG. 6 is a flowchart of a data migration process for adding a node scenario according to an embodiment of the present disclosure. As shown in Figure 6, adding a node scenario migration includes the following steps:
  • Step 1) Check the status of the cached data node and obtain the new node.
  • the CCC can check the node status of the CDN.
  • the SLB periodically calls the CCC to calculate whether it needs to be expanded or reduced. If capacity expansion is required, the CCC activated node is notified.
  • Step 2) Inform the data node to clear the library and prepare to accept the data fragmentation.
  • Step 3 Recalculate the steady-state fragment distribution after the CDB migration including the newly added node is completed.
  • Step 4 According to the current running fragment distribution and the migration completion distribution, the first temporary distribution is delivered and the CDN node is notified.
  • the CCC combines the current running fragment distribution and the migration completion distribution, and delivers the first temporary distribution and notifies the CDN node.
  • the temporary distribution contains new nodes and a third copy is added to the newly added nodes.
  • the newly added CDN node performs online recovery in units of fragments after receiving the distribution change.
  • the CCC completes this step by checking the status of the new CDN node.
  • Step 5 Calculate the CDB temporary fragment distribution and notify the CDN node according to the current running fragment distribution and the migration completion distribution.
  • the CCC combines the current running slice distribution with the migration completion distribution, calculates the CDB temporary slice distribution again and notifies the CDN node.
  • the temporary distribution the first or second copy of the cross-domain move on the CDN node is converted to each other, and the migrated slice copy is converted into the fourth copy, and the third copy on the newly added node CDN is converted into the first or second copy.
  • the CDN node performs asynchronous replication after receiving the distribution change to ensure real-time consistency of the database.
  • the CCC estimates the asynchronous replication completion time and completes this step after waiting for a while.
  • Step 6 The steady-state fragmentation after the completion of the migration of the CCC is distributed to the CDN, and the CDN deletes the fourth fragment and releases the memory.
  • each node is sequentially added with one fragment according to the node number from small to large, where N is the total number of fragments, L is the number of CDN nodes in the left domain, and R is the number of CDN nodes in the right domain.
  • the fragmentation range of each CDN node is calculated according to the order of the fragments from small to large, and according to the order of the node numbers from small to large and the number of fragments A on each node. Select a CDN node in ascending order.
  • a first copy of a slice is first allocated to the node in a sequence from small to large, and a second copy of the slice is The node that is assigned the least copy of the foreign CDN node. If there are multiple nodes in the foreign domain, select the smallest node. The remaining slices are taken out in sequence. The first copy is assigned to the current node, and the second copy is assigned to the node with the smallest copy of the foreign domain until all the fragments belonging to the slice range are allocated to the node.
  • the first copy may be selected and placed in the newly added node, or retry Other first copy.
  • the first copy When the first copy is selected, if the node where the selected first slice is located and the newly added node are in the same domain, after the first slice is moved to the newly added node and the original first slice is deleted, Decrease the number of original node fragments by one, and there is no change in the peer domain. If the selected node and the newly added node are in different domains, the first fragment is added on the new node, and the first copy is converted to the second copy on the original node, and a copy of each node in the domain is used. There is no change in the number, the only change is the proportion of the first copy and the second copy in the node.
  • the number of the second copy is not uniform, and the left and right fields respectively adjust the corresponding second copy. If there are no new nodes in the domain, no adjustment is required.
  • the first temporary distribution algorithm for adding a node scenario which is used for adding node online recovery, will be described below with reference to FIGS. 4a to 4d.
  • the main purpose of the algorithm is to find new shards to be moved on all nodes in the final result distribution of the data migration. After these fragments are distributed, online recovery is initiated by the CDN node to obtain the distinction between the fragmented data and the new original node. Find new nodes by comparing the current distribution with the final result distribution.
  • the original node For the original node, it is necessary to compare the final slice distribution to find the fragments that are in the final distribution and that are not in the current distribution.
  • the fragment is added to the original node and set to the third copy.
  • new nodes add nodes and add fragments and copies.
  • the newly added node information in the final result distribution is first appended to the current node list, and then all the fragments of these nodes are converted into a third copy.
  • a second temporary distribution delivery algorithm for adding a node scenario, which is used for node asynchronous replication, will be described below with reference to FIGS. 4a to 4d.
  • This algorithm is to remove the redundant data from the distribution after obtaining the backup data, and restore the newly added third copy to the potential first copy or second copy as desired.
  • the final fragment distribution is directly delivered, and the CDN finds the local redundant fourth copy fragment for deletion. This algorithm may cause the fourth slice to not be deleted, but it will not affect the correctness of the data.
  • Embodiments of the present disclosure may also be used to reduce the scene of a node.
  • the steps to reduce node scenario migration include:
  • Step 1) Recalculate the steady-state fragment distribution after the CDB migration is completed, and the distribution does not contain the node to be deleted.
  • Step 2 According to the current running slice distribution and the migration completion distribution, the first temporary distribution is delivered and the CDN node is notified.
  • the CCC combines the current running fragment distribution and the migration completion distribution, and delivers the first temporary distribution and notifies the CDN node.
  • the third copy is added to the CDN node that continues to work in the distribution.
  • the CDN After the CDN receives the distribution, the CDN performs online recovery according to the fragmentation, and the CCC checks that all node status confirmations are completed.
  • Step 3 Calculate the CDB temporary fragment distribution and notify the CDN node according to the current running fragment distribution and the migration completion distribution.
  • the CCC combines the current running slice distribution with the migration completion distribution, calculates the CDB temporary slice distribution again and notifies the CDN node.
  • the migrated fragment is marked as the fourth copy, and the third copy is converted into the first copy and the second copy according to the left-right domain equalization principle.
  • the CDN receives the distribution for asynchronous replication to ensure data consistency, and the CCC waits for a period of time (for example, 20s). After the completion.
  • Step 4 The steady-state fragmentation after the completion of the migration of the CCC is distributed to the CDN, and the CDN deletes the fourth fragment and releases the memory.
  • the second copy on the node to be deleted needs to be transferred to other nodes in the same domain. Check the left and right fields from slot1. The second copy is added to the node with a smaller number of second copies in the same domain, so that the total number of copies on the nodes in the two domains is equalized.
  • the first temporary fragment distribution delivery algorithm for reducing the node scene is described below with reference to FIGS. 5a to 5b.
  • the data on the node to be deleted must be migrated before the node can be deleted. Therefore, the purpose of the algorithm is to obtain fragments on the nodes that have not been deleted that are not present in the final slice distribution but not in the current node distribution. These shards are set as a third shard copy for data backup before the algorithm is executed.
  • two third copies may appear at the same time, but the two third copies are located on different original nodes that are not to be deleted. That is, one slice can have up to four copies in the distribution.
  • the predecessor of the third slice copy corresponding to the node to be deleted is the first slice copy
  • the predecessor of the third slice copy corresponding to the undeleted node is the second slice copy.
  • the second temporary fragment distribution delivery algorithm for reducing the node scene is described below with reference to FIGS. 5a to 5b.
  • This algorithm is to remove the redundant data from the distribution after obtaining the backup data, and restore the newly added third copy to the potential first copy or second copy as desired.
  • the following describes the second distribution delivery algorithm for reducing the node scenario, including deleting nodes and asynchronous replication.
  • This algorithm is to remove the redundant data from the distribution after obtaining the backup data, and restore the newly added third copy to the potential first copy or second copy as desired.
  • the final fragment distribution is directly delivered, and the CDN finds the local redundant fourth copy fragment for deletion. This algorithm may cause the fourth slice to not be deleted, but it will not affect the correctness of the data.
  • the embodiment of the present disclosure achieves high efficiency and security of data fragmentation by centralized management of data distribution, combined with multiple calculations of the distribution of fragments and control of the replication process.
  • Real-time, efficient, and secure migration of data can be achieved by mutual conversion between multiple copies of the same data slice during data migration.
  • the amount of data migrated is small, no additional resource cooperation is required, and the service is not interrupted.

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开公开了一种分布式缓存数据库数据迁移的方法及系统。所述方法包括:在CDB数据迁移期间,通过CDB控制节点确定CDB数据迁移完成后的稳态数据分片分布;所述CDB控制节点根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本;以及所述CDB控制节点通知所述迁入节点,使所述迁入节点获取所述第一副本相关的分片数据。摘图1

Description

一种分布式缓存数据库数据迁移的方法及系统 技术领域
本公开涉及数据迁移领域,特别涉及一种分布式缓存数据库数据迁移的方法及系统。
背景技术
随着无线通讯技术、存储介质、云计算的快速发展,大量的实时的动态数据需要采用缓存的方式分布于各个云节点上。数据不再单纯存储在物理设备上,而是可以伴随系统的资源伸缩(scaling)进行流动分布,因此,研究分布式场景下的缓存数据的迁移(migrate)已成为一个重要方向。在分布式数据库的云存储的背景下,数据存储节点的弹性伸缩(elastic scalability)带来的内存数据的迁移是分布式缓存数据库的重要任务。当云平台根据硬件资源及策略进行弹性伸缩的时候,如果节点上所缓存的数据发生丢失或失序,或过多的数据移动都会极大影响基于这些数据的业务的功能性。同时,迁移的结果也直接影响数据分布的均衡性。处理不当会造成业务处理逻辑的复杂性增加。
在通常情况下,数据库的一个表被划分为多个子表,每一个子表存储其中一部分数据。这样,一个子表被称为一个分片(partition)。整个分布式数据采用内存分片的方式管理。一个分片可以有多个副本同时存在分布式节点上。数据迁移时,可以一次迁移一个或多个分片。
数据在迁移的时候要求尽可能的少移动分片。每个缓存数据库数据节点(CDB Data Node,CDN)节点上的第一副本对应的第二副本尽量均匀分布在异域节点上。在有容灾备份节点的场景下,应尽量避免或者减少数据在已有的CDN节点之间相互迁移,特别是跨域迁移。迁移的过程要求不增加额外的虚拟资源。
公开内容
根据本公开的一个实施例,提供了一种分布式缓存数据库数据迁移的方法,包括:在缓存数据库(Cache Database,CDB)数据迁移期间,通过CDB控制节点确定CDB数据迁移完成后的稳态数据分片分布;所述CDB控制节点根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本;以及所述CDB控制节点通知所述迁入节点,使所述迁入节点获取所述第一副本相关的分片数据。
根据本公开的一个实施例,提供了一种分布式缓存数据库数据迁移的系统,包括缓存数据库CDB控制节点、迁入节点、迁出节点,其中,所述缓存数据库(Cache Database,CDB)控制节点用于在CDB数据迁移期间,确定CDB数据迁移完成后的稳态数据分片分布,根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本,并通知所述迁入节点;并且所述迁入节点用于根据来自所述CDB控制节点的通知,获取所述第一副本相关的分片数据。
根据本公开的一个实施例,提供了一种计算机存储介质,存储有计算机可执行程序,其中,当所述计算机可执行程序在处理器上运行时,执行以上所述的方法。
附图说明
图1是本公开实施例提供的分布式缓存数据库数据迁移方法的流程图;
图2是本公开实施例提供的分布式缓存数据库数据迁移系统的结构图;
图3是本公开实施例提供的在迁移前的分片分布格局的示意图;
图4a是本公开实施例提供的在增加节点场景分的片分布迁移算法中平均第一副本的示意图;
图4b是本公开实施例提供的在增加节点场景的分片分布迁 移算法中同域和跨域移动的第一副本的示意图;
图4c是本公开实施例提供的在增加节点场景的分片分布迁移算法中调整第二副本的示意图;
图4d是本公开实施例提供的在增加节点场景的分片分布迁移算法中迁移结束后的分片分布副本的示意图;
图5a是本公开实施例提供的在删除节点场景的分片副本转换前的示意图;
图5b是本公开实施例提供的在删除节点场景的分片副本转换后的示意图;
图6是本公开实施例提供的在增加节点场景的数据迁移过程的示意图。
具体实施方式
以下结合附图对本公开的优选实施例进行详细说明,应当理解,以下所说明的优选实施例仅用于说明和解释本公开,并不用于限定本公开。本公开实施例是由传统分布式数据库迁移及复制技术的扩展。根据本公开的实施例,所有数据按照标识(Identifier)或者用户不相关的表ID的MD5HASH算法自动切割为多个数据分片,数据分片之间的数据各不相同,同一个数据分片中包含所有用户的部分数据,每个数据分片可以同时存在多个副本。
在所述多个副本中,第一副本代表数据的稳态、第二副本作为数据分片的备份、第三副本作为在迁移临时副本、第四副本为在数据迁移后待删除的临时副本。
在数据迁移过程中,同一分片的多个副本的角色之间可以互相转换,以实现本文描述的数据迁移方法。
CDB数据的分片分布由CDB控制节点(CDB Control Node,CCC)计算并发布。在整个迁移过程中一份完整的数据管理区在内存中存在三份分布,包括:当前的临时分布,与数据节点(CDB Data Node,CDN)、业务节点等持续交互使用;在迁移结束后的稳态分片分布;以及在数据迁移前的备份的初始分片分布。
常规分布式缓存数据迁移通过以下方法实现。
1、利用数据库本身触发dump机制。采用预先存储的方法,在业务低谷期对数据库进行源数据的备份,然后在目的节点上进行恢复。同时,配合日志操作文件进行增量加载,达到迁移的目的。
2、利用ms机制进行级联复制。将准备迁移的分片进行级联主从复制到目的分片,采用主备切换的方式调换主设备和从设备的关系,然后再利用数据库工具解析并执行切换过程中产生的操作日志。
可以看出,上述常规分布式缓存数据迁移方法的数据量比较大,需要额外资源配合。因此,常规分布式缓存数据迁移方法不能完全满足实时的、自适应的数据迁移的需求。
图1是本公开实施例提供的分布式缓存数据库数据迁移方法的流程图。如图1所示,所述方法包括以下步骤:
步骤S101:在CDB数据迁移期间,通过CDB控制节点确定CDB数据迁移完成后的稳态数据分片分布;
步骤S102:所述CDB控制节点根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片的第一副本;以及
步骤S103:所述CDB控制节点通知所述迁入节点,使所述迁入节点获取所述第一副本相关的分片数据。
在步骤S101中,若所述CDB控制节点获取新增数据节点,则在新增数据节点的场景下,从原有数据节点中选取第一副本最多的节点,然后从该节点上选择一个第一副本。如果该第一副本对应的第二副本所在的节点分片数与同域其它节点的副本分片数的差值小于等于1,则可选取该第一副本作为待迁移的第一副本。
若所述CDB控制节点获取新增数据节点,则在新增数据节点的场景下,所述CDB控制节点从原有数据节点中选取待迁移的第一副本后,通过确定所述原有数据节点与所述新增数据节点是否是同域数据节点,将迁移前初始分片分布中所述原有数据节点的第一副本调整为所述新增数据节点的第一副本。在一个示例性实 施例中,若所述原有数据节点与所述新增数据节点是同域数据节点,则将所述迁移前初始分片分布中所述原有数据节点的第一副本放入所述新增数据节点,并删除所述迁移前初始分片分布中所述原有数据节点的第一副本;若所述原有数据节点与所述新增数据节点不是同域数据节点,则将迁移前初始分片分布中所述原有数据节点的第一副本放入所述新增数据节点,并将所述迁移前初始分片分布中所述原有数据节点的第一副本转换为用于备份的第二副本。调整同域内的第二副本,使同域内的每个数据节点的第二副本数量均衡。
若所述CDB控制节点收到来自服务器负载均衡(SLB)的需要删除数据节点的通知,则在删除数据节点的场景下,所述CDB控制节点首先计算待删除数据节点删除后的剩余数据节点上需要分布的第一副本的数量,并根据所述剩余数据节点上需要分布的第一副本的数量,将迁移前初始分片分布中所述待删除数据节点的第一副本调整为所述剩余数据节点的第一副本。在一个示例性实施例中,若所述原有数据节点与所述待删除数据节点是同域节点,则将所述迁移前初始分片分布中的所述待删除数据节点的第一副本放入第一副本数量最少的剩余数据节点;若所述原有数据节点与所述待删除数据节点不是同域节点,则将所述迁移前初始分片分布中的所述剩余数据节点的与所述待删除数据节点的第一副本关联的第二副本转换为第一副本。将所述迁移前初始分片分布中所述待删除数据节点的第二副本转移至同域内的剩余数据节点,并将第二副本补充到同域内第二副本数最少的剩余数据节点上。
通过对比稳态数据分片分布和当前运行数据分片分布,可以确定新增数据节点或待删除数据节点,以及数据节点上存在于稳态数据分片分布而不存在于当前运行数据分片分布的数据分片(即待迁移的数据分片)。
在步骤S102中,在新增数据节点的场景下,所述CDB控制节点根据当前运行数据分片分布和所述稳态数据分片分布,确定 新增数据节点为迁入节点及需要迁移至所述新增数据节点的第一副本。在执行步骤S102之后,所述方法还包括:所述CDB控制节点按照同域内各数据节点的第二副本数量均衡策略,确定需要迁移至所述新增数据节点的第二副本,并通知所述新增数据节点。
在删除数据节点的场景下,所述CDB控制节点根据当前运行数据分片分布和所述稳态数据分片分布,确定剩余数据节点为迁入节点及需要从所述待删除数据节点迁移至所述剩余数据节点的第一副本。在执行步骤S102之后,所述方法还包括:所述CDB控制节点按照同域内各数据节点的第二副本数量均衡策略,确定需要迁移至同域内剩余数据节点的第二副本,并通知所述剩余数据节点。
在步骤S103中,在新增数据节点的场景下,作为迁入节点的新增数据节点依次通过在线恢复和异步复制,获取与需要迁入的第一副本相关的分片数据作为第三副本。在所述迁入节点获取所述第一副本相关的分片数据期间,所述新增数据节点依次通过在线恢复和异步复制,获取与需要迁入的第二副本相关的分片数据作为第三副本。其中,在通过异步复制获取与需要迁入的第一副本相关的分片数据期间,若所述第一副本所在的原有数据节点与所述新增数据节点是同域数据节点,则将所述第一副本转换为迁移后待删除的第四副本,并在迁移完成后删除所述第四副本。若所述第一副本所在的原有数据节点与所述新增数据节点不是同域数据节点,则将所述第一副本转换为用于备份的第二副本。在通过异步复制获取与需要迁入的第二副本相关的分片数据期间,将所述第二副本转换为迁移后待删除的第四副本,并在迁移完成后删除所述第四副本。
在删除数据节点的场景下,作为迁入节点的剩余数据节点依次通过在线恢复和异步复制,获取与需要迁入的第一副本相关的分片数据作为第三副本。在所述迁入节点获取所述第一副本相关的分片数据期间,所述剩余数据节点依次通过在线恢复和异步复制,获取与需要迁入的第二副本相关的分片数据作为第三副本。 其中,通过异步复制获取与需要迁入的第一副本相关的分片数据期间,将所述待删除数据节点的第一副本转换为迁移后的待删除的第四副本,并在迁移完成后删除所述第四副本;将所述剩余数据节点的第三副本转换为第一副本;通过异步复制获取与需要迁入的第二副本相关的分片数据期间,将所述待删数据节点的第二副本转换为迁移后待删除的第四副本,并在迁移完成后删除所述第四副本;将所述剩余数据节点的第三副本转换为第二副本。
本领域普通技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中。也就是说,本公开实施例还提供一种计算机可读存储介质,在计算机可读存储介质上存储有处理器可执行的程序。当处理器执行这些程序时,至少实现上述步骤S101至步骤S103。其中,所述的存储介质可以为ROM/RAM、磁碟、U盘、光盘等。
本公开实施例还提供了一种用于分布式缓存数据库数据迁移的系统,包括存储器和与所述存储器连接的处理器,其中所述处理器在运行所述存储器存储的程序时,实现以下步骤:
在CDB数据迁移期间,通过CDB控制节点确定CDB数据迁移完成后的稳态数据分片分布;所述CDB控制节点根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本;以及所述CDB控制节点通知所述迁入节点,使所述迁入节点获取所述第一副本相关的分片数据。
图2是本公开实施例提供的分布式缓存数据库数据迁移系统的结构图。如图2所示,该系统包括缓存数据库CDB控制节点、迁入节点、迁出节点,其中:
所述CDB控制节点用于在CDB数据迁移期间,确定CDB数据迁移完成后的稳态数据分片分布,根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本,并通知所述迁入节点;并且所述迁入节点用于根据来自所述CDB控制节点的通知,获取所述第一副本相关的分片数据。
在新增数据节点的场景下,所述迁入节点是新增数据节点,所述迁出节点是原有数据节点。将原有数据节点的数据分片均衡地迁移至新增数据节点。
在删除数据节点的场景下,所述迁入节点是剩余数据节点,所述迁出节点是待删除数据节点。将待删数据节点的数据分片均衡地迁移至剩余数据节点。
以下通过图3至图6的实施例进一步进行说明。
图6是本公开实施例提供的增加节点场景的数据迁移过程的流程图。如图6所示,增加节点场景迁移包括以下步骤:
步骤1)检查缓存数据节点状态,获取新增节点。
CCC可以检查CDN的节点状态,SLB通过定时调用CCC,计算是否需要扩容或缩容。如果需要扩容,则通知CCC已激活的节点。
步骤2)通知数据节点清库,准备接受数据分片。
步骤3)重新计算包含新增节点在内的CDB迁移完成后的稳态分片分布。
步骤4)根据当前运行分片分布与迁移完成分布,下发第一次临时分布并通知CDN节点。
CCC结合当前运行分片分布与迁移完成分布,下发第一次临时分布并通知CDN节点。临时分布中包含新增节点,且在新增节点中增加第三副本。新增CDN节点在收到分布变化后以分片为单位进行在线恢复。CCC通过检查新CDN节点状态确认完成该步骤。
步骤5)根据当前运行分片分布与迁移完成分布,再次计算CDB临时分片分布并通知CDN节点。
CCC结合当前运行分片分布与迁移完成分布,再次计算CDB临时分片分布并通知CDN节点。该临时分布中,CDN节点上跨域移动的第一或第二副本互相转化,迁出的分片副本转化为第四副本,新增节点CDN上的第三副本转为第一或第二副本。CDN节点在收到分布变化后进行异步复制,保证数据库的实时一致性。CCC估算异步复制完成时间,并且在等待一段时间后完成该步骤。
由于数据是实时动态的,从其它副本在线恢复数据后,需要通过异步复制保证数据完整性。
步骤6)CCC下发迁移完成后的稳态分片分布到CDN,CDN删除第四分片,释放内存。
下面将描述在增加节点场景中涉及的迁移算法。
迁移前初始分片分布,如图3所示。
计算每个CDN节点上要分配的分片数量A=N/(L+R)。如整除不尽,按照节点号从小到大顺序,每个节点依次增加1个分片,其中N为分片总数,L为左域CDN节点数,R为右域CDN节点数。
按照分片从小到大的顺序,并根据节点号从小到大的顺序和每个节点上的分片数量A,计算出每个CDN节点的分片范围。按照从小到大的顺序,选择1个CDN节点。
在一个示例性实施例中,在本CDN节点分片范围内,按照分片从小到大的顺序先取出一个分片的第一副本分配到该节点,同时,将该分片的第二副本,分配到异域CDN节点副本最少的节点。如异域有多个节点,选择最小的节点。依次取出剩下的分片。分配第一副本到当前节点,并分配第2副本到异域的副本最小的节点,直到属于分片范围内的所有分片都分配到该节点。
每个CDN节点重复上一步。分配当前CDN节点N/(L+R)个第一副本,并将该分片的第二副本平均分配到另一个域的节点,直到所有节点分片分配完成。
下面将参考图4a至图4d描述增加节点场景以在迁移结束后,获取稳态分片分布算法。
尝试从所有现存节点中选取第一副本最多的节点,然后从该节点上选取一个第一副本。如果该第一副本对应的第二副本所在的节点分片数与同域其它节点的副本分片数的差值<=1,则该第一副本可以选取并放入新增节点,否则重新尝试其它第一副本。
在选取第一副本时,如果被选到的第一分片所在节点和新增节点在同一个域,则在将该第一分片移动到新增节点并删除原来 的第一分片后,将原节点分片数减1,对端域没有任何变化。如果被选到的第一分片所在节点和新增节点在不同的域,采用新节点上增加第一分片,在原节点上将第一副本转为第二副本,域的每个节点的副本数都没有变化,变化的只是节点中第一副本和第二副本的多少比例。
在第一副本移动完成之后,左右两域各自域内是副本总数是均匀的,即相差<=1。但第二副本的个数是不均匀的,左右域分别调整相应的第二副本。如果域中没有新增节点,不需要调整。
下面将参考图4a至图4d描述增加节点场景的第一次临时分布算法,该算法用于新增节点在线恢复。
该算法的主要目的是为了在数据迁移的最终结果分布中找到所有节点上要移入的新分片。这些分片分布下发后,由CDN节点发起在线恢复以获取分片数据对新原节点的区分。通过比对当前分布与最终结果分布,找出新增节点。
对于原节点,需要比对最终分片分布以找出最终分布里有,而目前分布中没有的分片。在原节点中加入该分片,并设置为第三副本。对于新节点,先增加节点再增加分片及副本。首先将最终结果分布中的新增节点信息追加到当前的节点列表中,然后将这些节点的所有分片转换为第三副本。
需要注意的是,同一个分片在经过本算法处理后,可能同时出现两个第三副本,其中一个第三副本位于新增节点上,另一个第三副本位于原节点上。即,一个分片在分布中最多达到四个副本。原节点上此时会产生第三副本的原因主要是调整同域内第二副本的均衡性。
下面将参考图4a至图4d描述增加节点场景的第二次临时分布下发算法,该算法用于节点异步复制。
本算法的目的是在获取备份数据后,将多余的数据从分布中去除,同时将新增的第三副本按期望还原成潜在的第一副本或第二副本。
首先需要找到新增节点上的第三副本的前身。如果该第三副 本不处于新增的节点上(可能在第二副本均衡移动时造成的),直接将第三副本转为第二副本。如果第三副本出现在新增节点上,对比最终分布结果,以将第三副本转成期望副本。
然后,将所有节点再对比一遍最终分布,按照最终分布转换对应的分片分布,多余的分片副本设置为第四副本。
下面将描述在数据迁移结束后的稳态分片分布的下发。
直接下发最终分片分布,由CDN发现本地多余的第四副本分片进行删除操作。本算法有可能造成第四分片没有删除干净,但不会影响数据的正确性。
本公开实施例还可以用于减少节点的场景。减少节点场景迁移步骤包括:
步骤1)重新计算CDB迁移完成后的稳态分片分布,该分布中不含有待删除的节点。
步骤2)根据当前运行分片分布与迁移完成分布,下发第一次临时分布并通知CDN节点。
CCC结合当前运行分片分布与迁移完成分布,下发第一次临时分布并通知CDN节点。该分布中继续工作的CDN节点新增第三副本,CDN收到分布后按分片进行在线恢复,CCC检查所有节点状态确认完成。
步骤3)根据当前运行分片分布与迁移完成分布,再次计算CDB临时分片分布并通知CDN节点。
CCC结合当前运行分片分布与迁移完成分布,再次计算CDB临时分片分布并通知到CDN节点。已迁出分片标记为第四副本,第三副本按左右域均衡原则转换为第一副本和第二副本,CDN收到分布进行异步复制保证数据一致性,CCC等待一段时间(例如,20s)后完成。
步骤4)CCC下发迁移完成后的稳态分片分布到CDN,CDN删除第四分片,释放内存。
下面将描述在减少节点场景中涉及的迁移算法。
首先描述在减少节点场景的迁移结束后,获取稳态分片分布 算法。
计算在节点删除后,每个节点上将要分布的第一分片数量。计算待删除节点需移到跨域节点和同域节点上的分片。直接将异域中的第二副本转为第一副本。同域的第一副本直接移动到第一副本数最少的原节点上;
待删除节点上的第二副本需要转移到同域其他节点。从slot1开始检查左右两域。将第二副本补充到同域内第二副本数量较少的节点上,使得两个域内的节点上的副本总数均衡。
下面参考图5a至图5b描述减少节点场景的第一次临时分片分布下发算法。
待删除节点上的数据必须先迁出,才可以删除该节点。因此本算法的目的是获取在未被删除的节点上的在最终分片分布有而当前节点分布中没有的分片。在进行该算法之前,将这些分片设置为第三分片副本进行数据备份。
检查最终分片分布中存在的节点,并找到其对应的当前分布节点。如果某个分片存在于最终分布中而不存在于当前分布节点中,则将该分片增加到当前分布节点中并设置为第三副本。
需要注意的是,同一个分片在经过本算法处理后,可能同时出现两个第三副本,但这两个第三副本位于不同的不会被删除的原节点上。即,一个分片在分布中最多达到四个副本。其中与待删除节点对应的第三分片副本的前身是第一分片副本,与未删除节点对应的第三分片副本的前身是第二分片副本。
下面参考图5a至图5b描述减少节点场景的第二次临时分片分布下发算法。
本算法的目的是在获取备份数据后,将多余的数据从分布中去除,同时将新增的第三副本按期望还原成潜在的第一副本或第二副本。
首先需要找到未删除节点上的第三副本的前身。如果该第三副本不处于新增的节点上(可能在第二副本均衡移动时造成的),直接将第三副本转为第二副本。如果第三副本出现在新节点上, 对比最终分布结果,以将第三副本转成期望副本。
然后,将所有节点再对比一遍最终分布,按照最终分布转换对应的分片分布,多余的分片副本设置为第四副本。
4、下面描述减少节点场景的第二次分布下发算法,包括删除节点,异步复制。
本算法的目的是在获取备份数据后,将多余的数据从分布中去除,同时将新增的第三副本按期望还原成潜在的第一副本或第二副本。
首先将待删除节点的所有分片转第四分片副本。
转换未删除节点的第三副本。可能出现同一个分片的两个第三副本。如果该第三副本的前身是待删除节点,那么将第三副本转第一副本。如果该第三副本的前身是未删除节点,那么将第三副本转第二副本。
转换未删除节点上的副本。如果发现多余副本(可能在第二副本均衡移动时造成的),需要删除第四副本。
下面将描述数据迁移结束后的稳态分片分布的下发。
直接下发最终分片分布,由CDN发现本地多余的第四副本分片进行删除操作。本算法有可能造成第四分片没有删除干净,但不会影响数据的正确性。
综上所述,本公开的实施例具有以下效果:
本公开实施例通过对数据的分布集中管理,结合分片分布的多次计算与复制流程的控制,达到数据分片移动的高效与安全。通过在数据迁移过程中同一数据分片的多个副本之间的相互转换,可以实现实时、高效、安全的迁移数据。根据本公开的实施例,迁移的数据量小,不需要额外资源配合,且不会中断业务。
尽管上文对本公开进行了详细说明,但是本公开不限于此,本技术领域技术人员可以根据本公开的原理进行各种修改。因此,凡按照本公开原理所作的修改,都应当理解为落入本公开的保护范围。

Claims (19)

  1. 一种分布式缓存数据库数据迁移的方法,包括:
    在缓存数据库CDB数据迁移期间,通过CDB控制节点确定CDB数据迁移完成后的稳态数据分片分布;
    所述CDB控制节点根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本;以及
    所述CDB控制节点通知所述迁入节点,使所述迁入节点获取所述第一副本相关的分片数据。
  2. 根据权利要求1所述的方法,其中,若所述CDB控制节点获取新增数据节点,则通过所述CDB控制节点确定CDB数据迁移完成后的稳态数据分片分布的步骤还包括:
    所述CDB控制节点从原有数据节点中选取待迁移的第一副本后,通过确定所述原有数据节点与所述新增数据节点是否是同域数据节点,将迁移前初始分片分布中所述原有数据节点的第一副本调整为所述新增数据节点的第一副本;以及
    所述CDB控制节点在调整所述迁移前初始分片分布中的第一副本后,调整同域内的第二副本,使同域内每个数据节点的第二副本数量均衡。
  3. 根据权利要求2所述的方法,其中,所述通过确定所述原有数据节点与所述新增数据节点是否是同域数据节点,将迁移前初始分片分布中所述原有数据节点的第一副本调整为所述新增数据节点的第一副本的步骤还包括:
    若所述原有数据节点与所述新增数据节点是同域数据节点,则所述CDB控制节点将所述迁移前初始分片分布中所述原有数据节点的第一副本放入所述新增数据节点,并删除所述迁移前初始分片分布中所述原有数据节点的第一副本;以及
    若所述原有数据节点与所述新增数据节点不是同域数据节点,则所述CDB控制节点将迁移前初始分片分布中所述原有数据节点 的第一副本放入所述新增数据节点,并将所述迁移前初始分片分布中所述原有数据节点的第一副本转换为用于备份的第二副本。
  4. 根据权利要求2或3所述的方法,所述CDB控制节点根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本的步骤还包括:
    所述CDB控制节点根据当前运行数据分片分布和所述稳态数据分片分布,确定新增数据节点为迁入节点及需要迁移至所述新增数据节点的第一副本。
  5. 根据权利要求4所述的方法,其中,所述CDB控制节点通知所述迁入节点,使迁入节点获取所述第一副本相关的分片数据的步骤包括:
    所述新增数据节点依次通过在线恢复和异步复制,获取与需要迁入的第一副本相关的分片数据作为第三副本。
  6. 根据权利要求5述的方法,其中,在所述新增数据节点通过异步复制获取与需要迁入的第一副本相关的分片数据期间,所述方法还包括:
    若所述第一副本所在的原有数据节点与所述新增数据节点是同域数据节点,则将所述第一副本转换为迁移后待删除的第四副本,并在迁移完成后删除所述第四副本;以及
    若所述第一副本所在的原有数据节点与所述新增数据节点不是同域数据节点,则将所述第一副本转换为用于备份的第二副本。
  7. 根据权利要求4所述的方法,其中,在所述CDB控制节点确定需要迁移至迁入节点的数据分片第一副本的步骤之后,所述方法还包括:
    所述CDB控制节点按照同域内各数据节点的第二副本数量均衡策略,确定需要迁移至所述新增数据节点的第二副本,并通知所述新增数据节点。
  8. 根据权利要求7所述的方法,其中,在所述迁入节点获取所述第一副本相关的分片数据期间,所述方法还包括:
    所述新增数据节点依次通过在线恢复和异步复制,获取与需要迁入的第二副本相关的分片数据作为第三副本。
  9. 根据权利要求8所述的方法,其中,在所述新增数据节点通过异步复制获取与需要迁入的第二副本相关的分片数据期间,所述方法还包括:
    将所述第二副本转换为迁移后待删除的第四副本,并在迁移完成后删除所述第四副本。
  10. 根据权利要求1所述的方法,其中,若所述CDB控制节点收到需要删除数据节点的通知,则所述CDB控制节点确定CDB数据迁移完成后的稳态数据分片分布的步骤包括:
    所述CDB控制节点计算待删除数据节点删除的后剩余数据节点上需要分布的第一副本的数量,并根据所述剩余数据节点上需要分布的第一副本的数量,将迁移前初始分片分布中所述待删除数据节点的第一副本调整为所述剩余数据节点的第一副本;以及
    所述CDB控制节点在调整所述迁移前初始分片分布中的第一副本后,将所述迁移前初始分片分布中所述待删除数据节点的第二副本转移至同域内的剩余数据节点,并将第二副本补充到同域内第二副本数最少的剩余数据节点上。
  11. 根据权利要求10所述的方法,其中,所述根据所述剩余数据节点上需要分布的第一副本的数量,将迁移前初始分片分布中的所述待删除数据节点的第一副本调整为所述剩余数据节点的第一副本的步骤还包括:
    若所述原有数据节点与所述待删除数据节点是同域节点,则所述CDB控制节点将所述迁移前初始分片分布中的所述待删除数 据节点的第一副本放入第一副本数量最少的剩余数据节点;以及
    若所述原有数据节点与所述待删除数据节点不是同域节点,则所述CDB控制节点将所述迁移前初始分片分布中的所述剩余数据节点的第二副本转换为第一副本,并且,其中
    所述剩余数据节点的第二副本与所述待删除数据节点的第一副本关联。
  12. 根据权利要求10或11所述的方法,其中,所述CDB控制节点根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本的步骤包括:
    所述CDB控制节点根据当前运行数据分片分布和所述稳态数据分片分布,确定剩余数据节点为迁入节点及需要从所述待删除数据节点迁移至所述剩余数据节点的第一副本。
  13. 根据权利要求12所述的方法,其中,CDB控制节点通知所述迁入节点,使所述迁入节点获取所述第一副本相关的分片数据的步骤包括:
    所述剩余数据节点依次通过在线恢复和异步复制,获取与需要迁入的第一副本相关的分片数据作为第三副本。
  14. 根据权利要求13述的方法,其中,在所述剩余数据节点通过异步复制获取与需要迁入的第一副本相关的分片数据期间,所述方法还包括:
    将所述待删除数据节点的第一副本转换为迁移后待删除的第四副本,并在迁移完成后删除所述第四副本;以及
    将所述剩余数据节点的第三副本转换为第一副本。
  15. 根据权利要求12所述的方法,其中,在所述CDB控制节点确定需要迁移至迁入节点的数据分片第一副本的步骤之后,所述方法还包括:
    所述CDB控制节点按照同域内各数据节点的第二副本数量 均衡策略,确定需要迁移至同域内剩余数据节点的第二副本,并通知所述剩余数据节点。
  16. 根据权利要求15所述的方法,其中,在所述迁入节点获取所述第一副本相关的分片数据期间,所述方法还包括:
    所述剩余数据节点依次通过在线恢复和异步复制,获取与需要迁入的第二副本相关的分片数据作为第三副本。
  17. 根据权利要求16所述的方法,其中,在所述剩余数据节点通过异步复制获取与需要迁入的第二副本相关的分片数据期间,所述方法还包括:
    将所述待删除数据节点的第二副本转换为迁移后待删除的第四副本,并在迁移完成后删除所述第四副本;
    将所述剩余数据节点的第三副本转换为第二副本。
  18. 一种分布式缓存数据库数据迁移的系统,包括缓存数据库CDB控制节点、迁入节点、迁出节点,其中
    所述CDB控制节点用于在CDB数据迁移期间,确定CDB数据迁移完成后的稳态数据分片分布,根据所述稳态数据分片分布,确定需要迁移至迁入节点的数据分片第一副本,并通知所述迁入节点;并且
    所述迁入节点用于根据来自所述CDB控制节点的通知,获取所述第一副本相关的分片数据。
  19. 一种计算机存储介质,存储有计算机可执行程序,其中,当所述计算机可执行程序在处理器上运行时,执行根据权利要求1至17中任一项所述的方法。
PCT/CN2018/081535 2017-05-04 2018-04-02 一种分布式缓存数据库数据迁移的方法及系统 WO2018201832A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710306691.1A CN108804465B (zh) 2017-05-04 2017-05-04 一种分布式缓存数据库数据迁移的方法及系统
CN201710306691.1 2017-05-04

Publications (1)

Publication Number Publication Date
WO2018201832A1 true WO2018201832A1 (zh) 2018-11-08

Family

ID=64016910

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/081535 WO2018201832A1 (zh) 2017-05-04 2018-04-02 一种分布式缓存数据库数据迁移的方法及系统

Country Status (2)

Country Link
CN (1) CN108804465B (zh)
WO (1) WO2018201832A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710679A (zh) * 2018-12-28 2019-05-03 北京旷视科技有限公司 数据抽取方法及装置
CN114143323A (zh) * 2021-11-30 2022-03-04 中原银行股份有限公司 企业级微服务平台跨区域容灾架构及方法

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871388A (zh) * 2019-02-19 2019-06-11 北京字节跳动网络技术有限公司 数据缓存方法、装置、终电子设备及存储介质
CN110309184B (zh) * 2019-07-10 2021-05-25 中国民航信息网络股份有限公司 一种航空运价数据的缓存方法及系统
CN110457167A (zh) * 2019-08-20 2019-11-15 北京博睿宏远数据科技股份有限公司 副本处理方法、装置、设备和介质
CN111143324B (zh) * 2019-12-20 2023-05-02 浪潮软件股份有限公司 一种kudu的基于大小的数据库数据均衡系统及实现方法
CN113596153A (zh) * 2021-07-28 2021-11-02 新华智云科技有限公司 一种数据均衡方法及系统
CN113590586B (zh) * 2021-07-29 2022-03-22 东方微银科技股份有限公司 分布式图数据库系统节点间迁移分片数据的方法、装置
CN117290440B (zh) * 2023-09-12 2024-05-07 上海沄熹科技有限公司 一种数据库分片复制过程中聚合分裂的处理方法及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457835B2 (en) * 2005-03-08 2008-11-25 Cisco Technology, Inc. Movement of data in a distributed database system to a storage location closest to a center of activity for the data
CN103294787A (zh) * 2013-05-21 2013-09-11 成都市欧冠信息技术有限责任公司 分布式数据库系统的多副本存储方法和系统
CN106096038A (zh) * 2016-06-28 2016-11-09 浪潮软件股份有限公司 一种云计算架构下的分布式数据库架构

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101909068A (zh) * 2009-06-02 2010-12-08 华为技术有限公司 一种文件副本管理方法及装置、系统
KR101544356B1 (ko) * 2012-10-31 2015-08-13 삼성에스디에스 주식회사 메타데이터 및 트랜잭션 발생량을 고려한 동적 샤딩 기능을 지원하는 분산 데이터베이스 관리 방법 및 그 구성 노드
US9021296B1 (en) * 2013-10-18 2015-04-28 Hitachi Data Systems Engineering UK Limited Independent data integrity and redundancy recovery in a storage system
US9569108B2 (en) * 2014-05-06 2017-02-14 International Business Machines Corporation Dataset replica migration
CN104657459B (zh) * 2015-02-09 2018-02-16 中国科学院信息工程研究所 一种基于文件粒度的海量数据存储方法
CN106843745A (zh) * 2015-12-03 2017-06-13 南京中兴新软件有限责任公司 容量扩展方法及装置
CN106528793B (zh) * 2016-12-14 2019-12-24 自然资源部国土卫星遥感应用中心 一种分布式空间数据库的时空分片存储方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457835B2 (en) * 2005-03-08 2008-11-25 Cisco Technology, Inc. Movement of data in a distributed database system to a storage location closest to a center of activity for the data
CN103294787A (zh) * 2013-05-21 2013-09-11 成都市欧冠信息技术有限责任公司 分布式数据库系统的多副本存储方法和系统
CN106096038A (zh) * 2016-06-28 2016-11-09 浪潮软件股份有限公司 一种云计算架构下的分布式数据库架构

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710679A (zh) * 2018-12-28 2019-05-03 北京旷视科技有限公司 数据抽取方法及装置
CN114143323A (zh) * 2021-11-30 2022-03-04 中原银行股份有限公司 企业级微服务平台跨区域容灾架构及方法

Also Published As

Publication number Publication date
CN108804465B (zh) 2023-06-30
CN108804465A (zh) 2018-11-13

Similar Documents

Publication Publication Date Title
WO2018201832A1 (zh) 一种分布式缓存数据库数据迁移的方法及系统
US11816063B2 (en) Automatic archiving of data store log data
US10019294B2 (en) Method of achieving intra-machine workload balance for distributed graph-processing systems
US10169163B2 (en) Managing backup operations from a client system to a primary server and secondary server
US11513708B2 (en) Optimized deduplication based on backup frequency in a distributed data storage system
EP2784675B1 (en) Method, device and system for data reconstruction
WO2017097059A1 (zh) 分布式数据库系统及其自适应方法
AU2016405587B2 (en) Splitting and moving ranges in a distributed system
CN107085539B (zh) 一种云数据库系统以及云数据库资源动态调整方法
WO2016197994A1 (zh) 容量扩展方法及装置
EP3575968A1 (en) Method and device for synchronizing active transaction lists
CN112470112A (zh) 块存储系统的分布式副本
WO2018014650A1 (zh) 分布式数据库数据同步方法、相关装置及系统
CN107018185B (zh) 云存储系统的同步方法和装置
CN113010496B (zh) 一种数据迁移方法、装置、设备和存储介质
US10862736B2 (en) Object counts persistence for object stores
JP2014041550A (ja) データ移行処理システムおよびデータ移行処理方法
US8312237B2 (en) Automated relocation of in-use multi-site protected data storage
CN111459913B (zh) 分布式数据库的容量扩展方法、装置及电子设备
US11194501B2 (en) Standby copies withstand cascading fails
CN104468674B (zh) 数据迁移方法及装置
KR101748912B1 (ko) 분산 저장 환경에서 데이터 저장 시스템 및 데이터 저장 시스템이 포함하는 클러스터의 업그레이드, 확장 및 축소를 위한 클러스터 관리 방법
JP7491545B2 (ja) 情報処理方法
KR20130026738A (ko) 파일 데이터 분산 저장 장치 및 방법
JP5845298B2 (ja) ノードおよびプログラム

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

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

Country of ref document: EP

Kind code of ref document: A1