WO2016192496A1 - 数据迁移处理方法及装置 - Google Patents

数据迁移处理方法及装置 Download PDF

Info

Publication number
WO2016192496A1
WO2016192496A1 PCT/CN2016/080493 CN2016080493W WO2016192496A1 WO 2016192496 A1 WO2016192496 A1 WO 2016192496A1 CN 2016080493 W CN2016080493 W CN 2016080493W WO 2016192496 A1 WO2016192496 A1 WO 2016192496A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
node
module
database
information
Prior art date
Application number
PCT/CN2016/080493
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 WO2016192496A1 publication Critical patent/WO2016192496A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • the present invention relates to the field of communications, and in particular to a data migration processing method and apparatus.
  • the data and tables of the distributed database system are distributed on each node.
  • the data can be distributed on different nodes according to different tables, or the data of one table can be distributed to different nodes according to the column attributes of the table. on.
  • the amount of system data storage increases, when the original node cannot be stored, the storage of the system needs to be expanded, and the data stored in one node is redistributed to two or more nodes.
  • different node storages are unbalanced. In order to improve system performance, data needs to be migrated between nodes.
  • OTP On-Line Transaction Processing
  • the embodiment of the invention provides a data migration processing method and device, so as to solve at least the problem that the database read/write operation needs to be stopped in the process of data migration and expansion in the related art.
  • a data migration processing method including: receiving a data migration request message for migrating specified data from a first node to a second node; and recording current data operation change information for the specified data. And in the process of migrating the specified data from the first node to the second node, performing operation processing on the specified data according to the data operation change information.
  • the method further includes: after migrating the specified data from the first node to the second node, performing operation processing on the specified data again in the second node according to the data operation change information; The data in the first node and the data in the second node are subjected to an operation change process.
  • the node corresponding to the specified data is updated by the first node to the second node.
  • the method further includes: performing an operation change process on the data in the first node and the data in the second node.
  • the method further includes deleting the specified data from the first node after migrating the specified data from the first node to the second node.
  • the data operation change information includes at least one of the following information: updating the information of the specified data, modifying the information of the specified data, deleting the information of the specified data, and adding data.
  • a data migration processing apparatus comprising: a receiving module configured to receive a data migration request message for migrating specified data from a first node to a second node; and a recording module And configured to record data operation change information currently corresponding to the specified data; the first processing module is configured to, in the process of migrating the specified data from the first node to the second node, change the information according to the data operation Specify data for operation processing.
  • the apparatus further includes: a second processing module, configured to, after the migrating the specified data from the first node to the second node, perform the designation on the second node again according to the data operation change information The data is subjected to operation processing; the stop module is configured to stop performing operation change processing on the data in the first node and the data in the second node.
  • a second processing module configured to, after the migrating the specified data from the first node to the second node, perform the designation on the second node again according to the data operation change information The data is subjected to operation processing
  • the stop module is configured to stop performing operation change processing on the data in the first node and the data in the second node.
  • the foregoing apparatus further includes: an updating module, configured to update the node corresponding to the specified data from the first node to the second node.
  • the apparatus further includes: a continuation module, configured to continue to perform an operation change process on the data in the first node and the data in the second node.
  • a continuation module configured to continue to perform an operation change process on the data in the first node and the data in the second node.
  • the apparatus further includes: a deleting module, configured to delete the specified data from the first node after migrating the specified data from the first node to the second node.
  • a deleting module configured to delete the specified data from the first node after migrating the specified data from the first node to the second node.
  • the data operation change information includes at least one of the following information: updating the information of the specified data, modifying the information of the specified data, deleting the information of the specified data, and adding data.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the data migration processing method in the foregoing embodiment.
  • a data migration request message for receiving the designated data from the first node to the second node is received; the current data operation change information for the specified data is recorded; and the designated data is migrated from the first node to the second node.
  • the specified data is processed according to the data operation change information.
  • FIG. 1 is a flowchart of a data migration processing method according to an embodiment of the present invention.
  • FIG. 2 is a structural block diagram of a data migration processing apparatus according to an embodiment of the present invention.
  • FIG. 3 is a structural block diagram (1) of a data migration processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a structural block diagram (2) of a data migration processing apparatus according to an embodiment of the present invention.
  • FIG. 5 is a structural block diagram (3) of a data migration processing apparatus according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram (4) of a data migration processing apparatus according to an embodiment of the present invention.
  • FIG. 7 is a system structural diagram of data migration according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of data export and import processing of a data migration module according to a data migration request submitted by a client according to an embodiment of the present invention
  • FIG. 9 is a flowchart of monitoring processing of a monitoring module DBMonitor in a data migration process according to an embodiment of the present invention.
  • FIG. 10 is a flowchart of monitoring processing of a routing module in a data migration process according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a data migration processing method according to an embodiment of the present invention. As shown in FIG. 1, the flow includes the following steps:
  • Step S102 receiving a data migration request message for migrating specified data from the first node to the second node;
  • Step S104 recording current data operation change information for the specified data
  • Step S106 in the process of migrating the designated data from the first node to the second node, performing operation processing on the designated data according to the data operation change information.
  • the data operation change information for operating the specified data in the first node is recorded, and in the process of migrating the designated data from the first node to the second node, the specified data is still processed according to the data operation change information.
  • the system needs to stop the reading and writing operation of the database, resulting in a certain time consumption.
  • the above steps solve the need to stop the data migration and expansion process in the related technology.
  • the problem of database read and write operations reduces the time window during which the database node stops servicing during data migration.
  • the specified data is processed again in the second node according to the data operation change information, and the re-operation of the specified data is completed. After the processing, the operation change processing of the data in the first node and the data in the second node is stopped.
  • the metadata information is updated.
  • the node corresponding to the designated data is used by the first node. Update to the second node. In order to send the database operation statement to the corresponding database node according to the new metadata information.
  • the operation change processing is continued on the data in the first node and the data in the second node.
  • the specified data is deleted from the first node after migrating the designated data from the first node to the second node.
  • the above data operation change information may contain a variety of information, which will be exemplified below.
  • the data operation change information may include: updating information of the specified data, modifying information of the specified data, deleting information of the specified data, and adding data.
  • a data migration processing device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again.
  • the term “module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • the apparatus includes: a receiving module 22 configured to receive a data migration request for migrating specified data from a first node to a second node. a message; the recording module 24 is configured to record data operation change information currently for the specified data; the first processing module 26 is configured to operate the change information according to the data in the process of migrating the designated data from the first node to the second node Operate the specified data.
  • FIG. 3 is a structural block diagram (1) of a data migration processing apparatus according to an embodiment of the present invention.
  • the apparatus further includes: a second processing module 32 configured to migrate specified data from the first node to the first node. After the two nodes, the designated data is processed again in the second node according to the data operation change information; the stop module 34 is configured to stop the operation change processing on the data in the first node and the data in the second node.
  • FIG. 4 is a structural block diagram (2) of a data migration processing apparatus according to an embodiment of the present invention. As shown in FIG. 4, the apparatus further includes: an update module 44, configured to update a node corresponding to the specified data from the first node to the first node. Two nodes.
  • FIG. 5 is a structural block diagram (3) of a data migration processing apparatus according to an embodiment of the present invention. As shown in FIG. 5, the apparatus further includes: a continuation module 52, configured to continue to data in the first node and in the second node. The data is processed for operation change.
  • a continuation module 52 configured to continue to data in the first node and in the second node. The data is processed for operation change.
  • FIG. 6 is a structural block diagram (4) of a data migration processing apparatus according to an embodiment of the present invention. As shown in FIG. 6, the apparatus further includes: a deletion module 62 configured to migrate specified data from the first node to the second node. After that, the specified data is deleted from the first node.
  • a deletion module 62 configured to migrate specified data from the first node to the second node. After that, the specified data is deleted from the first node.
  • the data operation change information includes information of at least one of: updating information of the specified data, modifying information of the designated data, deleting information of the designated data, and adding data.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the above modules are respectively located.
  • the first processor, the second processor, and the third processor In the first processor, the second processor, and the third processor.
  • This alternative embodiment proposes a method and system for data migration, expansion, and redistribution of distributed databases.
  • the method monitors the data operation at the node while data migration and expansion, and saves the data that needs to be written in the new node according to the data distribution to the exported data, so that during the data export process, There is no need to stop reading and writing to the database.
  • the database is stopped and read, and the update of the system metadata information and the cleaning of the original node data are completed.
  • data is imported from the original node to the new node, which greatly reduces the time for the system to stop service, improves system performance, and improves usability.
  • the data migration server after receiving the data migration request, notifies the monitoring database monitoring tool (Data Base Monitor, DBMonitor) of the original database node to start monitoring all data operation changes on the original database.
  • the data migration server starts to logically operate the original database node and export the data to the migration server for storage.
  • Database monitoring DBMonitor monitors all data operations. If the data of the original database operation belongs to the new database node according to the migration rules, DBMonitor records the data operation to the DBMonitor monitoring file.
  • the data migration server After the data export is completed, the data migration server starts importing the data stored on the migration server to the destination database node.
  • DBMonitor plays back the data operations recorded in the monitoring file on the new database node.
  • the migration server notifies the routing server to stop the read and write operations of the original database related table, and updates the data distribution metadata information stored on the original database node.
  • the migration server notifies the routing server to perform routing of the data operation request according to the new data distribution information, and restores the read and write operations of the original database node.
  • the migration server starts to clean up the garbage data of the original database node. When all the data is cleaned up, the data is migrated at the original database node and the new database node, and the metadata information on the metadata server is updated, and the data migration operation is completed.
  • the data migration module receives the data migration request from the client.
  • the data migration module notifies the monitoring DBMonitor of the original database node to start monitoring all data operations of the original database node, including data update, modification, addition, deletion, and the like.
  • DBMonitor follows the new routing rules. If the data of the operation should occur on the new database node, DBMonitor logs the data operation to the monitoring file of DBMonitor.
  • the data migration module After the data migration module exports the data of the original database node, the data migration module stops reading the original database node and starts importing the data to the new database node. At this point DBMonitor continues to monitor the data operations of the original database node.
  • the data migration module After all the data on the data migration module has been imported, the data migration module notifies DBMonitor to play back the data on the new database node.
  • the so-called playback data also the data change operation performed on the original database before the new data
  • the library node executes once.
  • DBMonitor After receiving the playback request, DBMonitor starts to operate the data operations recorded in the monitoring file one by one on the new data node, including data, modification, addition, and deletion of the new database node.
  • DBMonitor still monitors the operation of the original database node during playback. After all the data of DBMoitor is played back, DBMonitor notifies the data migration module that the data has been played back.
  • DBMonitor After the data migration receives the playback completion message of DBMonitor, DBMonitor notifies the routing module to stop the reading and writing operations of the related data tables of the original database and the new database node.
  • the data migration module notifies the metabase server to update the metadata information in accordance with the new data distribution information.
  • the data migration module After the metadata information is updated, the data migration module notifies the routing server to restore the read and write operations of the original database.
  • the data migration module begins to clean up the junk data of the original database node.
  • the client After the data migration module completes the garbage data cleanup of the database node, the client is notified to complete the data migration operation.
  • FIG. 7 is a structural diagram of a system for data migration according to an embodiment of the present invention.
  • FIG. 7 is a structural diagram of a system according to an embodiment of the present invention.
  • the system structure mainly includes: a client 101, a routing module 102 (executing the function of the stopping module 34 described above), a metadata caching module 103, and a data migration module 104 (the receiving module 22, the first processing module 26, and the second processing are executed).
  • the function of module 32), the stand-alone database 105 of the distributed database cluster, and the database operation monitoring module 106 (the functions of the above-described recording module 24 are performed).
  • Client 101 A client module that submits a Structured Query Language (SQL) statement through the client 101 (including a computer, a mobile phone, a browser, etc.).
  • SQL Structured Query Language
  • the routing module 102 the routing module is to execute the SQL statement issued by the execution module, and select an appropriate database connection to send the SQL statement to execute.
  • the routing module handles the SQL statement for the distributed SQL statement. For example, in the data migration phase, the routing module needs to process the SQL statement into the SQL carrying the routing information, and the routing information is added if the addition, deletion, and modification are performed.
  • the metadata cache module 103 a metadata cache module, configured as a cache of metadata, including table definition information, distributed information of each node of the distributed database.
  • the metadata caching module can perform metadata update and query operations. When the system metadata information changes, the information saved by the metadata cache module is updated synchronously. At the same time, the metadata cache module receives the query operation of other modules and returns the metadata information.
  • the data migration module 104 is configured as a data migration module, and is configured to perform data migration, including data import and export, system expansion, and data redistribution.
  • the data migration module receives the files exported by the database node and imports the exported files into the new database node.
  • the data migration module stores the exported intermediate files as files.
  • Stand-alone database 105 of a distributed database cluster A stand-alone database of a distributed database cluster that receives and executes the database language of a distributed database cluster.
  • the database language includes data definition language, data manipulation language, and data query. Query language, data control language, transaction control language, etc.
  • the database operation monitoring module 106 the database operation monitoring module DBMonitor, used to monitor the status of each database of the distributed database cluster, he will record all the language of the database data in the database to the log file, such as insert, update, delete, etc. .
  • DBMonitor records changes to all records and logs the modified records for each row of data to a log file.
  • the database language is not included in the log file. For query statements, etc., data changes are not involved and are not recorded in the log file.
  • FIG. 8 is a flowchart of data export and import processing of a data migration module according to a data migration request submitted by a client according to an embodiment of the present invention.
  • the data migration module After receiving the data migration request, the data migration module starts to notify DBMonitor to monitor the data operation on the original database node, and then starts to export the data to the file, and then imports the exported file into the new database node.
  • the data operation log monitored by DBMonitor is executed again at the destination database node.
  • the routing module is notified to stop the read and write operations of the related tables of the metabase, and the metadata information is updated.
  • the data migration module After the update is complete, the data migration module notifies the routing module to restore the read and write operations of the original database related table, and begins to clean up the garbage data of the original database node. After the garbage data is cleaned up, the data migration module notifies the customer that the data migration is completed, and returns the operation result to the client. As shown in FIG. 8, the process specifically includes the following steps:
  • Step S801 The data migration module receives the data migration request sent by the client.
  • Step S802 After receiving the data migration request of the client, the data migration module notifies the DBMonitor to monitor the data operation.
  • DBMonitor monitoring database operations Detailed information on DBMonitor monitoring database operations is shown in Figure 9.
  • Step S803 The data migration module starts to export the data of the original database to the file.
  • Step S804 It is determined whether the data of the original database node is exported. If not, the export is continued, and step S803 is repeated; otherwise, the process proceeds to step S805.
  • Step S805 The data migration module imports the exported file to a new database node.
  • Step S806 The data migration module determines whether the file is imported. If the data is not imported, step S805 is repeated; otherwise, the process proceeds to step S807.
  • Step S807 The data migration module notifies the DBMonitor to play back the data in the log file to the destination database node.
  • the so-called playback data that is, the data change operation performed on the original database recorded in the log file is executed once again in the new database node. It should be noted that during playback, DBMonitor still needs to monitor the data operations of the original database.
  • Step S808 The data migration module determines whether the DBMonitor log file is played back. If the playback is not completed, the process continues to step S807, otherwise proceeds to step S809.
  • Step S809 After the data migration module obtains the data file import, and the DBMonitor monitoring log file has also been played back, the data migration module notifies the routing module to stop the read and write operations of the related database table.
  • the read and write control of the original database node can be controlled by reading and writing permissions on the granularity of the table and the library. Such as a large table, the data needs to be split according to the distribution key and part of the data is migrated to the new database, then the routing module needs to stop the original data. Read and write operations on library nodes and new database node related tables.
  • Step S810 The data migration module notifies the metadata cache module to update the metadata information. After the data migration, the storage node information of the data will be changed, and the metadata information needs to update the distribution information of the table.
  • the routing module When receiving the database operation request, the routing module will query the metadata cache information. If the operation of the original database related table is involved, then the database operation request should be routed to the new database node operation according to the distribution information of the new table. .
  • Step S811 After completing the metadata update, the data migration module notifies the routing module to restore the operation authority of the related database node.
  • Step S812 The data migration module starts to clean the garbage data of the original database node, wherein when cleaning the garbage data of the original database node, the routing module needs to control the SQL statement sent to the original database node, and the specific process is shown in FIG.
  • Step S813 It is determined whether the garbage data is cleaned up. If the cleaning is not completed, the process proceeds to step S812 to continue to clean the garbage data; if the garbage data is cleaned, the process proceeds to step S814.
  • Step S814 Notifying the client that the garbage data is cleaned up and completing the data migration work.
  • the data migration module notifies the routing module to stop monitoring the operation statement of the related table of the original database node.
  • FIG. 9 is a flowchart of monitoring processing of a monitoring module DBMonitor in a data migration process according to an embodiment of the present invention. As shown in Figure 3, it is a flowchart of the monitoring process of the monitoring module DBMonitor during the data migration process. The specific steps are as follows:
  • Step S901 The monitoring module DBMonitor starts monitoring data operations of the original database node. He will record all the languages that modify the database data in the database to the log file, such as insert, update, delete, and so on. DBMonitor records changes to all records and logs the modified records for each row of data to a log file. The database language is not included in the log file. For query statements, etc., data changes are not involved and are not recorded in the log file.
  • step S902 the DBMonitor determines the monitored data operation and determines whether the database language operation needs to be performed at the new database node. If not, the process proceeds to step S904, otherwise to step S903.
  • step S903 the data record of the database language operation is saved in the log file.
  • the content recorded in the log file contains the type of database operation and the data before and after the operation.
  • the record operation type is insert, and the inserted data is recorded;
  • the record operation type is update, and the data before and after the update is recorded.
  • operations involving data changes record the type of operation and record the data. There is no need to log to the monitoring log file for operations that do not involve data changes, and for changes that do not involve new database node related tables.
  • step S904 it is determined whether to stop the monitoring data operation, if not, the monitoring is continued, and the process proceeds to step S901; otherwise, the data operation monitoring is completed.
  • FIG. 10 is a flowchart of monitoring processing of a routing module in a data migration process according to an embodiment of the present invention
  • FIG. 10 is a flowchart of monitoring processing of a routing module in a data migration process.
  • the routing module is straight before the data metadata is changed.
  • send the database operation statement to the corresponding database node according to the original metadata information.
  • the database operation statement needs to be sent to the corresponding database node according to the new metadata information.
  • the original database node still needs to receive read and write operations during data migration. Therefore, the original database node retains all the data that the new database node needs to migrate, as well as the data written during the migration process.
  • the data of the original database node needs to be cleaned up.
  • the original database operation language needs to be processed.
  • the flowchart of FIG. 10 describes the specific process. Proceed as follows:
  • step S1001 the routing module receives the database operation language.
  • the routing module reads its metadata information according to the table involved in the database operation language.
  • the metadata information includes the distribution of the table, such as determining that the data falls on the corresponding database node according to the range of the primary key.
  • Step S1003 The routing module determines, according to the read metadata information, whether the database operation involves migration data. If the migrated data is not involved, the process proceeds to step S1005; otherwise, the process proceeds to step S1004.
  • step S1004 if the database operation data involves new migration data, then the SQL statement needs to be processed, and the database statement is modified to be executed only within the data range of the original database.
  • the updated data range contains data for both the old and new database nodes.
  • the routing module will route the operation of the new database node to its database node, and the original database node will be routed to the original database node for execution.
  • the original database node contains garbage data that has not been cleaned up, the operation of routing to the original database node may operate part of the garbage data. Therefore, the data range of this operation needs to be limited to the range that the original database node should have after the data migration.
  • step S1005 the routing module delivers the database operation statement to the database for execution.
  • step S1006 the routing module determines whether the data cleaning is completed. If not, the process proceeds to step S1001 to continue monitoring, otherwise the routing of the database operating language is terminated.
  • the migration server simultaneously monitors new data read and write operations during data migration, and records data operations to be performed on the new node. Wait until the data operation is completed, and notify the routing module to stop the read and write operations of the original database node when updating the metadata information.
  • the routing module In the process of data import and export, it is not necessary to stop the read and write operations of the original database node, and stop reading and writing operations only when updating the metabase information. In this way, the system does not affect the normal read and write operations of the system during data migration, thereby realizing smooth and linear expansion of the distributed database system, improving system performance and improving usability.
  • the embodiments of the present invention are applicable to applications where a distributed relational database needs to perform logical migration operations of data, such as data migration, data backup, and database expansion.
  • a storage medium is further provided, wherein the software includes the above-mentioned software, including but not limited to: an optical disk, a floppy disk, a hard disk, an erasable memory, and the like.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • a data migration request message for receiving the designated data from the first node to the second node is received; the current data operation change information for the specified data is recorded; and the designated data is migrated from the first node to the second node.
  • the specified data is processed according to the data operation change information.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供了一种数据迁移处理方法及装置,其中,该方法包括:接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;记录当前对指定数据的数据操作变更信息;在将指定数据从第一节点迁移至第二节点的过程中,根据数据操作变更信息对指定数据进行操作处理。通过本发明实施例解决了相关技术中在数据迁移和扩容的过程中需要停止数据库的读写操作的问题,降低了数据迁移过程中,数据库节点停止服务的时间窗口。

