Cluster data migration method, device, electronic device and storage medium
By setting and updating data addresses during the data migration process and automatically managing data migration, the problem of high cost and low efficiency of data migration in the existing technology is solved, and an efficient and seamless data migration process is realized.
Patent Information
- Application Number
- CN202111258167.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-10-27
AI Technical Summary
In the existing technology, the data migration process consumes high labor and time costs, has low efficiency, and affects business operations.
During the data migration process, the read and write address of the target data is set to the address information of the source data cluster. After the migration is completed, it is updated to the address information of the target data cluster. The data migration process is automatically managed by the server to reduce manual intervention.
It reduces labor costs, improves data migration efficiency, makes the data migration process insensitive to consumers and producers, and realizes seamless data migration between clusters.
Smart Images

Figure CN113946293B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of big data technology, and in particular to a cluster data migration method, device, electronic device and storage medium. Background Art
[0002] Due to the growth of business data and the limitation of cluster expansion, some data needs to be migrated from one data cluster to another through data migration. In related technologies, when performing data migration, the business party needs to cooperate with the data migration through manual migration or dual-consumption cluster switching, which affects the business of the consumer and the producer, and consumes manpower and time costs, resulting in low efficiency of data migration. Summary of the invention
[0003] The present disclosure provides a cluster data migration method, device, electronic device and storage medium to at least solve the problem in the related art that data migration consumes manpower and time costs and has low efficiency. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a cluster data migration method is provided, the method comprising:
[0005] During the migration of target data in the source data cluster to the target data cluster, setting the read / write address corresponding to the target data to the address information corresponding to the source data cluster;
[0006] When the migration time of the target data is greater than a preset migration time, the data writing function corresponding to the source data cluster is turned off, and the preset migration time is the consumption delay time of the data in the source data cluster;
[0007] When the target data is completely migrated to the target data cluster, the read and write addresses corresponding to the target data are updated to address information corresponding to the target data cluster.
[0008] As an optional embodiment, before the target data is completely migrated to the target data cluster, the method further includes:
[0009] Receiving a first address acquisition request sent by a consumer based on forwarding by a source data node in the source data cluster;
[0010] In a case where the migration status information of the target data is in the process of data migration, based on the address information corresponding to the source data cluster, determining, in the source data cluster, first node address information of the to-be-processed data corresponding to the first address acquisition request;
[0011] The first node address information is forwarded to the consumer based on the source data node, where the first node address information is used to instruct the consumer to read the data to be processed from the first data node corresponding to the first node address information.
[0012] As an optional embodiment, after sending the first node address information to the data node of the source data cluster and forwarding the first node address information to the consumer through the source data node, the method further includes:
[0013] receiving a first progress acquisition request sent by the consumer based on forwarding by the first data node;
[0014] In a case where the migration status information of the data to be processed indicates that the data is in the process of data migration, determining a first data processing progress corresponding to the consumer from the source data cluster;
[0015] The first data processing progress is forwarded to the consumer based on the first data node, where the first data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the first data node.
[0016] As an optional embodiment, after the target data is completely migrated to the target data cluster, the method further includes:
[0017] Receiving a second address acquisition request sent by the consumer based on forwarding by the source data node;
[0018] In a case where the migration status information of the target data indicates that data migration is completed, determining, in the target data cluster, second node address information of the to-be-processed data corresponding to the second address acquisition request;
[0019] The second node address information is forwarded to the consumer based on the source data node, and the second node address information is used to instruct the consumer to establish a subscription relationship with the second data node corresponding to the second node address information, and read the data to be processed from the second data node.
[0020] As an optional embodiment, after sending the second node address information to the data node of the source data cluster and forwarding the second node address information to the consumer through the source data node, the method further includes:
[0021] receiving a second progress acquisition request sent by the consumer based on forwarding by the second data node;
[0022] When the migration status information of the data to be processed indicates that data migration is completed, determining a second data processing progress corresponding to the consumer from the source data cluster;
[0023] The second data processing progress is forwarded to the consumer based on the second data node, where the second data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the second data node.
[0024] As an optional embodiment, before disabling the data writing function corresponding to the source data cluster, the method further includes:
[0025] Receive a third address acquisition request sent by the producer based on the forwarding of the source data node;
[0026] In a case where the migration status information of the target data is in the process of data migration, determining, in the target data cluster, the third node address information corresponding to the third address acquisition request based on the address information corresponding to the source data cluster;
[0027] Based on the source data node forwarding the third node address information to the producer, the third node address information is used to instruct the producer to perform data writing to the third data node corresponding to the third node address information.
[0028] As an optional embodiment, after disabling the data writing function corresponding to the source data cluster, the method further includes:
[0029] Receiving a fourth address acquisition request sent by the producer based on forwarding by the source data node;
[0030] In a case where the migration status information of the target data indicates that data migration is completed, determining, in the target data cluster, address information of a fourth node corresponding to the fourth address acquisition request based on the address information corresponding to the target data cluster;
[0031] The fourth node address information is forwarded to the producer based on the source data node, and the fourth node address information is used to instruct the producer to establish a publishing relationship with the fourth data node corresponding to the fourth node address information, and to write data to the fourth data node.
[0032] As an optional embodiment, when the migration time of the target data is greater than the preset migration time, disabling the data writing function corresponding to the source data cluster includes:
[0033] In a case where the target data migration time is greater than a preset migration time, determining data processing states corresponding to the source data cluster and the target data cluster respectively;
[0034] Determine a data migration status corresponding to the target data cluster;
[0035] When the data processing state is the target processing state and the data migration state is the target migration state, the data writing function corresponding to the source data cluster is disabled. According to a second aspect of an embodiment of the present disclosure, a cluster data migration method is provided, the method comprising:
[0036] Based on the data migration progress corresponding to the migrated data, current migration data is obtained from the target data in the source data cluster, where the current migration data is difference data between the data migration progress and the data writing progress corresponding to the source data cluster;
[0037] Based on the current migration data, the migrated data and the data migration progress are updated. During the target data migration, the read and write addresses corresponding to the target data are the address information corresponding to the source data cluster. After the target data migration is completed, the read and write addresses corresponding to the target data are the address information corresponding to the target data cluster.
[0038] According to a third aspect of an embodiment of the present disclosure, a cluster data migration device is provided, the device comprising:
[0039] A data address setting module is configured to set the read / write address corresponding to the target data to the address information corresponding to the source data cluster during the process of migrating the target data in the source data cluster to the target data cluster;
[0040] A write function closing module is configured to close the data write function corresponding to the source data cluster when the migration time of the target data is greater than a preset migration time, and the preset migration time is the consumption delay time of the data in the source data cluster;
[0041] The data address updating module is configured to update the read and write addresses corresponding to the target data to address information corresponding to the target data cluster when the target data is completely migrated to the target data cluster.
[0042] As an optional embodiment, the device further includes:
[0043] A first address request receiving module is configured to receive a first address acquisition request sent by a consumer based on forwarding by a source data node in the source data cluster;
[0044] A first node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, first node address information of the to-be-processed data corresponding to the first address acquisition request in the source data cluster based on the address information corresponding to the source data cluster;
[0045] The first node address information sending module is configured to forward the first node address information to the consumer based on the source data node, wherein the first node address information is used to instruct the consumer to read the data to be processed from the first data node corresponding to the first node address information.
[0046] As an optional embodiment, the device further includes:
[0047] A first progress acquisition request receiving module is configured to receive a first progress acquisition request sent by the consumer based on forwarding by the first data node;
[0048] A first data processing progress acquisition module is configured to determine, from the source data cluster, a first data processing progress corresponding to the consumer when the migration status information of the data to be processed is in the data migration process;
[0049] The first data processing progress sending module is configured to forward the first data processing progress to the consumer based on the first data node, where the first data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the first data node.
[0050] As an optional embodiment, the device further includes:
[0051] A second address request receiving module is configured to receive a second address acquisition request sent by the consumer based on forwarding by the source data node;
[0052] A second node address determination module is configured to determine, in a case where the migration status information of the target data is that data migration is completed, second node address information of the to-be-processed data corresponding to the second address acquisition request in the target data cluster based on the address information corresponding to the target data cluster;
[0053] The second node address information sending module is configured to forward the second node address information to the consumer based on the source data node, the second node address information is used to indicate that a subscription relationship is established between the consumer and the second data node corresponding to the second node address information, and the data to be processed is read from the second data node.
[0054] As an optional embodiment, the device further includes:
[0055] A second progress acquisition request receiving module is configured to receive a second progress acquisition request sent by the consumer based on forwarding by the second data node;
[0056] A second data processing progress acquisition module is configured to determine the second data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed indicates that data migration is completed;
[0057] The second data processing progress sending module is configured to forward the second data processing progress to the consumer based on the second data node, where the second data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the second data node.
[0058] As an optional embodiment, the device further includes:
[0059] A third address request receiving module is configured to receive a third address acquisition request sent by a producer based on forwarding by a source data node;
[0060] A third node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, the third node address information corresponding to the third address acquisition request in the target data cluster based on the address information corresponding to the source data cluster;
[0061] The third node address information sending module is configured to forward the third node address information to the producer based on the source data node, and the third node address information is used to instruct the producer to write data to the third data node corresponding to the third node address information.
[0062] As an optional embodiment, the device further includes:
[0063] A fourth address request receiving module is configured to receive a fourth address acquisition request sent by the producer based on forwarding by a source data node;
[0064] A fourth node address determination module is configured to determine, in a case where the migration status information of the target data indicates that data migration is completed, fourth node address information corresponding to the fourth address acquisition request in the target data cluster based on the address information corresponding to the target data cluster;
[0065] The fourth node address information sending module is configured to forward the fourth node address information to the producer based on the source data node, the fourth node address information is used to indicate that the producer and the fourth data node corresponding to the fourth node address information establish a publishing relationship, and perform data writing to the fourth data node.
[0066] As an optional embodiment, the write function closing module includes:
[0067] A data processing state determining unit, configured to determine the data processing states corresponding to the source data cluster and the target data cluster respectively when the amount of synchronized data in the target data cluster is greater than a preset amount of data;
[0068] A data synchronization state determining unit, configured to determine a data synchronization state corresponding to the target data cluster;
[0069] The write function closing unit is configured to close the data write function corresponding to the source data cluster when the data processing state is the target processing state and the data synchronization state is the target synchronization state.
[0070] According to a fourth aspect of an embodiment of the present disclosure, a cluster data migration device is provided, the device comprising:
[0071] a current migration data determination module configured to execute, based on the data migration progress corresponding to the migrated data, obtaining the current migration data from the target data in the source data cluster, wherein the current migration data is the difference data between the data migration progress and the data writing progress corresponding to the source data cluster;
[0072] The data migration module is configured to update the migrated data and the data migration progress based on the current migration data. During the target data migration process, the read and write addresses corresponding to the target data are the address information corresponding to the source data cluster. After the target data migration is completed, the read and write addresses corresponding to the target data are the address information corresponding to the target data cluster.
[0073] According to a fifth aspect of an embodiment of the present disclosure, a cluster data migration system is provided, the system comprising:
[0074] The system comprises: a server cluster, a source data cluster and a target data cluster;
[0075] The server cluster includes a plurality of servers and a control server, wherein the control server is electrically connected to each of the plurality of servers;
[0076] The server cluster is electrically connected to the source data cluster based on the control server, and the server cluster is electrically connected to the target data cluster based on the control server;
[0077] The target data cluster is configured to execute, in response to the data migration instruction, to obtain target data from the source data cluster;
[0078] The control server is configured to set the read / write address corresponding to the target data to the address information corresponding to the source data cluster during the process of migrating the target data in the source data cluster to the target data cluster;
[0079] The control server is configured to execute, when the time for migrating the target data is greater than a preset migration time, closing the data writing function corresponding to the source data cluster, wherein the preset migration time is a consumption delay time of the data in the source data cluster;
[0080] The control server is configured to execute, when the target data is completely migrated to the target data cluster, updating the read and write addresses corresponding to the target data to address information corresponding to the target data cluster.
[0081] As an optional embodiment, the system further includes: a consumer;
[0082] The source data cluster includes a plurality of source data nodes and a source cluster control node, and the source cluster control node is electrically connected to each source data node of the plurality of source data nodes;
[0083] The control server comprises a first address request receiving module, a first node address determining module and a first node address information sending module, wherein the first address request receiving module is electrically connected to the first node address determining module, and the first node address determining module is electrically connected to the first node address information sending module;
[0084] The consumer is configured to execute sending a first address acquisition request to the source data node
[0085] The source data node is configured to forward the first address acquisition request to the source cluster control node;
[0086] The source cluster control node is configured to execute sending the first address acquisition request to the control server;
[0087] The first address request receiving module is configured to receive a first address acquisition request sent by the consumer based on forwarding by a source data node in the source data cluster;
[0088] The first node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, first node address information of the to-be-processed data corresponding to the first address acquisition request in the source data cluster based on the address information corresponding to the source data cluster;
[0089] The first node address information sending module is configured to send the first node address information to the source cluster control node;
[0090] The source cluster control node is configured to forward the first node address information to the source data node;
[0091] The source data node is configured to forward the first node address information to the consumer;
[0092] The consumer is configured to read the data to be processed from the first data node corresponding to the first node address information.
[0093] As an optional embodiment, the control server further includes a first progress acquisition request receiving module, a first data processing progress acquisition module and a first data processing progress sending module;
[0094] The first progress acquisition request receiving module is electrically connected to the first data processing progress acquisition module;
[0095] The first data processing progress acquisition module is electrically connected to the first data processing progress sending module:
[0096] The consumer is configured to execute sending a first progress acquisition request to the first data node;
[0097] The first data node is configured to execute a first progress acquisition request forwarded to the source cluster control node;
[0098] The source cluster control node is configured to forward the first progress acquisition request to the control server;
[0099] The first progress acquisition request receiving module is configured to receive a first progress acquisition request sent by the consumer based on forwarding by the first data node;
[0100] The first data processing progress acquisition module is configured to determine the first data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed is in the data migration process;
[0101] The first data processing progress sending module is configured to send the first data processing progress to the source cluster control node;
[0102] The source cluster control node is configured to send the first data processing progress to the first data node;
[0103] The first data node is configured to forward the first data processing progress to the consumer;
[0104] The consumer is configured to determine the data to be processed from the data stored in the first data node based on the first data processing progress.
[0105] As an optional embodiment, the control server further includes: a second address request receiving module, a second node address determining module and a second node address information sending module;
[0106] The second address request receiving module is electrically connected to the second node address determining module;
[0107] The second node address determination module is electrically connected to the second node address information sending module;
[0108] The target data cluster includes a plurality of target data nodes and a target data cluster control node, and the target data cluster control node is electrically connected to each of the plurality of target data nodes;
[0109] The consumer is configured to execute sending a second address acquisition request to the source data node;
[0110] The source data node is configured to receive a second address acquisition request sent by the consumer, and forward the second address acquisition request to the source cluster control node;
[0111] The source cluster control node is configured to forward the second address acquisition request to the control server;
[0112] The second address request receiving module is configured to receive a second address acquisition request sent by the consumer based on forwarding by the source data node;
[0113] The second node address determination module is configured to determine, in a case where the migration status information of the data corresponding to the to-be-processed data is that data migration is completed, based on the address information corresponding to the target data cluster, the second node address information of the to-be-processed data corresponding to the second address acquisition request in the target data cluster;
[0114] The second node address information sending module is configured to send the second node address information to the source cluster control node;
[0115] The source cluster control node is configured to forward the second node address information to the source data node;
[0116] The source data node is configured to forward the second node address information to the consumer;
[0117] The consumer is configured to establish a subscription relationship with a second data node corresponding to the second node address information, and read the data to be processed from the second data node.
[0118] As an optional embodiment, the control server further includes: a second progress acquisition request receiving module, a second data processing progress acquisition module and a second data processing progress sending module;
[0119] The second progress acquisition request receiving module is electrically connected to the second data processing progress acquisition module;
[0120] The second data processing progress acquisition module is electrically connected to the second data processing progress sending module;
[0121] The consumer is configured to execute sending a second progress acquisition request to the second data node;
[0122] The second data node is configured to forward the second progress acquisition request to the target cluster control node;
[0123] The target cluster control node is configured to forward the second progress acquisition request to the control server;
[0124] The second progress acquisition request receiving module is configured to receive a second progress acquisition request sent by the consumer based on forwarding by the second data node;
[0125] The second data processing progress acquisition module is configured to determine the second data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed indicates that data migration is completed;
[0126] The second data processing progress sending module is configured to send the second data processing progress to the target cluster control node;
[0127] The target cluster control node is configured to forward the second data processing progress to the second data node;
[0128] The second data node is configured to forward the second data processing progress to the consumer;
[0129] The consumer is configured to determine the data to be processed from the data stored in the second data node based on the second data processing progress.
[0130] As an optional embodiment, the system further includes: a producer;
[0131] The control server further comprises: a third address request receiving module, a third node address determining module and a third node address information sending module;
[0132] The third address request receiving module is electrically connected to the third node address determining module;
[0133] The third node address determination module is electrically connected to the third node address information sending module;
[0134] The producer is configured to execute sending a third address acquisition request to the source data node;
[0135] The source data node is configured to forward the third address acquisition request to the source cluster control node;
[0136] The source cluster control node is configured to forward the third address acquisition request to the control server;
[0137] The third address request receiving module is configured to receive a third address acquisition request sent by the producer based on forwarding by the source data node;
[0138] The third node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, the third node address information corresponding to the third address acquisition request in the target data cluster based on the address information corresponding to the source data cluster;
[0139] The third node address information sending module is configured to send the third node address information to the source cluster control node;
[0140] The source cluster control node is configured to forward the third node address information to the source data node;
[0141] The source data node is configured to forward the third node address information to the producer;
[0142] The producer is configured to write data to a third data node corresponding to the third node address information.
[0143] As an optional embodiment, the control server further includes: a fourth address request receiving module, a fourth node address determining module and a fourth node address information sending module;
[0144] The fourth address request receiving module is electrically connected to the fourth node address determining module;
[0145] The fourth node address determination module is electrically connected to the fourth node address information sending module;
[0146] The producer is configured to execute sending a fourth address acquisition request to the source data node;
[0147] The source data node is configured to forward the fourth address acquisition request to the source cluster control node;
[0148] The source cluster control node is configured to forward the fourth address acquisition request to the control server;
[0149] The fourth address request receiving module is configured to receive a fourth address acquisition request sent by the producer based on forwarding by the source data node;
[0150] The fourth node address determination module is configured to determine, in a case where the migration status information of the target data indicates that data migration is completed, the fourth node address information corresponding to the fourth address acquisition request in the target data cluster based on the address information corresponding to the target data cluster;
[0151] The fourth node address information sending module is configured to send the fourth node address information to the source data control node;
[0152] The source data control node is configured to forward the fourth node address information to the source data node;
[0153] The source data node is configured to forward the fourth node address information to the producer;
[0154] The production is configured to establish a publishing relationship with a fourth data node corresponding to the fourth node address information, and write data to the fourth data node.
[0155] As an optional embodiment, the system further includes:
[0156] The target data cluster is configured to execute, based on the data migration progress, obtaining current migration data from the target data, wherein the current migration data is difference data between the data migration progress in the target data cluster and the data writing progress corresponding to the data in the source data cluster.
[0157] As an optional embodiment, the control server further includes: a write function closing module, the write function closing module includes: a data processing state determining unit, a data synchronization state determining unit and a write function closing unit;
[0158] The data processing state determination unit is electrically connected to the data synchronization state determination unit;
[0159] The data synchronization state determination unit is electrically connected to the write function closing unit;
[0160] The data processing state determining unit is configured to determine the data processing states corresponding to the source data cluster and the target data cluster respectively when the migration time of the target data is greater than a preset migration time;
[0161] The data synchronization status determination unit is configured to determine the data migration status corresponding to the target data cluster;
[0162] The write function closing unit is configured to close the data write function corresponding to the source data cluster when the data processing state is the target processing state and the data migration state is the target migration state.
[0163] As an optional embodiment, the target data cluster is configured to execute in response to the data migration instruction, and obtaining the target data from the source data cluster includes:
[0164] The target data cluster is configured to execute, in response to the data migration instruction, determine current migration data from the target data based on the data migration progress, the current migration data being difference data between the data migration progress in the target data cluster and the data writing progress corresponding to the data in the source data cluster;
[0165] The target data cluster is configured to perform migration of the current migration data from the source data cluster to the target data cluster.
[0166] According to a sixth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0167] processor;
[0168] a memory for storing instructions executable by the processor;
[0169] The processor is configured to execute the instructions to implement the cluster data migration method described above.
[0170] According to a seventh aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the cluster data migration method as described above.
[0171] According to an eighth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the above-mentioned cluster data migration method is implemented.
[0172] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0173] In the process of migrating the target data from the source data cluster to the target data cluster, the read / write address of the target data is set to the data address corresponding to the source data cluster. After the data migration is completed, the read / write address of the target data is updated to the data address corresponding to the target data cluster, thereby indicating the location where producers and consumers write or read data during and after the data migration. This method can make consumers and producers unaware of the data migration business while performing their respective businesses during the data migration process, thereby eliminating the need for the business party to cooperate in data migration, reducing labor costs and improving the efficiency of data migration, and completing seamless migration of data between clusters.
[0174] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0175] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0176] Figure 1 is a schematic diagram of an application scenario of a cluster data migration method according to an exemplary embodiment;
[0177] Figure 2 The figure is a flow chart of a cluster data migration method according to an exemplary embodiment.
[0178] Figure 3 The present invention is a flowchart of a consumer requesting an address before the target data is migrated in a cluster data migration method according to an exemplary embodiment.
[0179] Figure 4 The diagram is a schematic diagram of interaction when a consumer or a producer requests a read or write address in a cluster data migration method according to an exemplary embodiment.
[0180] Figure 5 The present invention is a flowchart showing a progress of processing first data requested by a consumer in a cluster data migration method according to an exemplary embodiment.
[0181] Figure 6 The diagram is a schematic diagram of interaction when a consumer requests data processing progress in a cluster data migration method according to an exemplary embodiment.
[0182] Figure 7 The present invention is a flowchart of disabling a data writing function corresponding to a source data cluster in a cluster data migration method according to an exemplary embodiment.
[0183] Figure 8 The present invention is a flowchart showing a method for migrating cluster data according to an exemplary embodiment, in which a consumer requests a read / write address after migrating target data.
[0184] Fig. 9 The present invention is a flowchart showing a progress of processing first data requested by a consumer in a cluster data migration method according to an exemplary embodiment.
[0185] Fig.10 The present invention is a flowchart of a consumer requesting a read / write address before closing a data write function corresponding to a source data cluster in a cluster data migration method according to an exemplary embodiment.
[0186] Fig.11 The present invention is a flowchart of a consumer requesting a read / write address after a data write function corresponding to a source data cluster is disabled in a cluster data migration method according to an exemplary embodiment.
[0187] Fig.12 The diagram is a schematic diagram of performing data migration in a cluster data migration method according to an exemplary embodiment.
[0188] Fig.13 The present invention is a flowchart of interactions among a target data cluster, a control server and a source data cluster in a cluster data migration method according to an exemplary embodiment.
[0189] Fig.14 The diagram is a schematic diagram of a cluster federation framework in a cluster data migration method according to an exemplary embodiment.
[0190] Fig.15 The invention is a block diagram showing a cluster data migration device on a control server side according to an exemplary embodiment.
[0191] Fig.16 The diagram is a block diagram showing a cluster data migration device on a target data cluster side according to an exemplary embodiment.
[0192] Fig.17The diagram is a block diagram of a cluster data migration system according to an exemplary embodiment.
[0193] Fig.18 The invention is a block diagram of a server-side electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0194] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0195] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0196] Figure 1 1 is a schematic diagram of an application scenario of a cluster data migration method according to an exemplary embodiment, and the application scenario includes a consumer 110, a producer 120, a source data cluster 130, a target data cluster 140, and a server 150. The server 150 migrates the target data from the source data cluster 130 to the target data cluster 140, and sets the read-write address corresponding to the target data to the address information corresponding to the source data cluster. Based on the address information corresponding to the source data cluster, the producer 120 writes data to the source data cluster 130, and the consumer 110 reads data from the source data cluster 130. After the server 150 completes the migration of the target data, it updates the read-write address corresponding to the target data to the address information corresponding to the target data cluster. Based on the address information corresponding to the target data cluster, the producer 120 writes data to the target data cluster 140, and the consumer 110 reads data from the target data cluster 140.
[0197] In the embodiments of the present disclosure, the client 110 includes physical devices such as smart phones, desktop computers, tablet computers, laptops, digital assistants, smart wearable devices, etc., and may also include software running in the physical devices, such as applications, etc. The operating system running on the physical device in the embodiments of the present application may include but is not limited to Android system, IOS system, Linux, Unix, Windows, etc. The client 110 includes consumers 110 and producers 120. Consumers 110 read data in the source data cluster 130 or the target data cluster 140, and producers write data to the source data cluster 130 or the target data cluster 140.
[0198] In the disclosed embodiment, the server 150 may include an independently operated server, a distributed server, or a server cluster composed of multiple servers. The server 150 may include a network communication unit, a processor, a memory, etc. Specifically, the server 150 may be used to determine the read and write addresses of the target data and determine the data processing progress.
[0199] Figure 2 is a flow chart of a cluster data migration method according to an exemplary embodiment. Figure 2 As shown, the method is applied in a server, and the server to which the method is applied may be a server cluster, and the method may be executed by a control server in the server cluster. The method includes the following steps.
[0200] S210. During the migration of target data from the source data cluster to the target data cluster, the read / write address corresponding to the target data is set to the address information corresponding to the source data cluster;
[0201] As an optional embodiment, the target data includes the historical written data of the source data cluster and the data written to the source data cluster by the producer during the data migration process. When the target data is migrated from the source data cluster to the target data cluster, the read-write address corresponding to the target data is set to the address information corresponding to the source data cluster. When the read-write address corresponding to the target data is the address information corresponding to the source data cluster, it means that during the target data migration process, the target data is still stored in the source data cluster, and the consumer needs to read the target data from the source data cluster. At the same time, the producer also needs to write the target data from the source data cluster.
[0202] As an optional embodiment, when performing data migration, the data subject corresponding to the target data can be identified as a migration status. The target data corresponding to the data subject is the data that is in the process of migration or has been migrated, that is, the migration status information corresponding to the target data can be obtained. The source data node, producer, and consumer cannot determine whether the target data is in the process of migration or has been migrated based on the migration status information. They can only obtain the read and write addresses corresponding to the target data through the server based on the migration status information, thereby determining whether the target data is currently in the source data cluster or in the target data cluster, that is, judging whether the target data is in the process of migration or has been migrated.
[0203] As an alternative embodiment, see Figure 3 Before the target data is completely migrated to the target data cluster, the method further includes:
[0204] S310. Receive a first address acquisition request sent by a consumer based on forwarding by a source data node in a source data cluster;
[0205] S320. When the migration status information of the target data indicates that the data is in the process of migration, based on the address information corresponding to the source data cluster, determine the first node address information of the to-be-processed data corresponding to the first address acquisition request in the source data cluster;
[0206] S330. Forward the first node address information to the consumer based on the source data node, where the first node address information is used to instruct the consumer to read the data to be processed from the first data node corresponding to the first node address information.
[0207] As an optional embodiment, before the target data is completely migrated to the target data cluster, the server receives a first address acquisition request forwarded by a source data node in the source data cluster, and the first address acquisition request is sent by the consumer to the source data node. In the time period before closing the data write function corresponding to the source data cluster, or in the time period from closing the data write function corresponding to the source data cluster to the completion of data migration, the target data is in a migration state, and the target data cluster continues to migrate data. Therefore, these two time periods are the time periods before the target data is completely migrated to the target data cluster. At this time, the to-be-processed data requested to be read by the consumer is the data in the target data with migration status information. The consumer and the source data node cannot determine whether the to-be-processed data is located in the source data cluster or the target data cluster. The server can determine whether the target data is located in the source data cluster or the target data cluster through the read-write address corresponding to the target data. Therefore, the source data node forwards the first address acquisition request to the server.
[0208] When the migration status information of the target data is in the process of data migration, the read-write address corresponding to the target data is the address information corresponding to the source data cluster, indicating that the target data is stored in the source data cluster. The server can determine the first node address information of the data to be processed corresponding to the first address acquisition request in the source data cluster based on the address information corresponding to the source data cluster. The server sends the first node address information to the source data node, which is forwarded to the consumer by the source data node. The consumer can then read the data to be processed from the first data node corresponding to the first node address information. Since the first data node is located in the source data cluster, the consumer has a subscription relationship with the source partition corresponding to the first data node. Therefore, the consumer can directly obtain the data to be processed from the first data node and process the data to be processed.
[0209] As an optional embodiment, when the consumer, source data node and server are interacting, and the data in the source data cluster is being migrated, please refer to Figure 4 ,like Figure 4 As shown, the consumer sends a first address acquisition request to the source data node of the source data cluster. The source data node recognizes that the to-be-processed data corresponding to the first address acquisition request is data with migration status information set, and then forwards the first address acquisition request to the server. The server determines that the read-write address corresponding to the target data is the address information corresponding to the source data cluster. Based on the address information corresponding to the source data cluster, the server determines the first node address information corresponding to the target data, and sends the first node address information to the source data node. The source data node forwards the first node address information to the consumer, so that the consumer accesses the corresponding first data node to read data based on the first node address information.
[0210] As an optional embodiment, when the source data node and the server interact, they can interact through the source cluster control node in the source data cluster and the control server in the server cluster, that is, the source data node forwards the first address acquisition request to the source cluster control node, and the source cluster control node forwards the first address acquisition request to the control server. The control server sends the first node address information to the source cluster control node, the source cluster control node forwards the first node address information to the source data node, and the source data node forwards the first node address information to the consumer.
[0211] Before the target data is completely migrated to the target data cluster, when the consumer reads data marked with migration status information, the consumer can forward the first address acquisition request to the server through the source data node. The server determines that the data is stored in the source data cluster at this time, so that during the data migration process, the consumer can obtain the correct address information and read the data normally, making the data migration imperceptible to the consumer's business, thereby improving the stability and continuity of the consumer's business during the data migration process.
[0212] As an alternative embodiment, see Figure 5 After sending the first node address information to the data node of the source data cluster and forwarding the first node address information to the consumer through the source data node, the method further includes:
[0213] S510. Receive a first progress acquisition request sent by a consumer based on forwarding by the first data node;
[0214] S520. When the migration status information of the data to be processed indicates that the data is in the process of data migration, determine the first data processing progress corresponding to the consumer from the source data cluster;
[0215] S530. Forward a first data processing progress to the consumer based on the first data node, where the first data processing progress is used to instruct the consumer to determine data to be processed from the data stored in the first data node.
[0216] As an optional embodiment, after the consumer receives the first node address information, the server receives a first progress acquisition request forwarded based on the first data node, and the first progress acquisition request is sent by the consumer and is used to obtain the target data processing progress corresponding to the data to be processed. The first data node is the data node corresponding to the first node address information. The consumer has a subscription relationship with the source partition corresponding to the data node in the source data cluster. When the migration status information of the data to be processed is in the process of data migration, the consumer still reads the data to be processed from the source data cluster. The server can determine the first data processing progress corresponding to the consumer from the data node subscribed by the consumer in the source data cluster, and forward the first data processing progress to the consumer based on the first data node. The consumer can obtain the data to be processed from the data stored in the first data node based on the first data processing progress and process the data to be processed.
[0217] As an optional embodiment, since each consumer has a subscription relationship with a data node in a source data cluster, there is a corresponding relationship between the consumer and the source data cluster, and each source data cluster can correspond to at least one consumer. When a consumer obtains data from a subscribed data node and processes the data, the data node will record the consumer's data processing progress, so the data processing progress is stored in the source data cluster. When the server receives a first progress acquisition request corresponding to a consumer, the server obtains preset mapping information from the database, and the preset mapping information is the corresponding relationship between the consumer and the source data cluster, thereby determining the target source data cluster corresponding to the consumer, and the server obtains the first data processing progress from the data node in the target source data cluster that has a subscription relationship with the consumer.
[0218] As an optional embodiment, when the consumer, the first data node and the server interact with each other, please refer to Figure 6 ,like Figure 6 As shown, after receiving the first node address information, the consumer sends a first progress acquisition request to the first data node corresponding to the first node address information, and the first data node forwards the first progress acquisition request to the server. The server obtains the corresponding relationship between the consumer and the source data cluster in the database, determines the target source data cluster corresponding to the consumer, and the server obtains the first data processing progress from the target source data cluster and sends the first data processing progress to the first data node. The first data node forwards the first data processing progress to the consumer. If the server cannot determine the target source data cluster corresponding to the consumer in the preset mapping information, it can query the target source data cluster corresponding to the consumer according to the preset cluster query method, and establish a corresponding relationship between the consumer and the queried target source data cluster, and update the preset mapping information based on the corresponding relationship.
[0219] As an optional embodiment, when the first data node interacts with the server, the interaction can be performed through the source cluster control node in the source data cluster and the control server in the server cluster, that is, the first data node forwards the first progress acquisition request to the source cluster control node, and the source cluster control node forwards the first progress acquisition request to the control server. The control server sends the first data processing progress to the source cluster control node, the source cluster control node forwards the first data processing progress to the first data node, and the first data node forwards the first data processing progress to the consumer.
[0220] When consumers obtain data processing progress, no matter whether it is during data migration or after data migration is completed, the data processing progress is stored in the source data cluster and forwarded to the consumer after being obtained by the server. During the data migration process, consumers consume in the source data cluster based on the data processing progress, thereby ensuring that the data processing progress is not lost, avoiding problems such as repeated consumption and missed consumption by consumers, and improving the continuity of consumers' data processing progress before and after data migration.
[0221] S220. When the migration time of the target data is greater than the preset migration time, the data writing function corresponding to the source data cluster is turned off. The preset migration time is the consumption delay time of the data in the source data cluster.
[0222] As an optional embodiment, there is at least one consumer reading data in the source data cluster, and at least one consumer corresponds to a different consumption delay time. The target data cluster needs to determine the target delay time from the different consumption delay times as the preset migration time, and the target delay time can be the maximum value of the different consumption delay times. For example, there are consumers A, B, and C in the source data cluster, where the consumption delay time of consumer A is 4 hours, the consumption delay time of consumer B is 1 hour, and the consumption delay time of consumer C is 5 hours. Then, at least 5 hours of data must be synchronized in the target data cluster. If the target data cluster only synchronizes 1 hour of data and starts to execute subsequent steps, then consumer C will not be able to read the delayed 4 hours of data in the middle, so at least 5 hours of data needs to be synchronized.
[0223] As an optional embodiment, the data writing function corresponding to the source data cluster is turned off so that no new data is added to the source data cluster. In subsequent steps, the difference data between the source data cluster and the target data cluster is migrated to the target data cluster to complete the data migration.
[0224] As an alternative embodiment, see Figure 7 When the target data migration time exceeds the preset migration time, the data writing function corresponding to the source data cluster is closed, including:
[0225] S710. When the time for migrating the target data is greater than the preset migration time, determine the data processing states corresponding to the source data cluster and the target data cluster respectively;
[0226] S720. Determine the data migration status corresponding to the target data cluster;
[0227] S730. When the data processing state is the target processing state and the data migration state is the target migration state, close the data writing function corresponding to the source data cluster.
[0228] As an optional embodiment, the target processing state is that the data in the source data cluster and the data in the target data cluster are in a queue state, and no data in the source data cluster and the data in the target data cluster are left behind. The queue state is that the copies of each data partition in the source data cluster or the target data cluster are synchronized with the data of the primary partition when backing up the data of the primary partition, and the left-behind state is that the copies of each data partition in the source data cluster or the target data cluster are not synchronized with the data of the primary partition when backing up the data of the primary partition. When left behind occurs, the amount of data of the copy that has been left behind will be significantly different from the amount of data in the primary partition. The target migration state is that there is no delay in migrating the target data from the source data cluster to the target data cluster. Under the conditions that no consumer is left behind and there is no delay in data migration, the data write function corresponding to the source data cluster is turned off so that there is no new data in the source data cluster.
[0229] If the data processing status is that the data in the source data cluster is lagging behind or the data in the target data cluster is lagging behind, and the data writing function corresponding to the source data cluster is turned off, the replica that has fallen behind in the source data cluster will not have time to back up the data that differs from the primary partition, or the replica that has fallen behind in the target data cluster will not have time to back up the data that differs from the primary partition.
[0230] If a delay occurs when migrating target data from the source data cluster to the target data cluster, and the data writing function corresponding to the source data cluster is turned off, it will take a longer time to migrate the remaining data in the target data from the source data cluster to the target data cluster.
[0231] While ensuring that no data is left behind in the cluster and that data migration is not delayed, disabling the data write function corresponding to the source data cluster can avoid data loss and the problem of data migration taking too long, thereby improving the efficiency and accuracy of data migration.
[0232] As an optional embodiment, when the target data is completely migrated to the target data cluster, the data writing function and the data reading function of the target data cluster are started;
[0233] As an optional embodiment, when the target data is completely migrated to the target data cluster, the data writing function and the data reading function of the target data cluster are started, so that consumers can read data from the target data cluster and producers can write data to the target data cluster. The data writing function of the source data cluster can be turned on or off. Regardless of whether the data writing function of the source data cluster is turned on or off, the producer no longer writes data to the source data cluster.
[0234] S230. When the target data is completely migrated to the target data cluster, the read and write addresses corresponding to the target data are updated to address information corresponding to the target data cluster.
[0235] As an optional embodiment, when the target data is completely migrated to the target data cluster, the read and write addresses of the target data are updated to the address information corresponding to the target data cluster. When the read and write addresses corresponding to the target data are the address information corresponding to the target data cluster, it means that after the target data migration is completed, the target data has been migrated to the target data cluster, and the data reading function corresponding to data consumption and the data writing function corresponding to data production are executed by the target data cluster. Consumers need to read data from the target data cluster, and producers also need to write the data from the target data cluster.
[0236] As an optional embodiment, after the target data is completely migrated to the target data cluster, see Figure 8 , the method further comprises:
[0237] S810. Receive a second address acquisition request sent by the consumer based on forwarding by the source data node;
[0238] S820. When the migration status information of the target data indicates that data migration is completed, based on the address information corresponding to the target data cluster, determine the second node address information of the to-be-processed data corresponding to the second address acquisition request in the target data cluster;
[0239] S830. Forward the second node address information to the consumer based on the source data node, the second node address information is used to instruct the consumer to establish a subscription relationship with the second data node corresponding to the second node address information, and read the data to be processed from the second data node.
[0240] As an optional embodiment, after the target data is completely migrated to the target data cluster, the migration status information of the data in the target data cluster is set to the migration completion status. The server receives a second address acquisition request forwarded by a source data node in the source data cluster, and the second address acquisition request is sent by the consumer to the source data node. At this time, the server can determine that the to-be-processed data requested to be read by the consumer is the data that has been migrated, and it is necessary to obtain the node address information corresponding to the migrated data, so the source data node forwards the second address acquisition request to the server.
[0241] When the migration status information of the target data is that data migration is completed, the read-write address corresponding to the target data is the address information corresponding to the target data cluster, indicating that the target data is stored in the target data cluster. The server can determine the second node address information of the data to be processed corresponding to the second address acquisition request in the target data cluster based on the address information corresponding to the target data cluster. The server sends the second node address information to the source data node, which is forwarded to the consumer by the source data node. The consumer can then read the data to be processed from the second data node corresponding to the second node address information. Since the second data node is located in the target data cluster, the target partition corresponding to the second data node is the data partition under the target data topic, not the source partition. The consumer does not have a subscription relationship with the target partition corresponding to the second data node. Therefore, the consumer needs to establish a subscription relationship with the target partition corresponding to the second data node before it can obtain the data to be processed from the second data node and process the data to be processed.
[0242] As an optional implementation, after completing the data migration, see Figure 4 ,like Figure 4 As shown, the consumer sends the second address acquisition request to the source data node of the source data cluster, and the source data node forwards the second address acquisition request to the server, and the server determines that the read and write address corresponding to the target data is the address information corresponding to the target data cluster. Based on the address information corresponding to the target data cluster, the server determines the second node address information corresponding to the target data, and sends the second node address information to the source data node, and the source data node forwards the second node address information to the consumer, so that the consumer accesses the corresponding second data node to read data based on the second node address information.
[0243] As an optional embodiment, when the source data node and the server interact, they can interact through the source cluster control node in the source data cluster and the control server in the server cluster, that is, the source data node forwards the second address acquisition request to the source cluster control node, and the source cluster control node forwards the second address acquisition request to the control server. The control server sends the second node address information to the source cluster control node, the source cluster control node forwards the second node address information to the source data node, and the source data node forwards the second node address information to the consumer.
[0244] As an optional embodiment, before each data processing, the consumer will send an address acquisition request to the source data node. In the case where the data in the source data cluster is not provided with migration status information, when the consumer of the source data cluster sends an address acquisition request to the source data node in the source data cluster, the source data node can directly send the corresponding node address information to the consumer without forwarding it to the server. In the case where the data in the source data cluster is provided with migration status information, regardless of whether the migration status information indicates that the data migration is in progress or that the data migration is completed, the source data node needs to forward the received address acquisition request to the server. In this case, the received address acquisition request may include a first address acquisition request or a second address acquisition request.
[0245] After the target data is completely migrated to the target data cluster, when the consumer reads data marked with migration status information, the consumer can forward the second address acquisition request to the server through the source data node. The server determines that the data is stored in the target data cluster at this time, so that after the data migration is completed, the consumer can obtain the correct address information and read the data normally, so that the consumer's business can be smoothly transitioned after the data migration, thereby improving the stability and continuity of the consumer's business after the data migration.
[0246] As an alternative embodiment, see Fig. 9 After sending the second node address information to the data node of the source data cluster and forwarding the second node address information to the consumer through the source data node, the method further includes:
[0247] S910. Receive a second progress acquisition request sent by the consumer based on forwarding by the second data node;
[0248] S920. When the migration status information of the data to be processed indicates that data migration is completed, determine the second data processing progress corresponding to the consumer from the source data cluster;
[0249] S930. Forward the second data processing progress to the consumer based on the second data node, where the second data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the second data node.
[0250] As an optional embodiment, after the consumer receives the second node address information, the server may receive a second progress acquisition request forwarded based on the second data node, the second progress acquisition request is sent by the consumer and is used to obtain the target data processing progress corresponding to the data to be processed. The second data node is the data node corresponding to the second node address information. The consumer has a subscription relationship with the data node in the source data cluster before data migration. When the migration status information of the data to be processed is completed, the consumer reads the data to be processed from the target data cluster, but the consumer previously reads the data to be processed in the source data cluster. Therefore, the data processing progress corresponding to the consumer is still stored in the source data server. The server can determine the second data processing progress corresponding to the consumer from the data node subscribed by the consumer in the source data cluster, and forward the second data processing progress to the consumer based on the second data node. The consumer can obtain the data to be processed from the data stored in the second data node based on the second data processing progress and process the data to be processed. In other words, the server obtains the second data processing progress corresponding to the consumer from the source data cluster, and the consumer reads the data from the second data node in the target data cluster based on the second data processing progress.
[0251] Since the data in the source data cluster is no longer updated, as the consumer reads data in the target data cluster, the data processing progress corresponding to the consumer will gradually increase until the data processing progress corresponds to the updated data in the target data cluster after the data migration is completed. At this time, the data processing progress corresponding to the consumer will be transferred to the target data cluster. During the next data migration, the target data cluster will serve as the new source data cluster. After the next data migration is completed, the server will obtain the second data processing progress corresponding to the consumer from the new source data cluster, and the consumer will read data from the second data node in the new target data cluster based on the second data processing progress.
[0252] As an optional implementation, when the consumer, source data node and server interact with each other, please refer to Figure 6 ,like Figure 6As shown, after receiving the second node address information, the consumer sends a second progress acquisition request to the second data node corresponding to the second node address information, and the second data node forwards the second progress acquisition request to the server. The server obtains the corresponding relationship between the consumer and the source data cluster in the database, determines the target source data cluster corresponding to the consumer, and the server obtains the second data processing progress from the target source data cluster and sends the second data processing progress to the second data node. The second data node forwards the second data processing progress to the consumer. If the server cannot determine the target source data cluster corresponding to the consumer in the preset mapping information, it can query the target source data cluster corresponding to the consumer according to the preset cluster query method, and establish a corresponding relationship between the consumer and the queried target source data cluster, and update the preset mapping information based on the corresponding relationship.
[0253] As an optional embodiment, when the second data node interacts with the server, the interaction can be performed through the target cluster control node in the target data cluster and the control server in the server cluster, that is, the second data node forwards the second progress acquisition request to the target cluster control node, and the target cluster control node forwards the second progress acquisition request to the control server. The control server sends the second data processing progress to the target cluster control node, the target cluster control node forwards the second data processing progress to the second data node, and the second data node forwards the second data processing progress to the consumer.
[0254] When consumers obtain data processing progress, no matter whether it is during the data migration process or after the data migration is completed, the data processing progress is stored in the source data cluster, obtained by the server and forwarded to the consumer. After the data migration is completed, the consumer consumes in the target data cluster based on the data processing progress, thereby ensuring that the data processing progress is not lost, avoiding problems such as repeated consumption and missed consumption by consumers, and improving the continuity of the consumer's data processing progress before and after data migration.
[0255] As an alternative embodiment, see Fig.10 Before closing the data writing function corresponding to the source data cluster, the method further includes:
[0256] S1010. Receive a third address acquisition request sent by the producer based on forwarding by the source data node;
[0257] S1020. When the migration status information of the target data indicates that the data is in the process of being migrated, based on the address information corresponding to the source data cluster, determine the third node address information corresponding to the third address acquisition request in the target data cluster;
[0258] S1030. Forward the third node address information to the producer based on the source data node, where the third node address information is used to instruct the producer to write data to the third data node corresponding to the third node address information.
[0259] As an optional embodiment, before closing the data writing function corresponding to the source data cluster, the server receives a third address acquisition request forwarded by the source data node in the source data cluster, and the third address acquisition request is sent by the producer to the source data node. At this time, since the target data is provided with migration status information, the consumer and the source data node cannot determine whether the object requested by the producer to write is the source data cluster or the target data cluster. The server can determine whether the object requested by the producer to write is the source data cluster or the target data cluster through the read-write address corresponding to the target data, so the source data node forwards the third address acquisition request to the server.
[0260] When the migration status information of the target data is in the process of data migration, the read-write address corresponding to the target data is the address information corresponding to the source data cluster, indicating that the target data is stored in the source data cluster, and the object requested to be written by the producer is also the source data cluster. The server can determine the third node address information corresponding to the third address acquisition request in the source data cluster based on the address information corresponding to the source data cluster. The server sends the third node address information to the source data node, which is forwarded to the producer by the source data node. The producer can then read the data to be processed from the third data node corresponding to the third node address information. Since the third data node is located in the source data cluster, there is a publishing relationship between the producer and the source partition corresponding to the third data node, so the producer can directly obtain the data to be processed from the third data node and process the data to be processed.
[0261] As an optional implementation example, when the producer, source data node, and server interact with each other, and the data in the source data cluster is being migrated, see Figure 4 ,like Figure 4 As shown, the producer sends the third address acquisition request to the source data node of the source data cluster. The source data node determines that the data in the source data cluster is set with migration status information. Therefore, it recognizes that the data write object corresponding to the third address acquisition request is the cluster that is undergoing data migration. The third address acquisition request is forwarded to the server. The server determines that the read and write address of the target data is the address information corresponding to the source data cluster. Based on the address information corresponding to the source data cluster, the server determines the third node address information corresponding to the third address acquisition request, and sends the third node address information to the source data node. The source data node forwards the third node address information to the producer, so that the producer writes data to the corresponding third data node based on the third node address information.
[0262] As an optional embodiment, when the source data node and the server interact, they can interact through the source cluster control node in the source data cluster and the control server in the server cluster, that is, the source data node forwards the third address acquisition request to the source cluster control node, and the source cluster control node forwards the third address acquisition request to the control server. The control server sends the third node address information to the source cluster control node, the source cluster control node forwards the third node address information to the source data node, and the source data node forwards the third node address information to the producer.
[0263] As an optional embodiment, before each data write, the producer will send an address acquisition request to the source data node. In the case where the data in the source data cluster is not provided with migration status information, when the producer of the source data cluster sends an address acquisition request to the source data node in the source data cluster, the source data node can directly send the corresponding node address information to the producer without forwarding it to the server. In the case where the data in the source data cluster is provided with migration status information, regardless of whether the migration status information indicates that the data migration is in progress or that the data migration is completed, the source data node needs to forward the received address acquisition request to the server. In this case, the address acquisition request received when the data migration is completed can be the third address acquisition request or the fourth address acquisition request.
[0264] Before closing the data writing function corresponding to the source data cluster, when the producer writes to a cluster that is undergoing data migration, the producer can forward a third address acquisition request to the server through the source data node, and the server determines that the object being written is in the source data cluster at this time, so that before closing the data writing function corresponding to the source data cluster, the producer can obtain the correct address information and write data normally, so that the producer's business can be smoothly transitioned after the data migration, thereby improving the stability and continuity of the producer's business after the data migration.
[0265] As an alternative embodiment, see Fig.11 After closing the data writing function corresponding to the source data cluster, the method further includes:
[0266] S1110. Receive a fourth address acquisition request sent by the producer based on forwarding by the source data node;
[0267] S1120. When the migration status information of the target data indicates that data migration is completed, based on the address information corresponding to the target data cluster, determine the fourth node address information corresponding to the fourth address acquisition request in the target data cluster;
[0268] S1130. Forward the fourth node address information to the producer based on the source data node, where the fourth node address information is used to instruct the producer to establish a publishing relationship with the fourth data node corresponding to the fourth node address information, and write data to the fourth data node.
[0269] As an optional embodiment, after the data writing function corresponding to the source data cluster is turned off, the producer who is writing data in the source data cluster will receive a preset prompt instruction, which indicates that the data in the source data cluster is abnormal. The producer responds to the preset prompt instruction and regenerates the address acquisition request, which is the fourth address acquisition request. The server receives the fourth address acquisition request forwarded based on the source data node in the source data cluster, and the fourth address acquisition request is sent by the producer to the source data node.
[0270] When the migration status information of the target data is that data migration is completed, the read-write address corresponding to the target data is the address information corresponding to the target data cluster, indicating that the target data is stored in the target data cluster, and the object requested to be written by the producer is also the target data cluster. The server can determine the fourth node address information corresponding to the fourth address acquisition request in the target data cluster based on the address information corresponding to the target data cluster. The server sends the fourth node address information to the source data node, which is forwarded to the producer by the source data node. The producer can then read the data to be processed from the fourth data node corresponding to the fourth node address information. Since the fourth data node is located in the target data cluster, there is no subscription relationship between the producer and the target partition corresponding to the fourth data node. Therefore, the consumer needs to establish a publishing relationship with the target partition corresponding to the fourth data node before it can write data to the fourth data node.
[0271] As an optional implementation example, when the data in the source data cluster has completed data migration, see Figure 4 ,like Figure 4As shown, after the data write function corresponding to the source data cluster is turned off. The producer generates a fourth address acquisition request based on the preset prompt instruction. The producer sends the fourth address acquisition request to the source data node of the source data cluster. The source data node determines that the data in the source data cluster is set with migration status information. Therefore, it is recognized that the data write object corresponding to the fourth address acquisition request is a cluster that is undergoing data migration. The fourth address acquisition request is forwarded to the server. The server determines that the read and write address corresponding to the target data is the address information corresponding to the target data cluster. Based on the address information corresponding to the target data cluster, the server determines the fourth node address information corresponding to the fourth address acquisition request, and sends the fourth node address information to the source data node. The source data node forwards the fourth node address information to the producer, so that the producer writes data to the corresponding fourth data node based on the fourth node address information.
[0272] As an optional embodiment, when the source data node and the server interact, they can interact through the source cluster control node in the source data cluster and the control server in the server cluster, that is, the source data node forwards the fourth address acquisition request to the source cluster control node, and the source cluster control node forwards the fourth address acquisition request to the control server. The control server sends the fourth node address information to the source cluster control node, the source cluster control node forwards the fourth node address information to the source data node, and the source data node forwards the fourth node address information to the producer.
[0273] After closing the data writing function corresponding to the source data cluster, when the producer writes to a cluster that is undergoing data migration, the producer can forward the fourth address acquisition request to the server through the source data node. The server determines that the object being written is in the target data cluster. After the data migration is completed, the producer can obtain the correct address information and write data normally, so that the producer's business can be smoothly transitioned after the data migration, thereby improving the stability and continuity of the producer's business after the data migration.
[0274] As an optional embodiment, a cluster data migration method is shown, which is applied to the target data cluster side. The method includes:
[0275] Based on the data migration progress corresponding to the migrated data, the current migration data is obtained from the target data in the source data cluster, where the current migration data is the difference data between the data migration progress and the data writing progress corresponding to the source data cluster;
[0276] Based on the current migration data, the migrated data and the data migration progress are updated. During the target data migration process, the read and write addresses corresponding to the target data are the address information corresponding to the source data cluster. After the target data migration is completed, the read and write addresses corresponding to the target data are the address information corresponding to the target data cluster.
[0277] As an optional embodiment, a target data cluster is created, and the target data is migrated from the source data cluster to the target data cluster. The target data includes the historical written data of the source data cluster and the data written to the source data cluster by the producer during the data migration process. The source data cluster is the cluster that produces and consumes the target data before the data migration, and the target data cluster is the cluster that produces and consumes the target data after the data migration. Based on the copy mechanism of the consumer queue, the target data cluster can be used as a copy (follower) of the source data cluster to obtain the target data from the source data cluster. During the data migration process, the producer can continue to write data to the source data cluster until the data write function of the source data cluster is turned off.
[0278] As an optional embodiment, since the producer continues to write data to the source data cluster during the data migration process, the data writing progress corresponding to the target data in the source data cluster continues to increase. Each time the data writing progress increases, the progress difference between the data migration progress in the target data cluster and the data writing progress in the source data cluster is determined, and the difference data corresponding to the progress difference is the current migration data.
[0279] As an optional embodiment, the target data cluster is taken as a copy of the source data cluster, and the end displacement (LogEndOffset, LEO) of the data in the target data cluster is taken as the data migration progress. LEO is used to indicate the end position of the data migrated to the target data cluster, and the end position of the data in the source data cluster is taken as the data writing progress. The data progress corresponding to LEO in the source data cluster is determined, so that the difference data corresponding to the progress difference between the data progress and the data writing progress can be obtained, that is, the data between the end position of the data in the source data cluster and the end position of the data in the target data cluster are compared, so that the current migration data can be obtained. Since the corresponding data writing progress written by the producer to the source data cluster corresponds to the data migration progress, after the migration is completed, when the producer writes data to the target data cluster, it can start writing from the data corresponding to the data migration progress.
[0280] As an optional embodiment, in the source data cluster, there is a corresponding relationship between the target data and the source data topic, each source data topic corresponds to at least one data partition, and the target data is stored on the data node corresponding to the target data partition. When performing data migration, a target data topic with the same identification information as the source data topic corresponding to the target data can be created in the target data node, and the target data topic has the same name as the source data topic. The target partition corresponding to the target data topic in the target data cluster pulls data from the source partition corresponding to the source data topic in the source data cluster. After the current migration data is migrated from the source data cluster to the target data cluster, it is stored in the target partition corresponding to the target data topic. The source data topic and the target data topic can be data topics (topics) in the Kafka queue, and the source partition and the target partition can be data partitions (partitions) in the Kafka queue.
[0281] As an alternative embodiment, see Fig.12 ,like Fig.12 Cluster B is the target data cluster, cluster A is the source data cluster, and cluster B is a replica of cluster A. The target partition b1 corresponding to the target data topic b of cluster B obtains data from the source partition a1 corresponding to the source data topic a of cluster A, and stores it in the target partition b1 corresponding to the target data topic b.
[0282] Based on the copy mechanism, the target data is migrated from the source data cluster to the target data cluster, so that the target data cluster can be a complete mirror cluster of the source data cluster. The data migration progress corresponds to the data writing progress, thereby avoiding data duplication or data loss during data migration and improving the stability and consistency of data migration.
[0283] As an optional embodiment, Fig.13 The figure shows an interaction flow chart of a target data cluster, a control server and a source data cluster, wherein the control server belongs to a server cluster, and the method includes:
[0284] S1310. The target data cluster obtains target data from the source data cluster in response to the data migration instruction;
[0285] S1320. The control server sets the read / write address corresponding to the target data to the address information corresponding to the source data cluster during the process of migrating the target data in the source data cluster to the target data cluster;
[0286] S1330. The control server turns off the data writing function corresponding to the source data cluster when the target data migration time is longer than the preset migration time, and the preset migration time is the consumption delay time of the data in the source data cluster;
[0287] S1340. When the target data is completely migrated to the target data cluster, the control server updates the read and write addresses corresponding to the target data to address information corresponding to the target data cluster.
[0288] As an optional embodiment, the server may be a server corresponding to a federation architecture, wherein the federation architecture includes multiple data clusters and service clusters, wherein the service cluster includes a data migration service, a metadata service, and a global scheduling service. In the process of executing data migration, a target data cluster is created in the federation architecture, and a data cluster storing target data to be migrated is used as a source data cluster, and a target data subject corresponding to the target data is identified as a migration status, and migration status information corresponding to the target data is obtained.
[0289] The control server in the service cluster migrates the target data from the source data cluster to the target data cluster, and sets the read-write address of the target data to the address information corresponding to the source data cluster. The data address corresponding to the source data cluster can be stored in the metadata service. When the amount of migrated data in the target data cluster is greater than the preset data amount, turn off the data write function corresponding to the source data cluster, and wait for the data migration between the target data cluster and the source data cluster to be completed. After the data migration is completed, start the data write function and the data read function of the target data cluster, and update the read-write address of the target data to the address information corresponding to the target data cluster. The address information corresponding to the target data cluster can be stored in the metadata service. After the data migration is completed, the control server in the service cluster can also update the migration status information corresponding to the target data to the migration completion status.
[0290] Before the target data is completely migrated to the target data cluster, and after the target data is completely migrated to the target data cluster, when the consumer reads the data, since the read data is data with migration status information, when the source data node receives the first address acquisition request or the second address acquisition request sent by the consumer, the first address acquisition request or the second address acquisition request is forwarded to the control server in the service cluster, and the control server determines the read and write address corresponding to the target data from the metadata service, thereby determining the node address information for the consumer to read the data. The control server forwards the node address information to the consumer through the source data node.
[0291] When the consumer receives the node address information for reading data, the data node corresponding to the node address information sends a first progress acquisition request or a second progress acquisition request, and the corresponding data node forwards the first progress acquisition request or the second progress acquisition request to the control server in the service cluster, and the control server starts the global scheduling service, and the global scheduling service determines the source data cluster with the first data processing progress or the source data cluster with the second data processing progress from the database, and obtains the first data processing progress or the second data processing progress. The control server forwards the first data processing progress or the second data processing progress to the consumer through the corresponding data node.
[0292] Before closing the data writing function corresponding to the source data cluster, and after closing the data writing function corresponding to the source data cluster, when generating consumer write data, since the object to be written is the cluster that is undergoing data migration, when the source data node receives the third address acquisition request or the fourth address acquisition request sent by the producer, the third address acquisition request or the fourth address acquisition request is forwarded to the control server of the server cluster, and the control server determines the read-write address corresponding to the target data from the metadata service, thereby determining the node address information of the producer writing data. The control server forwards the node address information to the producer through the source data node.
[0293] As an alternative embodiment, see Fig.14 Each data cluster in the federated architecture includes multiple data nodes and a cluster control node. The cluster control node is used to forward the requests received by each data node to the server. The service cluster also includes multiple servers and a control server. Other servers except the control server can be sub-servers. The control server can be a metadata control server. The metadata control server is used to maintain the metadata information of all data clusters in the federated architecture. The metadata control server can synchronize the metadata information to each sub-server to ensure the consistency of metadata management.
[0294] The disclosed embodiment proposes a cluster data migration method, which includes: in the process of migrating target data from a source data cluster to a target data cluster, setting the read and write addresses of the target data to the address information corresponding to the source data cluster, and after the data migration is completed, updating the read and write addresses of the target data to the address information corresponding to the target data cluster, thereby indicating the location where producers and consumers write data or read data during and after the data migration. In the process of executing data migration, this method can make consumers and producers unaware of the data migration business while executing their respective businesses, so that there is no need for the business party to cooperate in data migration, and the data migration can be performed by the server, without manual operation, reducing labor costs and improving the efficiency of data migration, and can complete the seamless migration of data between clusters.
[0295] Fig.15 FIG. 1 is a block diagram of a cluster data migration device according to an exemplary embodiment. Fig.15 , the device comprises:
[0296] The data address setting module 1510 is configured to set the read / write address corresponding to the target data to the address information corresponding to the source data cluster during the process of migrating the target data in the source data cluster to the target data cluster;
[0297] The write function closing module 1520 is configured to close the data write function corresponding to the source data cluster when the target data migration time is greater than the preset migration time, and the preset migration time is the consumption delay time of the data in the source data cluster;
[0298] The data address updating module 1530 is configured to update the read and write addresses corresponding to the target data to address information corresponding to the target data cluster when the target data is completely migrated to the target data cluster.
[0299] As an optional embodiment, the device further includes:
[0300] A first address request receiving module is configured to execute receiving a first address acquisition request sent by a consumer based on forwarding by a source data node in a source data cluster;
[0301] A first node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, first node address information of the to-be-processed data corresponding to the first address acquisition request in the source data cluster based on the address information corresponding to the source data cluster;
[0302] The first node address information sending module is configured to forward the first node address information to the consumer based on the source data node, where the first node address information is used to instruct the consumer to read the data to be processed from the first data node corresponding to the first node address information.
[0303] As an optional embodiment, the device further includes:
[0304] A first progress acquisition request receiving module is configured to receive a first progress acquisition request sent by a consumer based on forwarding by the first data node;
[0305] A first data processing progress acquisition module is configured to determine a first data processing progress corresponding to a consumer from a source data cluster when the migration status information of the data to be processed is in the data migration process;
[0306] The first data processing progress sending module is configured to forward the first data processing progress to the consumer based on the first data node, where the first data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the first data node.
[0307] As an optional embodiment, the device further includes:
[0308] A second address request receiving module is configured to receive a second address acquisition request sent by a consumer based on forwarding by a source data node;
[0309] A second node address determination module is configured to determine, in a case where the migration status information of the target data is that the data migration is completed, the second node address information of the to-be-processed data corresponding to the second address acquisition request in the target data cluster based on the address information corresponding to the target data cluster;
[0310] The second node address information sending module is configured to forward the second node address information to the consumer based on the source data node, the second node address information is used to indicate that the consumer establishes a subscription relationship with the second data node corresponding to the second node address information, and reads the data to be processed from the second data node.
[0311] As an optional embodiment, the device further includes:
[0312] A second progress acquisition request receiving module is configured to receive a second progress acquisition request sent by a consumer based on forwarding by a second data node;
[0313] A second data processing progress acquisition module is configured to determine the second data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed indicates that the data migration is completed;
[0314] The second data processing progress sending module is configured to forward the second data processing progress to the consumer based on the second data node, and the second data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the second data node.
[0315] As an optional embodiment, the device further includes:
[0316] A third address request receiving module is configured to receive a third address acquisition request sent by a producer based on forwarding by a source data node;
[0317] A third node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, the third node address information corresponding to the third address acquisition request in the target data cluster based on the address information corresponding to the source data cluster;
[0318] The third node address information sending module is configured to forward the third node address information to the producer based on the source data node, and the third node address information is used to instruct the producer to write data to the third data node corresponding to the third node address information.
[0319] As an optional embodiment, the device further includes:
[0320] A fourth address request receiving module is configured to receive a fourth address acquisition request sent by the producer based on forwarding by the source data node;
[0321] a fourth node address determination module configured to determine, in a case where the migration status information of the target data indicates that data migration is completed, fourth node address information corresponding to the fourth address acquisition request in the target data cluster based on the address information corresponding to the target data cluster;
[0322] The fourth node address information sending module is configured to forward the fourth node address information to the producer based on the source data node, the fourth node address information is used to indicate that the producer and the fourth data node corresponding to the fourth node address information establish a publishing relationship, and perform data writing to the fourth data node.
[0323] As an optional embodiment, the write function closing module includes:
[0324] A data processing state determination unit is configured to determine the data processing states corresponding to the source data cluster and the target data cluster respectively when the amount of synchronized data in the target data cluster is greater than a preset amount of data;
[0325] A data synchronization state determination unit, configured to determine a data synchronization state corresponding to a target data cluster;
[0326] The write function closing unit is configured to close the data write function corresponding to the source data cluster when the data processing state is the target processing state and the data synchronization state is the target synchronization state.
[0327] Fig.16 A cluster data migration device is shown according to an exemplary embodiment, the device comprising:
[0328] The current migration data determination module 1610 is configured to execute, based on the data migration progress corresponding to the migrated data, obtaining the current migration data from the target data in the source data cluster, where the current migration data is the difference data between the data migration progress and the data writing progress corresponding to the source data cluster;
[0329] The data migration module 1620 is configured to update the migrated data and data migration progress based on the current migration data. During the target data migration process, the read and write addresses corresponding to the target data are the address information corresponding to the source data cluster. After the target data migration is completed, the read and write addresses corresponding to the target data are the address information corresponding to the target data cluster.
[0330] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0331] Fig.17 FIG. 1 is a block diagram of a cluster data migration system according to an exemplary embodiment. Fig.17 , the system comprises;
[0332] The system includes: a server cluster 1710, a source data cluster 1720 and a target data cluster 1730;
[0333] The server cluster 1710 includes a plurality of servers and a control server, and the control server is electrically connected to each of the plurality of servers;
[0334] The server cluster is electrically connected to the source data cluster based on the control server, and the server cluster is electrically connected to the target data cluster based on the control server;
[0335] The target data cluster is configured to execute, in response to the data migration instruction, obtaining target data from the source data cluster;
[0336] The control server is configured to set the read / write address corresponding to the target data to the address information corresponding to the source data cluster during the process of migrating the target data in the source data cluster to the target data cluster;
[0337] The control server is configured to execute, when the time for migrating the target data is longer than a preset migration time, to close the data writing function corresponding to the source data cluster, where the preset migration time is the consumption delay time of the data in the source data cluster;
[0338] The control server is configured to update the read and write addresses corresponding to the target data to address information corresponding to the target data cluster when the target data is completely migrated to the target data cluster.
[0339] As an optional embodiment, the system further includes: a consumer;
[0340] The source data cluster includes a plurality of source data nodes and a source cluster control node, and the source cluster control node is electrically connected to each of the plurality of source data nodes;
[0341] The control server includes a first address request receiving module, a first node address determining module and a first node address information sending module, the first address request receiving module is electrically connected to the first node address determining module, and the first node address determining module is electrically connected to the first node address information sending module;
[0342] The consumer is configured to execute a first address acquisition request to the source data node
[0343] The source data node is configured to forward the first address acquisition request to the source cluster control node;
[0344] The source cluster control node is configured to execute sending a first address acquisition request to the control server;
[0345] The first address request receiving module is configured to receive a first address acquisition request sent by a consumer based on forwarding by a source data node in a source data cluster;
[0346] The first node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, first node address information of the to-be-processed data corresponding to the first address acquisition request in the source data cluster based on the address information corresponding to the source data cluster;
[0347] The first node address information sending module is configured to send the first node address information to the source cluster control node;
[0348] The source cluster control node is configured to forward the first node address information to the source data node;
[0349] The source data node is configured to forward the first node address information to the consumer;
[0350] The consumer is configured to read the data to be processed from the first data node corresponding to the first node address information.
[0351] As an optional embodiment, the control server further includes a first progress acquisition request receiving module, a first data processing progress acquisition module and a first data processing progress sending module;
[0352] The first progress acquisition request receiving module is electrically connected to the first data processing progress acquisition module;
[0353] The first data processing progress acquisition module is electrically connected to the first data processing progress sending module:
[0354] The consumer is configured to execute sending a first progress acquisition request to the first data node;
[0355] The first data node is configured to execute a first progress acquisition request forwarded to the source cluster control node;
[0356] The source cluster control node is configured to execute forwarding the first progress acquisition request to the control server;
[0357] The first progress acquisition request receiving module is configured to receive a first progress acquisition request sent by a consumer based on forwarding by the first data node;
[0358] The first data processing progress acquisition module is configured to determine the first data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed is in the data migration process;
[0359] The first data processing progress sending module is configured to send the first data processing progress to the source cluster control node;
[0360] The source cluster control node is configured to execute sending a first data processing progress to the first data node;
[0361] The first data node is configured to execute forwarding a first data processing progress to a consumer;
[0362] The consumer is configured to determine the data to be processed from the data stored in the first data node based on the first data processing progress.
[0363] As an optional embodiment, the control server further includes: a second address request receiving module, a second node address determining module and a second node address information sending module;
[0364] The second address request receiving module is electrically connected to the second node address determining module;
[0365] The second node address determination module is electrically connected to the second node address information sending module;
[0366] The target data cluster includes a plurality of target data nodes and a target data cluster control node, and the target data cluster control node is electrically connected to each of the plurality of target data nodes;
[0367] The consumer is configured to execute sending a second address acquisition request to the source data node;
[0368] The source data node is configured to execute and receive a second address acquisition request sent by the consumer, and forward the second address acquisition request to the source cluster control node;
[0369] The source cluster control node is configured to forward the second address acquisition request to the control server;
[0370] The second address request receiving module is configured to receive a second address acquisition request sent by the consumer based on forwarding by the source data node;
[0371] The second node address determination module is configured to determine, in a case where the migration status information of the data corresponding to the to-be-processed data is that the data migration is completed, the second node address information of the to-be-processed data corresponding to the second address acquisition request in the target data cluster based on the address information corresponding to the target data cluster;
[0372] The second node address information sending module is configured to send the second node address information to the source cluster control node;
[0373] The source cluster control node is configured to forward the second node address information to the source data node;
[0374] The source data node is configured to forward the second node address information to the consumer;
[0375] The consumer is configured to establish a subscription relationship with a second data node corresponding to the second node address information, and read the data to be processed from the second data node.
[0376] As an optional embodiment, the control server further includes: a second progress acquisition request receiving module, a second data processing progress acquisition module and a second data processing progress sending module;
[0377] The second progress acquisition request receiving module is electrically connected to the second data processing progress acquisition module;
[0378] The second data processing progress acquisition module is electrically connected to the second data processing progress sending module;
[0379] The consumer is configured to execute sending a second progress acquisition request to the second data node;
[0380] The second data node is configured to forward the second progress acquisition request to the target cluster control node;
[0381] The target cluster control node is configured to forward the second progress acquisition request to the control server;
[0382] The second progress acquisition request receiving module is configured to receive a second progress acquisition request sent by the consumer based on forwarding by the second data node;
[0383] The second data processing progress acquisition module is configured to determine the second data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed indicates that data migration is completed;
[0384] The second data processing progress sending module is configured to execute sending the second data processing progress to the target cluster control node;
[0385] The target cluster control node is configured to forward the second data processing progress to the second data node;
[0386] The second data node is configured to execute forwarding a second data processing progress to the consumer;
[0387] The consumer is configured to determine the data to be processed from the data stored in the second data node based on the second data processing progress.
[0388] As an optional embodiment, the system further includes: a producer;
[0389] The control server further includes: a third address request receiving module, a third node address determining module and a third node address information sending module;
[0390] The third address request receiving module is electrically connected to the third node address determining module;
[0391] The third node address determination module is electrically connected to the third node address information sending module;
[0392] The producer is configured to execute sending a third address acquisition request to the source data node;
[0393] The source data node is configured to forward the third address acquisition request to the source cluster control node;
[0394] The source cluster control node is configured to forward the third address acquisition request to the control server;
[0395] The third address request receiving module is configured to receive a third address acquisition request sent by the producer based on forwarding by the source data node;
[0396] The third node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, the third node address information corresponding to the third address acquisition request in the target data cluster based on the address information corresponding to the source data cluster;
[0397] The third node address information sending module is configured to send the third node address information to the source cluster control node;
[0398] The source cluster control node is configured to forward the third node address information to the source data node;
[0399] The source data node is configured to forward the third node address information to the producer;
[0400] The producer is configured to write data to the third data node corresponding to the third node address information.
[0401] As an optional embodiment, the control server further includes: a fourth address request receiving module, a fourth node address determining module and a fourth node address information sending module;
[0402] The fourth address request receiving module is electrically connected to the fourth node address determining module;
[0403] The fourth node address determination module is electrically connected to the fourth node address information sending module;
[0404] The producer is configured to execute sending a fourth address acquisition request to the source data node;
[0405] The source data node is configured to forward the fourth address acquisition request to the source cluster control node;
[0406] The source cluster control node is configured to forward the fourth address acquisition request to the control server;
[0407] The fourth address request receiving module is configured to receive a fourth address acquisition request sent by the producer based on forwarding by the source data node;
[0408] The fourth node address determination module is configured to determine, in a case where the migration status information of the target data is that the data migration is completed, the fourth node address information corresponding to the fourth address acquisition request in the target data cluster based on the address information corresponding to the target data cluster;
[0409] The fourth node address information sending module is configured to send the fourth node address information to the source data control node;
[0410] The source data control node is configured to forward the fourth node address information to the source data node;
[0411] The source data node is configured to forward the fourth node address information to the producer;
[0412] The production is configured to establish a publishing relationship with a fourth data node corresponding to the fourth node address information, and write data to the fourth data node.
[0413] As an optional embodiment, the system further includes:
[0414] The target data cluster is configured to execute based on the data migration progress, obtain the current migration data from the target data, and the current migration data is the difference data between the data migration progress in the target data cluster and the data writing progress corresponding to the data in the source data cluster.
[0415] As an optional embodiment, the control server further includes: a write function closing module, the write function closing module includes: a data processing state determining unit, a data synchronization state determining unit and a write function closing unit;
[0416] The data processing state determination unit is electrically connected to the data synchronization state determination unit;
[0417] The data synchronization state determination unit is electrically connected to the write function closing unit;
[0418] A data processing state determination unit is configured to determine the data processing states corresponding to the source data cluster and the target data cluster respectively when the target data migration time is greater than a preset migration time;
[0419] A data synchronization status determination unit, configured to determine a data migration status corresponding to a target data cluster;
[0420] The write function closing unit is configured to close the data write function corresponding to the source data cluster when the data processing state is the target processing state and the data migration state is the target migration state.
[0421] As an optional embodiment, the target data cluster is configured to execute in response to the data migration instruction, and obtaining the target data from the source data cluster includes:
[0422] The target data cluster is configured to execute in response to the data migration instruction, determine the current migration data from the target data based on the data migration progress, and the current migration data is the difference data between the data migration progress in the target data cluster and the data writing progress corresponding to the data in the source data cluster;
[0423] The target data cluster is configured to perform migration of current migration data from the source data cluster to the target data cluster.
[0424] Regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0425] Fig.18 is a block diagram of an electronic device for cluster data migration according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig.18 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cluster data migration method is implemented.
[0426] Those skilled in the art will understand that Fig.18 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0427] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1804 including instructions, and the instructions can be executed by a processor 1820 of an electronic device 1800 to perform the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0428] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the above-mentioned cluster data migration method is implemented.
[0429] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0430] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A cluster data migration method, characterized in that: The method comprises: During the migration of target data from the source data cluster to the target data cluster, setting the read / write address corresponding to the target data to the address information corresponding to the source data cluster; When the target data migration time is longer than a preset migration time, determining the data processing states corresponding to the source data cluster and the target data cluster, respectively, wherein the preset migration time is the consumption delay time of the data in the source data cluster; Determine the data migration status corresponding to the target data cluster; When the data processing state is the target processing state, and the data migration state is the target migration state, the data writing function corresponding to the source data cluster is turned off, the target processing state is that the data in the source data cluster and the data in the target data cluster are in a queue state, and the target migration state is that no delay occurs when the target data is migrated from the source data cluster to the target data cluster; when the target data is completely migrated to the target data cluster, the read and write addresses corresponding to the target data are updated to the address information corresponding to the target data cluster; Before the target data is completely migrated to the target data cluster, the method further includes: Receiving a first address acquisition request sent by a consumer based on forwarding by a source data node in the source data cluster; In a case where the migration status information of the target data is in the process of data migration, based on the address information corresponding to the source data cluster, determining, in the source data cluster, first node address information of to-be-processed data corresponding to the first address acquisition request, the to-be-processed data being data in the target data for which the migration status information is set; The first node address information is forwarded to the consumer based on the source data node, where the first node address information is used to instruct the consumer to read the data to be processed from the first data node corresponding to the first node address information.
2. The cluster data migration method according to claim 1, characterized in that: After sending the first node address information to the data node of the source data cluster and forwarding the first node address information to the consumer through the source data node, the method further includes: receiving a first progress acquisition request sent by the consumer based on forwarding by the first data node; In a case where the migration status information of the data to be processed indicates that the data is in the process of data migration, determining a first data processing progress corresponding to the consumer from the source data cluster; The first data processing progress is forwarded to the consumer based on the first data node, where the first data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the first data node.
3. The cluster data migration method according to claim 1, characterized in that: After the target data is completely migrated to the target data cluster, the method further includes: Receiving a second address acquisition request sent by the consumer based on forwarding by the source data node; In a case where the migration status information of the target data indicates that data migration is completed, determining, in the target data cluster, second node address information of the to-be-processed data corresponding to the second address acquisition request; The second node address information is forwarded to the consumer based on the source data node, and the second node address information is used to instruct the consumer to establish a subscription relationship with the second data node corresponding to the second node address information, and read the data to be processed from the second data node.
4. The cluster data migration method according to claim 3, characterized in that: After sending the second node address information to the data node of the source data cluster and forwarding the second node address information to the consumer through the source data node, the method further includes: receiving a second progress acquisition request sent by the consumer based on forwarding by the second data node; When the migration status information of the data to be processed indicates that data migration is completed, determining a second data processing progress corresponding to the consumer from the source data cluster; The second data processing progress is forwarded to the consumer based on the second data node, where the second data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the second data node.
5. The cluster data migration method according to claim 1, characterized in that: Before disabling the data writing function corresponding to the source data cluster, the method further includes: Receive a third address acquisition request sent by the producer based on the forwarding of the source data node; In a case where the migration status information of the target data is in the process of data migration, determining, in the target data cluster, the third node address information corresponding to the third address acquisition request based on the address information corresponding to the source data cluster; Based on the source data node forwarding the third node address information to the producer, the third node address information is used to instruct the producer to perform data writing to the third data node corresponding to the third node address information.
6. The cluster data migration method according to claim 5, characterized in that: After disabling the data writing function corresponding to the source data cluster, the method further includes: Receiving a fourth address acquisition request sent by the producer based on forwarding by the source data node; In a case where the migration status information of the target data indicates that data migration is completed, determining, in the target data cluster, address information of a fourth node corresponding to the fourth address acquisition request based on the address information corresponding to the target data cluster; The fourth node address information is forwarded to the producer based on the source data node, and the fourth node address information is used to instruct the producer to establish a publishing relationship with the fourth data node corresponding to the fourth node address information, and to write data to the fourth data node.
7. A cluster data migration control device, characterized in that: The device comprises: A data address setting module is configured to set the read / write address corresponding to the target data to the address information corresponding to the source data cluster during the process of migrating the target data in the source data cluster to the target data cluster; A data processing state determination unit is configured to determine the data processing states corresponding to the source data cluster and the target data cluster respectively when the time for migrating the target data is greater than a preset migration time, wherein the preset migration time is a consumption delay time of the data in the source data cluster; A data synchronization status determination unit, configured to determine a data migration status corresponding to the target data cluster; a write function closing unit, configured to close the data write function corresponding to the source data cluster when the data processing state is a target processing state and the data synchronization state is a target migration state, the target processing state is that the data in the source data cluster and the data in the target data cluster are in a queue state, and the target migration state is that no delay occurs when migrating the target data from the source data cluster to the target data cluster; a data address updating module, configured to execute, when the target data is completely migrated to the target data cluster, updating the read and write addresses corresponding to the target data to address information corresponding to the target data cluster; The device also includes: A first address request receiving module is configured to receive a first address acquisition request sent by a consumer based on forwarding by a source data node in the source data cluster; A first node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, first node address information of the to-be-processed data corresponding to the first address acquisition request in the source data cluster based on the address information corresponding to the source data cluster; The first node address information sending module is configured to forward the first node address information to the consumer based on the source data node, wherein the first node address information is used to instruct the consumer to read the data to be processed from the first data node corresponding to the first node address information.
8. The cluster data migration control device according to claim 7, characterized in that: The device also includes: A first progress acquisition request receiving module is configured to receive a first progress acquisition request sent by the consumer based on forwarding by the first data node; A first data processing progress acquisition module is configured to determine, from the source data cluster, a first data processing progress corresponding to the consumer when the migration status information of the data to be processed is in the data migration process; The first data processing progress sending module is configured to forward the first data processing progress to the consumer based on the first data node, where the first data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the first data node.
9. The cluster data migration control device according to claim 8, characterized in that: The device also includes: A second address request receiving module is configured to receive a second address acquisition request sent by the consumer based on forwarding by the source data node; A second node address determination module is configured to determine, in a case where the migration status information of the target data is that data migration is completed, second node address information of the to-be-processed data corresponding to the second address acquisition request in the target data cluster based on the address information corresponding to the target data cluster; The second node address information sending module is configured to forward the second node address information to the consumer based on the source data node, the second node address information is used to indicate that a subscription relationship is established between the consumer and the second data node corresponding to the second node address information, and the data to be processed is read from the second data node.
10. The cluster data migration control device according to claim 9, characterized in that: The device also includes: A second progress acquisition request receiving module is configured to receive a second progress acquisition request sent by the consumer based on forwarding by the second data node; A second data processing progress acquisition module is configured to determine the second data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed indicates that data migration is completed; The second data processing progress sending module is configured to forward the second data processing progress to the consumer based on the second data node, where the second data processing progress is used to instruct the consumer to determine the data to be processed from the data stored in the second data node.
11. The cluster data migration control device according to claim 7, characterized in that: The device also includes: A third address request receiving module is configured to receive a third address acquisition request sent by a producer based on forwarding by a source data node; A third node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, the third node address information corresponding to the third address acquisition request in the target data cluster based on the address information corresponding to the source data cluster; The third node address information sending module is configured to forward the third node address information to the producer based on the source data node, and the third node address information is used to instruct the producer to write data to the third data node corresponding to the third node address information.
12. The cluster data migration control device according to claim 11, characterized in that: The device also includes: A fourth address request receiving module is configured to receive a fourth address acquisition request sent by the producer based on forwarding by a source data node; A fourth node address determination module is configured to determine, in a case where the migration status information of the target data indicates that data migration is completed, fourth node address information corresponding to the fourth address acquisition request in the target data cluster based on the address information corresponding to the target data cluster; The fourth node address information sending module is configured to forward the fourth node address information to the producer based on the source data node, the fourth node address information is used to indicate that the producer and the fourth data node corresponding to the fourth node address information establish a publishing relationship, and perform data writing to the fourth data node.
13. A cluster data migration system, characterized in that: The system comprises: a server cluster, a source data cluster and a target data cluster; The server cluster includes a plurality of servers and a control server, wherein the control server is electrically connected to each of the plurality of servers; The server cluster is electrically connected to the source data cluster based on the control server, and the server cluster is electrically connected to the target data cluster based on the control server; The target data cluster is configured to execute, in response to the data migration instruction, to obtain target data from the source data cluster; The control server is configured to set the read / write address corresponding to the target data to the address information corresponding to the source data cluster during the process of migrating the target data in the source data cluster to the target data cluster; The control server is configured to determine the data processing states corresponding to the source data cluster and the target data cluster respectively when the time for migrating the target data is greater than a preset migration time, and the preset migration time is a consumption delay time of the data in the source data cluster; The control server is configured to determine a data migration status corresponding to the target data cluster; The control server is configured to execute, when the data processing state is a target processing state and the data migration state is a target migration state, closing the data writing function corresponding to the source data cluster, the target processing state is that the data in the source data cluster and the data in the target data cluster are in a queue state, and the target migration state is that no delay occurs when migrating the target data from the source data cluster to the target data cluster; The control server is configured to execute, when the target data is completely migrated to the target data cluster, updating the read and write addresses corresponding to the target data to address information corresponding to the target data cluster; The system further comprises: a consumer; The consumer is configured to execute sending a first address acquisition request to a source data node; The source data node is configured to forward the first address acquisition request to the source cluster control node; The source cluster control node is configured to execute sending the first address acquisition request to the control server; The first address request receiving module is configured to receive a first address acquisition request sent by the consumer based on forwarding by a source data node in the source data cluster; The first node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, first node address information of the to-be-processed data corresponding to the first address acquisition request in the source data cluster based on the address information corresponding to the source data cluster; The first node address information sending module is configured to send the first node address information to the source cluster control node; The source cluster control node is configured to forward the first node address information to the source data node; The source data node is configured to forward the first node address information to the consumer; The consumer is configured to read the data to be processed from the first data node corresponding to the first node address information.
14. The cluster data migration system according to claim 13, characterized in that: The control server also includes a first progress acquisition request receiving module, a first data processing progress acquisition module and a first data processing progress sending module; The first progress acquisition request receiving module is electrically connected to the first data processing progress acquisition module; The first data processing progress acquisition module is electrically connected to the first data processing progress sending module: The consumer is configured to execute sending a first progress acquisition request to the first data node; The first data node is configured to execute a first progress acquisition request forwarded to the source cluster control node; The source cluster control node is configured to forward the first progress acquisition request to the control server; The first progress acquisition request receiving module is configured to receive a first progress acquisition request sent by the consumer based on forwarding by the first data node; The first data processing progress acquisition module is configured to determine the first data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed is in the data migration process; The first data processing progress sending module is configured to send the first data processing progress to the source cluster control node; The source cluster control node is configured to send the first data processing progress to the first data node; The first data node is configured to forward the first data processing progress to the consumer; The consumer is configured to determine the data to be processed from the data stored in the first data node based on the first data processing progress.
15. The cluster data migration system according to claim 13, characterized in that: The control server further comprises: a second address request receiving module, a second node address determining module, and a second node address information sending module; The second address request receiving module is electrically connected to the second node address determining module; The second node address determination module is electrically connected to the second node address information sending module; The target data cluster includes a plurality of target data nodes and a target data cluster control node, and the target data cluster control node is electrically connected to each of the plurality of target data nodes; The consumer is configured to execute sending a second address acquisition request to the source data node; The source data node is configured to receive a second address acquisition request sent by the consumer, and forward the second address acquisition request to the source cluster control node; The source cluster control node is configured to forward the second address acquisition request to the control server; The second address request receiving module is configured to receive a second address acquisition request sent by the consumer based on forwarding by the source data node; The second node address determination module is configured to determine, in a case where the migration status information of the data corresponding to the to-be-processed data is that data migration is completed, based on the address information corresponding to the target data cluster, the second node address information of the to-be-processed data corresponding to the second address acquisition request in the target data cluster; The second node address information sending module is configured to send the second node address information to the source cluster control node; The source cluster control node is configured to forward the second node address information to the source data node; The source data node is configured to forward the second node address information to the consumer; The consumer is configured to establish a subscription relationship with a second data node corresponding to the second node address information, and read the data to be processed from the second data node.
16. The cluster data migration system according to claim 15, characterized in that: The control server further comprises: a second progress acquisition request receiving module, a second data processing progress acquisition module, and a second data processing progress sending module; The second progress acquisition request receiving module is electrically connected to the second data processing progress acquisition module; The second data processing progress acquisition module is electrically connected to the second data processing progress sending module; The consumer is configured to execute sending a second progress acquisition request to the second data node; The second data node is configured to forward the second progress acquisition request to the target cluster control node; The target cluster control node is configured to forward the second progress acquisition request to the control server; The second progress acquisition request receiving module is configured to receive a second progress acquisition request sent by the consumer based on forwarding by the second data node; The second data processing progress acquisition module is configured to determine the second data processing progress corresponding to the consumer from the source data cluster when the migration status information of the data to be processed indicates that data migration is completed; The second data processing progress sending module is configured to send the second data processing progress to the target cluster control node; The target cluster control node is configured to forward the second data processing progress to the second data node; The second data node is configured to forward the second data processing progress to the consumer; The consumer is configured to determine the data to be processed from the data stored in the second data node based on the second data processing progress.
17. The cluster data migration system according to claim 13, characterized in that: The system further comprises: a producer; The control server further comprises: a third address request receiving module, a third node address determining module and a third node address information sending module; The third address request receiving module is electrically connected to the third node address determining module; The third node address determination module is electrically connected to the third node address information sending module; The producer is configured to execute sending a third address acquisition request to the source data node; The source data node is configured to forward the third address acquisition request to the source cluster control node; The source cluster control node is configured to forward the third address acquisition request to the control server; The third address request receiving module is configured to receive a third address acquisition request sent by the producer based on forwarding by the source data node; The third node address determination module is configured to determine, in a case where the migration state information of the target data is in the data migration process, the third node address information corresponding to the third address acquisition request in the target data cluster based on the address information corresponding to the source data cluster; The third node address information sending module is configured to send the third node address information to the source cluster control node; The source cluster control node is configured to forward the third node address information to the source data node; The source data node is configured to forward the third node address information to the producer; The producer is configured to write data to a third data node corresponding to the third node address information.
18. The cluster data migration system according to claim 17, characterized in that: The control server further comprises: a fourth address request receiving module, a fourth node address determining module and a fourth node address information sending module; The fourth address request receiving module is electrically connected to the fourth node address determining module; The fourth node address determination module is electrically connected to the fourth node address information sending module; The producer is configured to execute sending a fourth address acquisition request to the source data node; The source data node is configured to forward the fourth address acquisition request to the source cluster control node; The source cluster control node is configured to forward the fourth address acquisition request to the control server; The fourth address request receiving module is configured to receive a fourth address acquisition request sent by the producer based on forwarding by the source data node; The fourth node address determination module is configured to determine, in a case where the migration status information of the target data indicates that data migration is completed, the fourth node address information corresponding to the fourth address acquisition request in the target data cluster based on the address information corresponding to the target data cluster; The fourth node address information sending module is configured to send the fourth node address information to the source data control node; The source data control node is configured to forward the fourth node address information to the source data node; The source data node is configured to forward the fourth node address information to the producer; The producer is configured to establish a publishing relationship with a fourth data node corresponding to the fourth node address information, and write data to the fourth data node.
19. The cluster data migration system according to claim 13, characterized in that: The system further comprises: The target data cluster is configured to execute, based on the data migration progress, obtaining current migration data from the target data, wherein the current migration data is difference data between the data migration progress in the target data cluster and the data writing progress corresponding to the data in the source data cluster.
20. The cluster data migration system according to claim 13, characterized in that: The target data cluster is configured to execute in response to the data migration instruction, and obtaining the target data from the source data cluster includes: The target data cluster is configured to execute, in response to the data migration instruction, determine current migration data from the target data based on the data migration progress, the current migration data being difference data between the data migration progress in the target data cluster and the data writing progress corresponding to the data in the source data cluster; The target data cluster is configured to perform migration of the current migration data from the source data cluster to the target data cluster.
21. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instruction to implement the cluster data migration control method according to any one of claims 1 to 6.
22. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the cluster data migration control method according to any one of claims 1 to 6.
