Data synchronization method and device under head file system migration, electronic equipment and storage medium

By automatically updating data synchronization rules when the head node fails, the data loss problem caused by data migration is solved, the reliability and high availability of data synchronization are ensured, and the efficiency of data replication is improved.

CN120743850APending Publication Date: 2025-10-03INFORMATION2 SOFTWARE SHANGHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510829415.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-10-03

Smart Images

  • Figure CN120743850A_ABST
    Figure CN120743850A_ABST
Patent Text Reader

Abstract

The invention discloses a data synchronization method and device under head file system migration, electronic equipment and a storage medium. The method comprises the following steps: determining first rule information of first information; determining a migration node identifier according to the first information; changing the first rule information according to the migration node identifier to obtain second rule information; and the second machine head node synchronously copies the data generated by the file system according to the second rule information. According to the method, the first rule information is changed according to the migration node identifier to obtain the second rule information, and the rule information is updated, so that the risk of data loss is avoided while the security of data synchronous replication is ensured after the head node migration occurs. Furthermore, when the head node fails, automatic updating of the rule information is realized, manual intervention is avoided, and high availability of data replication is improved while the efficiency of synchronous data replication is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of disaster recovery backup and security technology, and in particular to a data synchronization method, device, electronic device and storage medium under head file system migration. Background Art

[0002] NAS file systems are usually mounted on the target machine through protocols such as NFS. To ensure that data is not lost when NAS storage is damaged, the file system will be replicated and synchronized and backed up to other machines.

[0003] To ensure high availability of production services, machines that mount file systems are often deployed in clusters, consisting of multiple head nodes forming a load-balancing cluster (functional zone). Each cluster (functional zone) can be divided into multiple availability zones, each of which contains multiple head nodes. Each head node mounts multiple file systems, and each head node is responsible for the I / O of the file systems mounted on it.

[0004] When a head node within a cluster (functional area) fails, the file system on the failed head node is migrated to another surviving head node within the cluster. At the same time, the normally operating head file system may also be manually switched and migrated. The backup rule tasks for data replication and synchronization are based on the file system and run on the head node. When the head node fails or is manually switched, the file system is migrated to another head node, causing the data replication and synchronization rules to become invalid, the backup task to be interrupted, and the subsequent risk of data loss. Generally, interrupted backup tasks require manual intervention and reconfiguration, which is time-consuming and cannot guarantee continuous data replication and high availability of data replication. Summary of the Invention

[0005] The present invention provides a data synchronization method, device, electronic device and storage medium under head file system migration to solve the problem that data loss is easily caused when data migration is performed when a head node fails.

[0006] According to one aspect of the present invention, a method for synchronizing data during migration of a head file system is provided, comprising:

[0007] Determine first rule information for first information; the first information is used to represent event information generated when the first head node is migrated; the first head node is a head node that fails and cannot be mounted by the file system; the head node is a device responsible for resource allocation and task scheduling in the cluster system; the first rule information is a rule for the first head node to synchronously copy data to devices in the cluster system;

[0008] Determine the migration node identifier according to the first information; the migration node identifier is the node identifier corresponding to the second head node; the second head node is the head node after the file system is migrated from the first head node;

[0009] The first rule information is modified according to the migration node identifier to obtain second rule information; the second rule information is a rule for the second head node to synchronously replicate data to a device in the cluster system;

[0010] The second head node synchronously replicates the data generated by the file system according to the second rule information.

[0011] According to another aspect of the present invention, there is provided a data copying device for head file system migration, comprising:

[0012] A first rule information determination module is used to determine first rule information of first information; the first information is used to represent event information generated when the first head node is migrated; the first head node is a head node that fails and cannot be mounted by the file system; the head node is a device responsible for resource allocation and task scheduling in the cluster system; the first rule information is a rule for the first head node to synchronously copy data to devices in the cluster system;

[0013] A migration node identifier determination module is configured to determine a migration node identifier based on the first information; the migration node identifier is a node identifier corresponding to a second head node; the second head node is a head node after the file system is migrated from the first head node;