Description

数据迁移处理方法及装置 技术领域
本发明涉及通信领域,具体而言,涉及一种数据迁移处理方法及装置。
背景技术
分布式数据库系统的数据和表分布在各个节点上,按照系统的数据分布规则,数据可以按照不同的表分布在不同的节点上,也可以是一个表的数据根据表的列属性分布在不同节点上。当系统数据存储量增加时,原先的节点已经无法存储时,需要对系统的存储进行扩容,将存储在一个节点的数据重新分布到两个或者多个节点上。另外一种情况是系统运行一段时间后,不同的节点存储出现不均衡的情况,为了提升系统性能,需要将数据在节点间进行迁移。
不同于面向联机分析处理(Online Analytical Processing,简称为OLAP)系统,面向联机事务处理(On-Line Transaction Processing,简称为OLTP)系统往往会同时对数据进行读、写、更新操作,而OLAP系统往往都是一次性写后多次读取。因此分布式数据库系统在数据迁移和扩容的过程中必须考虑对系统当前的读写操作的影响。数据在迁移和扩容的过程中,往往需要耗费一定时间,在这段时间内系统需要停止数据库的读写操作,或者限制对数据库的操作,这势必影响了业务的运行。
针对相关技术中,在数据迁移和扩容的过程中需要停止数据库的读写操作的问题,还未提出有效的解决方案。
发明内容
本发明实施例提供了一种数据迁移处理方法及装置,以至少解决相关技术中在数据迁移和扩容的过程中需要停止数据库的读写操作的问题。
根据本发明实施例的一个方面,提供了一种数据迁移处理方法,包括:接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;记录当前对上述指定数据的数据操作变更信息;在将上述指定数据从上述第一节点迁移至上述第二节点的过程中,根据上述数据操作变更信息对上述指定数据进行操作处理。
可选地,上述方法还包括:在将上述指定数据从上述第一节点迁移至上述第二节点之后,根据上述数据操作变更信息在上述第二节点中再次对上述指定数据进行操作处理;停止对上述第一节点中的数据和上述第二节点中的数据进行操作变更处理。
可选地,停止对上述第一节点中的数据和上述第二节点中的数据进行操作变更处理之后包括:将上述指定数据对应的节点由上述第一节点更新为上述第二节点。
可选地,将上述指定数据对应的节点由上述第一节点更新为上述第二节点之后包括:继续对上述第一节点中的数据和上述第二节点中的数据进行操作变更处理。
可选地,上述方法还包括:在将上述指定数据从上述第一节点迁移至上述第二节点之后,将上述指定数据从上述第一节点中删除。
可选地,上述数据操作变更信息包括以下至少之一的信息:更新上述指定数据的信息、修改上述指定数据的信息、删除上述指定数据的信息、增加数据。
根据本发明实施例的另一个方面,还提供了一种数据迁移处理装置,上述装置包括:接收模块,设置为接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;记录模块,设置为记录当前对上述指定数据的数据操作变更信息;第一处理模块,设置为在将上述指定数据从上述第一节点迁移至上述第二节点的过程中,根据上述数据操作变更信息对上述指定数据进行操作处理。
可选地,上述装置还包括:第二处理模块,设置为在将上述指定数据从上述第一节点迁移至上述第二节点之后,根据上述数据操作变更信息在上述第二节点中再次对上述指定数据进行操作处理;停止模块,设置为停止对上述第一节点中的数据和上述第二节点中的数据进行操作变更处理。
可选地,上述装置还包括:更新模块,设置为将上述指定数据对应的节点由上述第一节点更新为上述第二节点。
可选地,上述装置还包括:继续模块,设置为继续对上述第一节点中的数据和上述第二节点中的数据进行操作变更处理。
可选地,上述装置还包括:删除模块,设置为在将上述指定数据从上述第一节点迁移至上述第二节点之后,将上述指定数据从上述第一节点中删除。
可选地,上述数据操作变更信息包括以下至少之一的信息:更新上述指定数据的信息、修改上述指定数据的信息、删除上述指定数据的信息、增加数据。
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的数据迁移处理方法。
通过本发明实施例,采用接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;记录当前对指定数据的数据操作变更信息;在将指定数据从第一节点迁移至第二节点的过程中,根据数据操作变更信息对指定数据进行操作处理。解决了相关技术中在数据迁移和扩容的过程中需要停止数据库的读写操作的问题,降低了数据迁移过程中,数据库节点停止服务的时间窗口。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示 意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的数据迁移处理方法的流程图;
图2是根据本发明实施例的数据迁移处理装置的结构框图;
图3是根据本发明实施例的数据迁移处理装置的结构框图(一);
图4是根据本发明实施例的数据迁移处理装置的结构框图(二);
图5是根据本发明实施例的数据迁移处理装置的结构框图(三);
图6是根据本发明实施例的数据迁移处理装置的结构框图(四);
图7是根据本发明实施例的数据迁移的系统结构图;
图8是根据本发明实施例的数据迁移模块根据客户端提交的数据迁移请求的数据导出导入处理流程图;
图9是根据本发明实施例的监控模块DBMonitor在数据迁移过程中的监控处理的流程图;
图10是根据本发明实施例的路由模块在数据迁移过程中的监控处理的流程图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
在本实施例中提供了一种数据迁移处理方法,图1是根据本发明实施例的数据迁移处理方法的流程图,如图1所示,该流程包括如下步骤:
步骤S102,接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;
步骤S104,记录当前对指定数据的数据操作变更信息;
步骤S106,在将指定数据从第一节点迁移至第二节点的过程中,根据上述数据操作变更信息对指定数据进行操作处理。
通过上述步骤,记录第一节点中对指定数据进行操作的数据操作变更信息,在将指定数据从第一节点迁移至第二节点的过程中,依然根据上述数据操作变更信息对指定数据进行操作处理,相比于相关技术中,数据在迁移和扩容的过程中,系统需要停止数据库的读写操作,导致的一定时间的耗费,上述步骤解决了相关技术中在数据迁移和扩容的过程中需要停止数据库的读写操作的问题,降低了数据迁移过程中,数据库节点停止服务的时间窗口。
在将指定数据从第一节点迁移至第二节点之后,在一个可选实施例中,根据上述数据操作变更信息在第二节点中再次对指定数据进行操作处理,在完成对指定数据的再次操作处理之后,停止对第一节点中的数据和第二节点中的数据进行操作变更处理。以便于在指定数据 从第一节点迁移至第二节点之后,对元数据信息进行更新。
对元数据信息进行更新的过程中,在一个可选实施例中,在停止对第一节点中的数据和第二节点中的数据进行操作变更处理之后,将指定数据对应的节点由第一节点更新为第二节点。以便于按照新的元数据信息将数据库操作语句发送至对应的数据库节点执行。
在一个可选实施例中,将指定数据对应的节点由第一节点更新为第二节点之后,继续对第一节点中的数据和第二节点中的数据进行操作变更处理。
对元数据信息进行更新的过程中,在另一个可选实施例中,在将指定数据从第一节点迁移至第二节点之后,将指定数据从第一节点中删除。
上述数据操作变更信息可以包含多种信息,下面对此进行举例说明。在一个可选实施例中,上述数据操作变更信息可以包括:更新该指定数据的信息、修改该指定数据的信息、删除该指定数据的信息、增加数据。
在本实施例中还提供了一种数据迁移处理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图2是根据本发明实施例的数据迁移处理装置的结构框图,如图2所示,该装置包括:接收模块22,设置为接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;记录模块24,设置为记录当前对指定数据的数据操作变更信息;第一处理模块26,设置为在将指定数据从第一节点迁移至第二节点的过程中,根据该数据操作变更信息对指定数据进行操作处理。
图3是根据本发明实施例的数据迁移处理装置的结构框图(一),如图3所示,该装置还包括:第二处理模块32,设置为在将指定数据从第一节点迁移至第二节点之后,根据该数据操作变更信息在第二节点中再次对指定数据进行操作处理;停止模块34,设置为停止对第一节点中的数据和第二节点中的数据进行操作变更处理。
图4是根据本发明实施例的数据迁移处理装置的结构框图(二),如图4所示,该装置还包括:更新模块44,设置为将指定数据对应的节点由第一节点更新为第二节点。
图5是根据本发明实施例的数据迁移处理装置的结构框图(三),如图5所示,该装置还包括:继续模块52,设置为继续对第一节点中的数据和第二节点中的数据进行操作变更处理。
图6是根据本发明实施例的数据迁移处理装置的结构框图(四),如图6所示,该装置还包括:删除模块62,设置为在将指定数据从第一节点迁移至第二节点之后,将指定数据从第一节点中删除。
可选地,上述数据操作变更信息包括以下至少之一的信息:更新该指定数据的信息、修改该指定数据的信息、删除该指定数据的信息、增加数据。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述各个模块均位于同一处理器中;或者,上述各个模块分别位于第一处理器、第二处理器和第三处理器…中。
针对相关技术中存在的上述问题,下面结合具体的可选实施例进行说明。
本可选实施例提出了一种分布式数据库数据迁移、扩容和重分布的方法和系统。该方法在数据迁移和扩容的同时,监控在此节点的数据操作,并将按照数据分布更新后需要在新节点写入的数据也一同保存到导出的数据中,使得在数据导出的过程中,不需要停止对数据库的读写操作。在数据在新的节点导入后,这时停止数据库的读写,完成系统元数据信息的更新和原节点数据的清理。通过此系统和方法使得数据在从原节点导入到新节点的过程中,大大减少系统停止服务的时间,提升系统性能,改善可用性。
在本可选实施例中,数据迁移服务器接收到数据迁移请求后,通知原数据库节点的监控数据库监控工具(Data Base Monitor,简称为DBMonitor)开始监控所有在原数据库上的数据操作变更。同时数据迁移服务器开始将原数据库节点按照逻辑操作,将数据导出到迁移服务器上存储。数据库的监控DBMonitor监控会所有的数据操作,如果原数据库操作的数据按照迁移规则属于新的数据库节点,那么DBMonitor将数据操作记录到DBMonitor监控文件中。数据迁移服务器在数据导出完成后,开始将存储在迁移服务器上的数据导入到目的数据库节点。当迁移服务器上存储的数据全部导入完毕后,DBMonitor在新的数据库节点上回放监控文件中记录的数据操作。当DBMonitor回放完毕后,迁移服务器通知路由服务器停止原数据库相关表的读写操作,并更新原数据库节点上存储的数据分布元数据信息。元数据信息更新完毕后,迁移服务器通知路由服务器按照新的数据分布信息进行数据操作请求的路由,并回复原数据库节点的读写操作。迁移服务器开始清理原数据库节点的垃圾数据,当所有数据清理完毕后,此时数据在原数据库节点和新数据库节点迁移完毕,同时元数据服务器上的元数据信息更新完毕,至此完成数据迁移操作。
进一步地,数据迁移服务器的数据迁移处理的具体步骤为:
数据迁移模块接收到客户端的数据迁移请求。
数据迁移模块通知原数据库节点的监控DBMonitor开始监控原数据库节点的所有数据操作,包括数据的更新、修改、新增、删除等操作。
DBMonitor按照新的路由规则,如果操作的数据应该发生在新的数据库节点上,那么DBMonitor将数据操作记录到DBMonitor的监控文件上。
当数据迁移模块将原数据库节点的数据导出完毕后,数据迁移模块停止原数据库节点的读取,开始将数据往新的数据库节点导入。此时DBMonitor继续监控原数据库节点的数据操作。
当数据迁移模块上所有数据导入完毕后,数据迁移模块通知DBMonitor在新的数据库节点上回放数据。所谓回放数据,也即将之前在原数据库上执行的数据变更操作再在新的数据 库节点执行一次。
DBMonitor接收到回放请求后,开始将监控文件中记录的数据操作逐个在新的数据节点上操作,包括新的数据库节点的数据、修改、新增、删除操作。
DBMonitor在回放的过程中,仍然会监控原数据库节点的操作。当DBMoitor所有的数据回放完毕后,DBMonitor通知数据迁移模块数据回放完毕。
数据迁移接收到DBMonitor的回放完毕消息后,DBMonitor通知路由模块停止原数据库和新的数据库节点的相关数据表的读写操作。
数据迁移模块通知元数据库服务器按照新的数据分布信息更新元数据信息。
元数据信息更新完毕后,数据迁移模块通知路由服务器恢复原数据库的读写操作。
数据迁移模块开始清理原数据库节点的垃圾数据。
数据迁移模块完成数据库节点的垃圾数据清理后,通知客户端完成数据迁移操作。
下面结合附图对本发明实施例“一种分布式数据库数据迁移和重分布方法和系统”进详细说明。
图7是根据本发明实施例的数据迁移的系统结构图,如图7所示,为本发明实施例的系统结构图。系统结构主要包括:客户端101、路由模块102(执行了上述停止模块34的功能)、元数据缓存模块103、数据迁移模块104(执行了上述接收模块22、第一处理模块26和第二处理模块32的功能)、分布式数据库集群的单机数据库105、数据库操作监控模块106(执行了上述记录模块24的功能)。
客户端101:客户端模块,用户通过客户端101(包括电脑、手机、浏览器等)提交事务结构化查询语言(Structured Query Language,简称为SQL)语句等。
路由模块102:路由模块,是将执行模块下发的SQL语句,选择合适的数据库连接下发SQL语句去执行。路由模块针对分布式SQL语句会做SQL语句的处理,如在数据迁移阶段,路由模块需要将SQL语句处理成携带路由信息的SQL,如增删改查都会增加路由信息。
元数据缓存模块103:元数据缓存模块,设置为元数据的缓存,包括表定义信息、分布式数据库各节点分布信息。元数据缓存模块可以进行元数据的更新和查询操作。当系统元数据信息变更时,会同步更新元数据缓存模块保存的信息。同时,元数据缓存模块接收其他模块的查询操作,返回元数据信息。
数据迁移模块104:数据迁移模块,设置为数据的迁移,包括数据的导入导出、系统扩容、数据重分布等数据迁移的相关工作。数据迁移模块会接收数据库节点导出的文件,并将导出的文件再导入到新的数据库节点。数据迁移模块会以文件形式存储导出的中间文件。
分布式数据库集群的单机数据库105:分布式数据库集群的单机数据库,会接收并执行分布式数据库集群的数据库语言。其中数据库语言包括数据定义语言、数据操作语言、数据查 询语言、数据控制语言、事务控制语言等。
数据库操作监控模块106:数据库操作监控模块DBMonitor,用来监控分布式数据库集群各个数据库状态,他会将数据库所有修改数据库数据的语言以二进制的形式记录到日志文件中,如insert、update、delete等。DBMonitor会记录所有记录的变化,将每一行数据的修改记录都记录到日志文件中。日志文件中不包括数据库语言,对于查询语句等,因不涉及到数据的变更,也不会记录到日志文件中。
图8是根据本发明实施例的数据迁移模块根据客户端提交的数据迁移请求的数据导出导入处理流程图。数据迁移模块接收到数据迁移请求后,开始通知DBMonitor监控原数据库节点上的数据操作,之后开始将数据导出到文件中,再将导出的文件导入到新的数据库节点中。数据导入完毕后,再将DBMonitor监控的数据操作日志再在目的数据库节点执行。导入完毕之后通知路由模块停止元数据库的相关表的读写操作,并更新元数据信息。更新完毕之后,数据迁移模块通知路由模块恢复原数据库相关表的读写操作权限,并开始清理原数据库节点的垃圾数据。待垃圾数据清理完毕后,数据迁移模块通知客户数据迁移完毕,并将操作结果返回给客户端。如图8所示,该流程具体包括如下步骤:
步骤S801:数据迁移模块接收客户端下发的数据迁移请求。
步骤S802:数据迁移模块接收到客户端的数据迁移请求后,通知DBMonitor监控数据操作。其中DBMonitor监控数据库操作的详细信息见图9描述。
步骤S803:数据迁移模块开始将原数据库的数据导出到文件中。
步骤S804:判断原数据库节点的数据是否导出完毕,如果没有,则继续导出,重复步骤S803,否则进入步骤S805。
步骤S805:数据迁移模块将导出的文件导入到新的数据库节点。
步骤S806:数据迁移模块判断文件是否导入完毕,如果数据没有导入完毕,则重复步骤S805,否则进入步骤S807。
步骤S807:数据迁移模块通知DBMonitor将日志文件中的数据回放到目的数据库节点。所谓回放数据,也即将日志文件中记录的在原数据库上执行的数据变更操作再在新的数据库节点执行一次。需要注意的是,在回放的过程中,DBMonitor仍然需要监控原数据库的数据操作。
步骤S808:数据迁移模块判断DBMonitor日志文件是否回放完毕,如果没有回放完毕,则继续重复步骤S807,否则进入步骤S809。
步骤S809:数据迁移模块获取到数据文件导入完毕,同时DBMonitor监控日志文件也已回放完毕,那么数据迁移模块通知路由模块停止相关数据库表的读写操作。其中对原数据库节点的读写控制可以是在表、库的粒度上进行读写权限控制。如一个大的表,数据需要根据分发键进行切分并将一部分数据迁移到新的数据库上,那么此时路由模块就需要停止原数据 库节点、新数据库节点相关表的读写操作。
步骤S810:数据迁移模块通知元数据缓存模块更新元数据信息。在做数据迁移后,数据的存储节点信息将发生变更,元数据信息需要更新表的分布信息。路由模块在接收到数据库操作请求时,会查询元数据缓存信息,如果涉及到原数据库相关表的操作时,那么就应该按照新的表的分布信息,将数据库操作请求路由到新的数据库节点操作。
步骤S811:数据迁移模块在完成元数据更新后,通知路由模块恢复相关数据库节点的操作权限。
步骤S812:数据迁移模块开始清理原数据库节点的垃圾数据,其中在清理原数据库节点的垃圾数据时,路由模块需要对发往原数据库节点的SQL语句做控制,具体流程见图10所示。
步骤S813:判断垃圾数据是否清理完毕,如果未清理完毕,则进入步骤S812继续清理垃圾数据;如果垃圾数据清理完毕,则进入步骤S814。
步骤S814:通知客户端垃圾数据清理完毕,完成数据迁移工作。数据迁移模块通知路由模块停止监控原数据库节点的相关表的操作语句。
图9是根据本发明实施例的监控模块DBMonitor在数据迁移过程中的监控处理的流程图。如图3所示,是监控模块DBMonitor在数据迁移过程中的监控处理的流程图,具体步骤如下所述:
步骤S901:监控模块DBMonitor开始监控原数据库节点的数据操作。他会将数据库所有修改数据库数据的语言以二进制的形式记录到日志文件中,如插入(insert)、更新(update)、删除(delete)等。DBMonitor会记录所有记录的变化,将每一行数据的修改记录都记录到日志文件中。日志文件中不包括数据库语言,对于查询语句等,因不涉及到数据的变更,也不会记录到日志文件中。
步骤S902,DBMonitor判断监控到的数据操作,判断数据库语言操作是否需要在新的数据库节点执行。如果不需要则进入步骤S904,否则进入步骤S903。
步骤S903,将数据库语言操作的数据记录保存在日志文件中。记录到日志文件中的内容包含这条数据库操作的类型,以及这个操作的前后数据。如对于插入操作,记录操作类型为插入,并且将插入的数据记录下来;对于更新操作,记录操作类型为更新,并将更新前后的数据记录下来。类似地,涉及到数据变更的操作,都将操作类型记录下来,并且记录数据。对于不涉及到数据变更的操作,以及不涉及到新的数据库节点相关表的变更,都不需要记录到监控日志文件。
步骤S904,判断是否停止监控数据操作,如果不停止则继续监控,进入步骤S901;否则完成数据操作监控。
图10是根据本发明实施例的路由模块在数据迁移过程中的监控处理的流程图,如图10所示,路由模块在数据迁移过程中的监控处理的流程图。路由模块在数据元数据变更前,直 接按照原有的元数据信息将数据库操作语句发往对应的数据库节点执行即可。元数据信息变更后,需要按照新的元数据信息将数据库操作语句发到对应数据库节点执行。为了提升迁移过程中数据库性能和可用性,在做数据迁移时,原有的数据库节点仍然需要接收读和写的操作。因此原有的数据库节点保留了新的数据库节点需要迁移的全部数据,以及在迁移过程中写的数据。数据迁移到新的数据库节点后,原有的数据库节点的数据就需要做清理工作,在迁移过程中需要对发往原有的数据库操作语言需要进行处理,图10流程图描述了具体过程,其步骤如下:
步骤S1001,路由模块接收数据库操作语言。
步骤S1002,路由模块根据数据库操作语言涉及到的表去读取其元数据信息。元数据信息包括表的分布情况,如根据主键的范围,确定数据是落在对应的数据库节点上。
步骤S1003,路由模块根据读取到的元数据信息,判断数据库操作是否涉及到迁移数据。如果没有涉及到迁移的数据,则进入步骤S1005;否则,进入步骤S1004。
步骤S1004,如果数据库操作数据涉及到新的迁移数据,那么就需要对其SQL语句进行处理,将数据库语句修改为只在原数据库的数据范围内执行。如一条更新语句,更新的数据范围包含了新旧两个数据库节点的数据。路由模块将对新数据库节点的操作路由到其数据库节点执行即可,对原有数据库节点路由到原数据库节点执行。但是由于原数据库节点包含了没有清理完毕的垃圾数据,路由到原数据库节点的操作可能会操作部分垃圾数据,因此需要将此操作的数据范围限制在数据迁移后原数据库节点应有的范围。
步骤S1005,路由模块将数据库操作语句下发到数据库上执行。
步骤S1006,路由模块判断数据清理是否完毕,如果未完毕,则进入步骤S1001继续监控,否则结束数据库操作语言的路由监控。
综上所述,通过本发明实施例迁移服务器在进行数据迁移的过程中同时监控新的数据的读取和写入操作,记录将在新的节点上进行的数据操作。等到数据操作完毕后,更新元数据信息时通知路由模块停止原数据库节点的读写操作。在数据导入导出的过程中不需要停止原数据库节点的读写操作,只在更新元数据库信息的时候停止读写操作。这样系统在进行数据迁移过程中不会影响系统的正常读写操作,从而实现分布式数据库系统的实时平滑线性扩容,提高系统性能,改善可用性。由于元数据信息的更新可以即时完成,因此数据库节点停止服务的时间窗口减到最小,降低数据迁移过程对系统服务的影响。本发明实施例适用于分布式关系型数据库需要进行数据的逻辑迁移操作的场合,如数据迁移、数据备份、数据库扩容等操作。
在另外一个实施例中,还提供了一种软件,该软件用于执行上述实施例及优选实施方式中描述的技术方案。
在另外一个实施例中,还提供了一种存储介质,该存储介质中存储有上述软件,该存储介质包括但不限于:光盘、软盘、硬盘、可擦写存储器等。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
在本发明实施例中,采用接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;记录当前对指定数据的数据操作变更信息;在将指定数据从第一节点迁移至第二节点的过程中,根据数据操作变更信息对指定数据进行操作处理。解决了相关技术中在数据迁移和扩容的过程中需要停止数据库的读写操作的问题,降低了数据迁移过程中,数据库节点停止服务的时间窗口。

Claims (12)

  1. 一种数据迁移处理方法,包括:
    接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;
    记录当前对所述指定数据的数据操作变更信息;
    在将所述指定数据从所述第一节点迁移至所述第二节点的过程中,根据所述数据操作变更信息对所述指定数据进行操作处理。
  2. 根据权利要求1所述的方法,其中,所述方法还包括:
    在将所述指定数据从所述第一节点迁移至所述第二节点之后,根据所述数据操作变更信息在所述第二节点中再次对所述指定数据进行操作处理;
    停止对所述第一节点中的数据和所述第二节点中的数据进行操作变更处理。
  3. 根据权利要求2所述的方法,其中,停止对所述第一节点中的数据和所述第二节点中的数据进行操作变更处理之后包括:
    将所述指定数据对应的节点由所述第一节点更新为所述第二节点。
  4. 根据权利要求3所述的方法,其中,将所述指定数据对应的节点由所述第一节点更新为所述第二节点之后包括:
    继续对所述第一节点中的数据和所述第二节点中的数据进行操作变更处理。
  5. 根据权利要求1所述的方法,其中,所述方法还包括:
    在将所述指定数据从所述第一节点迁移至所述第二节点之后,将所述指定数据从所述第一节点中删除。
  6. 根据权利要求1至5中任一项所述的方法,其中,所述数据操作变更信息包括以下至少之一的信息:
    更新所述指定数据的信息、修改所述指定数据的信息、删除所述指定数据的信息、增加数据。
  7. 一种数据迁移处理装置,所述装置包括:
    接收模块,设置为接收将指定数据由第一节点迁移至第二节点的数据迁移请求消息;
    记录模块,设置为记录当前对所述指定数据的数据操作变更信息;
    第一处理模块,设置为在将所述指定数据从所述第一节点迁移至所述第二节点的过程中,根据所述数据操作变更信息对所述指定数据进行操作处理。
  8. 根据权利要求7所述的装置,其中,所述装置还包括:
    第二处理模块,设置为在将所述指定数据从所述第一节点迁移至所述第二节点之后,根据所述数据操作变更信息在所述第二节点中再次对所述指定数据进行操作处理;
    停止模块,设置为停止对所述第一节点中的数据和所述第二节点中的数据进行操作变更处理。
  9. 根据权利要求8所述的装置,其中,所述装置还包括:
    更新模块,设置为将所述指定数据对应的节点由所述第一节点更新为所述第二节点。
  10. 根据权利要求9所述的装置,其中,所述装置还包括:
    继续模块,设置为继续对所述第一节点中的数据和所述第二节点中的数据进行操作变更处理。
  11. 根据权利要求7所述的装置,其中,所述装置还包括:
    删除模块,设置为在将所述指定数据从所述第一节点迁移至所述第二节点之后,将所述指定数据从所述第一节点中删除。
  12. 根据权利要求7至11中任一项所述的装置,其中,所述数据操作变更信息包括以下至少之一的信息:更新所述指定数据的信息、修改所述指定数据的信息、删除所述指定数据的信息、增加数据。