[0014] A second rule information determination module is configured to modify the first rule information according to the migration node identifier to obtain second rule information; the second rule information is a rule for synchronously replicating data from the second head node to a device in the cluster system;

[0015] A data replication module is used for the second head node to synchronously replicate the data generated by the file system according to the second rule information.

[0016] According to another aspect of the present invention, an electronic device is provided, comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data synchronization method under the head file system migration described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data synchronization method under the head file system migration described in any embodiment of the present invention when executed.

[0021] The technical solution of the embodiment of the present invention determines the first rule information of the first information; determines the migration node identifier based on the first information; changes the first rule information based on the migration node identifier to obtain the second rule information, and the determination of the second rule information can assist the second head node in performing data synchronization replication and enhance the reliability of data synchronization replication; the second head node performs synchronization replication on the data generated by the file system based on the second rule information, which can enhance the reliability of data synchronization replication. This method changes the first rule information based on the migration node identifier to obtain the second rule information. The update of the rule information can ensure the security of data synchronization replication after the head node migration occurs, while also avoiding the risk of data loss. Furthermore, since the rule information is automatically updated when a head node failure occurs, manual intervention is avoided, the efficiency of data synchronization replication is improved, and the high availability of data replication is also improved.

[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A flowchart of a data synchronization method for head file system migration provided by an embodiment of the present invention;

[0025] Figure 2 A flowchart of another data synchronization method for head file system migration provided by an embodiment of the present invention;

[0026] Figure 3 A schematic structural diagram of a data synchronization device for head file system migration provided by an embodiment of the present invention;

[0027] Figure 4A schematic structural diagram of an electronic device for implementing a data synchronization method under head file system migration according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention 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 numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Figure 1 This is a flow chart of a data synchronization method for head file system migration provided by an embodiment of the present invention. This embodiment is applicable to the case of synchronously replicating data when a head node fails. The method can be executed by a data replication device for head file system migration. The data replication device for head file system migration can be implemented in the form of hardware and / or software. The data replication device for head file system migration can be configured in any electronic device with network communication function. Figure 1 As shown, the method includes:

[0031] S110: Determine first rule information of the first information.

[0032] The first information is used to represent event information generated when the first head node is migrated. The first head node is a head node that fails and cannot be mounted by the file system. The head node is a device responsible for resource allocation and task scheduling in the cluster system.

[0033] The first rule information is a rule for the first head node to synchronously copy data to devices in the cluster system.

[0034] The first information is information recording a file system migration event generated by the first head node after the file system migration is performed.

[0035] Furthermore, the first information includes a file system identifier, a time when the file system migration occurs, and a time when the file system migration is completed.

[0036] The file system is mounted on the first head node, and the file data generated by the first head node is distributedly stored.

[0037] Furthermore, the type of the file system mounted on the first head node depends on the operating system configured on the first head node.

[0038] For example, if the operating system is a Windows system, the file system may adopt a CIFS (Common Internet File System) file system; if the operating system is a Unix or Linux system, the file system may adopt a NAS (Network Attached Storage) file system.

[0039] The replication rule is used to characterize the order in which the first head node replicates data to its lower-level devices.

[0040] Furthermore, since the first head node is responsible for allocating resources and scheduling tasks for the lower-level devices, there is at least one replication rule, and thus the first rule information is a set of replication rules.

[0041] Specifically, first information is retrieved from a binary log table. Based on the first information, corresponding migration information is matched from a file system migration table. Based on the migration information, a head node identifier of a first head node to which the first head node is attached is determined. Based on the migration information and the first head node identifier, a corresponding data replication rule is retrieved from a database. The obtained replication rule is used as first rule information.

[0042] The binary log table is used to store events generated by the file system migration table according to the file system migration information.

[0043] The migration information at least includes: a file system, a first head node identifier, and a second head node identifier.

[0044] Furthermore, the migration information is stored in a database in the form of a dictionary, that is, dict = {file system 1 - first migration information; file system 2 - second migration information; ...}, wherein the database may be a MySQL database.

[0045] The file system migration table is used to store event information generated when file system migration occurs on different head nodes.

[0046] Furthermore, the storage method is file system identifier-event information.

[0047] Furthermore, after obtaining the first rule information, the first rule information is added to the table of data to be changed.

[0048] The event table to be changed is used to record rule information that needs to be changed.

[0049] Furthermore, after obtaining the first rule information, in order to prevent the first head node from continuing to perform data synchronous replication according to the first rule information, the first rule information is stopped.

[0050] Furthermore, the determination of the first information can be achieved by a monitoring module, such as Figure 2 As shown, the monitoring module monitors the binlog of MySQL in real time, filters the insert events generated by the file system migration table in the binlog, that is, the first information; retrieves the corresponding migration information from the database according to the record information in the insert event, and matches the data replication synchronization rules from the database through the first head node identifier, that is, the first rule information.

[0051] S120: Determine a migration node identifier according to the first information.

[0052] The migration node identifier is the node identifier corresponding to the second head node.

[0053] The second head node is the head node after the file system is migrated from the first head node.

[0054] Specifically, a file system identifier is obtained according to the first information; migration information is matched from a database according to the file system identifier, a second head node identifier is obtained according to the migration information, and the second head node identifier is used as the migration node identifier.

[0055] S130: Change the first rule information according to the migration node identifier to obtain second rule information.

[0056] The second rule information is a rule for the second head node to synchronously copy data to the devices in the cluster system.

[0057] Specifically, the first head node identifier is traversed for the first rule information, and the location information of the first head node identifier found is recorded. The first head node identifier in the first rule information is replaced by the migration node identifier according to the location information. After the replacement is completed, the second rule information is obtained.

[0058] Furthermore, before performing the first head node identification traversal, it is necessary to verify the number of changes, that is, if the number of changes is less than the preset number of changes, the first head node identification traversal is performed; if the number of changes is greater than or equal to the preset number of changes, the first rule information change is marked as failed.

[0059] S140. The second head node synchronously replicates the data generated by the file system according to the second rule information.

[0060] Specifically, the second rule information is sent to the second head node, and the second head node performs data synchronization replication on its lower-level devices according to the replication rule provided in the second rule information.

[0061] Furthermore, before performing data synchronization replication according to the replication rule, it is necessary to determine whether the second rule information has been successfully delivered. Specifically, if the second rule information is delivered successfully, the pending change event corresponding to the first rule information is deleted from the pending change data table. If the delivery fails, the change status of the pending change event corresponding to the first rule information is changed to pending change, and the change count is incremented by 1.

[0062] Exemplarily, the first rule information change is implemented by a change module, such as Figure 2 As shown, the change module queries in real time whether there is a new data replication rule to be changed in the data table to be changed, and takes out the status rule to be changed corresponding to the data replication rule to be changed. Compare the number of changes corresponding to the status rule to be changed with the preset number of changes. If it is greater than the preset number of changes, the change fails. If it is less than the preset number of changes, the data replication rule to be changed is changed, and the corresponding change event in the data table to be changed is deleted, and the changed rule, that is, the second rule information, is sent to the second head node. If the rule fails to be sent, the number of changes is increased by one. Among them, the data replication rule to be changed is the first rule information in the text; the status rule to be changed is the change status.

[0063] The above steps replicate data using the modified rule information, which can achieve continuous data replication while ensuring high availability of data replication.

[0064] Optionally, determining first rule information of the first information includes steps A1-A2:

[0065] Step A1: Match corresponding migration information from the file system migration table according to the first information.

[0066] Specifically, the binary log table is checked for a migration event, and if so, first information corresponding to the migration event is obtained. Based on the first information, migration information corresponding to the file system identifier recorded in the first information is matched in the file system migration table.

[0067] Step A2: Match the corresponding first rule information from the database according to the migration information.

[0068] Specifically, the first head node identifier is obtained according to the migration information, and the corresponding first rule information is matched from the database according to the first head node identifier.

[0069] Furthermore, if the first rule information exists, the first rule information is added to the table of information to be changed. If the first rule information does not exist, an information missing warning is issued.

[0070] The head node identification and rule information are stored in the database in a dictionary-corresponding manner, that is, dict={first head node: first rule information, second head node: second rule information: ...}.

[0071] The above step of matching the corresponding first rule information from the database can ensure the integrity of the obtained first rule information, and the first rule information will not be accidentally modified or lost.

[0072] Optionally, at least one method for determining the first information includes steps B1-B3:

[0073] Step B1: When a first head node fails, the file system mounted on the first head node is migrated to the second head node.

[0074] Specifically, when the first head node fails, the first head node will migrate the file system mounted on its mount point to the second head node. After the migration is completed, the files generated during the file system migration, the head node information and the file system generate migration information.

[0075] The head node information includes the first head node identifier, the second head node identifier, the configuration parameters of the first head node and the second head node, migration options and other information.

[0076] The files generated during file system migration include migration log files and temporary files.

[0077] The migration log file is used to record detailed information about the file system during the migration process, such as the start and end time of the migration, the migration status of each file or directory, possible error messages, and warnings.

[0078] The temporary files are used to store intermediate data generated during the file system migration process.

[0079] Step B2: After the migration is completed, the migration information is saved in the database and first information is generated.

[0080] Specifically, after the migration is completed, the generated migration information is saved in the database in the form of file system identifier-migration information, and the first information is generated in the binary log according to the file system identifier.

[0081] In the above steps, the generation of the first information can record the fault migration information and provide a basis for subsequent verification.

[0082] Optionally, the first rule information is changed according to the migration node identifier to obtain the second rule information, including steps C1-C3:

[0083] Step C1: perform a first head node identifier traversal on the first rule information whose number of changes is less than the preset number of changes to obtain position information.

[0084] The location information is used to represent the location of the first head node identifier in the first rule information.

[0085] Specifically, the number of changes to the first rule information is obtained from the table of data to be changed. If the number of changes is less than a preset number of changes, the first rule information is filtered for the head node identifier, and the location of the head node identifier is recorded to obtain location information. If the number of changes is greater than or equal to the preset number of changes, the change fails and an early warning is issued.

[0086] Step C2: replace the first head node identifier in the first rule information with the migration node identifier according to the location information to obtain second rule information.

[0087] Specifically, the first head node identifier in the first rule information is replaced according to the location information and the migration node identifier, and the rule information after replacement is used as the second rule information.

[0088] Optionally, after the first head node identifier in the first rule information is replaced by the migration node identifier according to the location information to obtain the second rule information, steps D1-D2 are further included:

[0089] Step D1: Send the second rule information to the second head node. If the sending is successful, delete the change event corresponding to the first rule information.

[0090] Specifically, a configuration command for adding rule information is sent to the second head node. After receiving the configuration command, the second head node receives the second rule information sent. If the sending is successful, the second head node updates the original rule information it is equipped with according to the second rule information, and performs data synchronization replication according to the second rule information, and deletes the change event corresponding to the first rule information from the data replication table to be changed.

[0091] Step D2: If the sending fails, the change status of the first rule information is changed to pending change, and the corresponding change times are increased by a preset value.

[0092] Specifically, if the sending fails, the change status of the first rule information in the to-be-changed data copy table is changed to to-be-changed, and the number of changes is increased by a preset value.

[0093] The above steps are verified according to the delivery of the second change information, thereby ensuring the reliability of successful change of the rule to be changed under abnormal circumstances.

[0094] Optionally, before the second head node synchronously replicates the data generated by the file system according to the second rule information, steps E1-E2 are included:

[0095] Step E1: Generate a stop instruction.

[0096] The stop instruction is used to stop the first head node from performing data synchronous replication to the devices in the cluster system according to the first rule information.

[0097] Specifically, when the first rule information is matched, a stop instruction of the first rule information is generated.

[0098] Step E2: Change the status of the first rule information to stop according to the stop instruction.

[0099] Specifically, a stop instruction is sent to the first head node, and the first head node changes the synchronous replication state of the first rule information to stop according to the stop instruction, so as to prevent the first head node from continuing to synchronously replicate data to other devices.

[0100] Furthermore, the synchronous replication status of the first rule information is changed because, after the first head node fails and the file system is migrated, the mount point of the file system is still retained on the first head node, and the mount point can still write data, but the written data is not saved in the file system, so synchronous replication is not required, so the synchronous replication status needs to be changed.

[0101] In the above step, stopping the first rule information is to prevent the first head node from continuing to copy data, thereby causing data loss.

[0102] The technical solution of this embodiment determines the first rule information of the first information; determines the migration node identifier based on the first information; changes the first rule information based on the migration node identifier to obtain the second rule information. The determination of the second rule information can assist the second head node in performing data synchronization replication and enhance the reliability of data synchronization replication; the second head node performs synchronization replication on the data generated by the file system based on the second rule information, which can enhance the reliability of data synchronization replication. This method changes the first rule information based on the migration node identifier to obtain the second rule information. The update of the rule information can ensure the security of data synchronization replication after the head node migration occurs, while also avoiding the risk of data loss. Furthermore, since the rule information is automatically updated when a head node failure occurs, manual intervention is avoided, the efficiency of data synchronization replication is improved, and the high availability of data replication is also improved.

[0103] Figure 3 This is a schematic diagram of the structure of a data replication device for head file system migration provided by an embodiment of the present invention. This embodiment is applicable to the case of synchronous replication of data when a head node fails. The data replication device for head file system migration can be implemented in the form of hardware and / or software. The data replication device for head file system migration can be configured in any electronic device with network communication function. Figure 3 As shown, the apparatus includes: a first rule information determination module 210, a migration node identifier determination module 220, a second rule information determination module 230 and a data replication module 240, wherein:

[0104] First rule information determination module 210: used to determine first rule information of first information; the first information is used to represent event information generated when the first head node is migrated; the first head node is a head node that has failed and cannot be mounted by the file system; the head node is a device responsible for resource allocation and task scheduling in the cluster system; the first rule information is a rule for the first head node to synchronously replicate data to devices in the cluster system;

[0105] Migration node identification determination module 220: used to determine the migration node identification according to the first information; the migration node identification is the node identification corresponding to the second head node; the second head node is the head node after the file system is migrated to the first head node;

[0106] Second rule information determination module 230: used to modify the first rule information according to the migration node identifier to obtain second rule information; the second rule information is the rule for the second head node to synchronously replicate data to the device in the cluster system;

[0107] Data replication module 240: used for the second head node to synchronously replicate the data generated by the file system according to the second rule information.

[0108] Optionally, the first rule information determination module 210 includes:

[0109] A migration information determining unit: configured to match corresponding migration information from a file system migration table according to the first information;

[0110] The first rule information determining unit is configured to match corresponding first rule information from a database according to the migration information.

[0111] Optionally, the first rule information determination module 210 includes:

[0112] Migration unit: used to migrate the file system mounted on the first head node to the second head node when the first head node fails;

[0113] Migration record determination unit: configured to save the migration information into a database after the migration is completed, and generate first information.

[0114] Optionally, the second rule information determination module 230 includes:

[0115] Position information determining unit: used for traversing the first head node identifier of the first rule information whose number of changes is less than the preset number of changes to obtain position information; the position information is used to represent the position of the first head node identifier in the first rule information;

[0116] The second rule information determining unit is configured to replace the first head node identifier in the first rule information with the migration node identifier according to the location information to obtain the second rule information.

[0117] Optionally, the second rule information determining module 230 further includes:

[0118] An event deletion unit, configured to send the second rule information to the second head node, and if the sending is successful, delete the change event corresponding to the first rule information;

[0119] The state changing unit is configured to change the change state of the first rule information to pending change if the sending fails, and increase the corresponding change times by a preset value.

[0120] Optional data replication device for head file system migration, including:

[0121] A stop instruction generation module: used to generate a stop instruction; the stop instruction is used to stop the first head node from performing data synchronization replication to the devices in the cluster system according to the first rule information;

[0122] State changing module: used for changing the state of the first rule information to stop according to the stop instruction.

[0123] The data replication device under the migration of the head file system provided in the embodiment of the present invention can execute the data synchronization method under the migration of the head file system provided in any embodiment of the present invention mentioned above, and has the corresponding functions and beneficial effects of executing the data replication method and synchronization method under the migration of the head file system. For detailed process, please refer to the relevant operations of the data synchronization method under the migration of the head file system in the above-mentioned embodiment.

[0124] Figure 4 A schematic diagram of the structure of an electronic device for implementing the data synchronization method under the head file system migration embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0125] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0126] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0127] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the data synchronization method for head file system migration.

[0128] In some embodiments, the method for synchronizing data during a head file system migration can be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for synchronizing data during a head file system migration described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the method for synchronizing data during a head file system migration by any other appropriate means (e.g., by means of firmware).

[0129] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and synchronously copy data and instructions to the storage system, the at least one input device, and the at least one output device.

[0130] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0131] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0132] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0133] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0134] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0135] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0136] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A data synchronization method for head file system migration, characterized in that: include: determining first rule information of the first information; The first information is used to represent event information generated when the first head node migrates; The first head node is a head node that fails and cannot be mounted by the file system; the head node is a device responsible for resource allocation and task scheduling in the cluster system; The first rule information is a rule for the first head node to synchronously replicate data to devices in the cluster system; Determine a migration node identifier according to the first information; The migration node identifier is the node identifier corresponding to the second head node; the second head node is the head node after the file system is migrated from the first head node; Modify the first rule information according to the migration node identifier to obtain second rule information; The second rule information is a rule for the second head node to synchronously replicate data to devices in the cluster system; The second head node synchronously replicates the data generated by the file system according to the second rule information.

2. The method according to claim 1, characterized in that The first rule information for determining the first information includes: matching corresponding migration information from a file system migration table according to the first information; The corresponding first rule information is matched from the database according to the migration information.