PCT/CN2016/080493 2015-06-03 2016-04-28 数据迁移处理方法及装置 WO2016192496A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510298975.1A CN106294471A (zh) 2015-06-03 2015-06-03 数据迁移处理方法及装置
CN201510298975.1 2015-06-03

Publications (1)

Publication Number Publication Date
WO2016192496A1 true WO2016192496A1 (zh) 2016-12-08

Family

ID=57440177

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/080493 WO2016192496A1 (zh) 2015-06-03 2016-04-28 数据迁移处理方法及装置

Country Status (2)

Country Link
CN (1) CN106294471A (zh)
WO (1) WO2016192496A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723148A (zh) * 2020-04-10 2020-09-29 浙江大华技术股份有限公司 数据存储方法及装置、存储介质、电子装置

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357896A (zh) * 2017-07-13 2017-11-17 北京小度信息科技有限公司 数据库集群的扩容方法、装置、系统和数据库集群系统
CN108509150B (zh) * 2018-03-08 2021-08-20 华为技术有限公司 数据处理方法及装置
CN108763247B (zh) * 2018-03-29 2021-12-07 创新先进技术有限公司 在数据迁移过程中处理用户请求的方法及装置
CN108932282B (zh) * 2018-05-18 2023-04-18 腾讯科技(深圳)有限公司 一种数据库迁移方法、装置和存储介质
CN108875042B (zh) * 2018-06-27 2021-06-08 中国农业银行股份有限公司 一种混合联机分析处理系统及数据查询方法
CN111858469B (zh) * 2020-07-24 2024-01-26 成都成信高科信息技术有限公司 一种基于时间滑动窗口的自适应分级存储的方法
CN113407462A (zh) * 2021-06-16 2021-09-17 新华三信息安全技术有限公司 一种数据处理的方法、装置、电子设备及介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164167A (zh) * 2011-12-15 2013-06-19 深圳市腾讯计算机系统有限公司 一种数据迁移方法及装置
CN103500146A (zh) * 2013-09-30 2014-01-08 北京邮电大学 虚拟机磁盘存储数据迁移方法和系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7587455B2 (en) * 2004-05-14 2009-09-08 Mirapoint Software, Inc. Method for mailbox migration
CN102103629B (zh) * 2010-12-14 2012-09-26 西北工业大学 在线数据迁移方法
US9740762B2 (en) * 2011-04-01 2017-08-22 Mongodb, Inc. System and method for optimizing data migration in a partitioned database
CN102142027A (zh) * 2011-02-23 2011-08-03 南京智尚丰软件有限公司 数据整合的适配方法
CN103078927B (zh) * 2012-12-28 2015-07-22 合一网络技术(北京)有限公司 一种key-value数据分布式缓存系统及其方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164167A (zh) * 2011-12-15 2013-06-19 深圳市腾讯计算机系统有限公司 一种数据迁移方法及装置
CN103500146A (zh) * 2013-09-30 2014-01-08 北京邮电大学 虚拟机磁盘存储数据迁移方法和系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723148A (zh) * 2020-04-10 2020-09-29 浙江大华技术股份有限公司 数据存储方法及装置、存储介质、电子装置
CN111723148B (zh) * 2020-04-10 2024-01-26 浙江大华技术股份有限公司 数据存储方法及装置、存储介质、电子装置