3. The method according to claim 2, characterized in that The at least one method for determining the first information includes: When a first head node fails, the file system mounted on the first head node is migrated to the second head node; After the migration is completed, the migration information is saved in the database and first information is generated.

4. The method according to claim 1, wherein The changing the first rule information according to the migration node identifier to obtain second rule information includes: Performing a first head node identifier traversal on the first rule information whose number of changes is less than the preset number of changes to obtain position information; the position information is used to represent the position of the first head node identifier in the first rule information; The first head node identifier in the first rule information is replaced by the migration node identifier according to the location information to obtain the second rule information.

5. The method according to claim 4, characterized in that After replacing the first head node identifier in the first rule information with the migration node identifier according to the location information to obtain the second rule information, the method further includes: Send the second rule information to the second head node. If the sending is successful, delete the change event corresponding to the first rule information. If the sending fails, the change status of the first rule information is changed to pending change, and the corresponding change times are increased by a preset value.

6. The method according to claim 1, characterized in that Before the second head node synchronously replicates the data generated by the file system according to the second rule information, the method includes: Generate a stop instruction; the stop instruction is used to stop the first head node from synchronously replicating data to the devices in the cluster system according to the first rule information; The state of the first rule information is changed to stopped according to the stop instruction.

7. A data synchronization device for head file system migration, characterized in that: include: A first rule information determining module, configured to determine first rule information of the first information; The first information is used to represent event information generated when the first head node migrates; The first head node is a head node that fails and cannot be mounted by the file system; the head node is a device responsible for resource allocation and task scheduling in the cluster system; The first rule information is a rule for the first head node to synchronously replicate data to devices in the cluster system; a migration node identifier determining module, configured to determine a migration node identifier based on the first information; The migration node identifier is the node identifier corresponding to the second head node; the second head node is the head node after the file system is migrated from the first head node; a second rule information determining module, configured to modify the first rule information according to the migration node identifier to obtain second rule information; The second rule information is a rule for the second head node to synchronously replicate data to devices in the cluster system; A data replication module is used for the second head node to synchronously replicate the data generated by the file system according to the second rule information.

8. The device according to claim 7, characterized in that The second rule information determination module includes: A location information determining unit is configured to perform a first head node identifier traversal on the first rule information whose number of changes is less than a preset number of changes, to obtain location information; the location information is used to represent the position of the first head node identifier in the first rule information; A second rule information determining unit is configured to replace the first head node identifier in the first rule information with the migration node identifier according to the location information to obtain second rule information.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data synchronization method under head file system migration according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data synchronization method under head file system migration according to any one of claims 1 to 6 when executed.