Also Published As

Publication number Publication date
CN106294471A (zh) 2017-01-04

Similar Documents

Publication Publication Date Title
WO2016192496A1 (zh) 数据迁移处理方法及装置
JP6553822B2 (ja) 分散システムにおける範囲の分割および移動
US11010262B2 (en) Database system recovery using preliminary and final slave node replay positions
US20170337154A1 (en) Storage lifecycle pipeline architecture
US8484161B2 (en) Live file system migration
JP5792594B2 (ja) 仮想パーティションを用いたデータベース再分配
JP5387757B2 (ja) 並列データ処理システム、並列データ処理方法及びプログラム
US10754854B2 (en) Consistent query of local indexes
US9075858B2 (en) Non-disruptive data movement and node rebalancing in extreme OLTP environments
CN103597440A (zh) 用于创建克隆文件的方法以及采用该方法的文件系统
WO2019109854A1 (zh) 分布式数据库数据处理方法、装置、存储介质及电子装置
US20060161539A1 (en) Method and system of database management with shared area
JP4693540B2 (ja) データベース再構成装置、およびデータベース再構成プログラム
WO2016143095A1 (ja) 計算機システム及びトランザクション処理の管理方法
JP5721056B2 (ja) トランザクション処理装置、トランザクション処理方法およびトランザクション処理プログラム
KR20030094328A (ko) 저장된 데이터를 재편성하는 시스템 및 방법
US20210012025A1 (en) System and method for session-aware datastore for the edge
US10592530B2 (en) System and method for managing transactions for multiple data store nodes without a central log
US20170270149A1 (en) Database systems with re-ordered replicas and methods of accessing and backing up databases
US7949632B2 (en) Database-rearranging program, database-rearranging method, and database-rearranging apparatus
CN111680069B (zh) 数据库访问方法及装置
JP2013161398A (ja) データベースシステム、データベース管理方法、およびデータベース管理プログラム
KR100912129B1 (ko) 객체 파일 시스템을 이용한 비정형 데이터 관리 방법 및장치
JP3330006B2 (ja) 情報記憶システムを備えるネットワークシステム、該システムの入力システムならびに
WO2024109415A1 (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: 16802419

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

Country of ref document: EP

Kind code of ref document: A1