CN111880751B - Hard disk migration method, distributed storage cluster system and storage medium - Google Patents
Hard disk migration method, distributed storage cluster system and storage medium Download PDFInfo
- Publication number
- CN111880751B CN111880751B CN202011037231.1A CN202011037231A CN111880751B CN 111880751 B CN111880751 B CN 111880751B CN 202011037231 A CN202011037231 A CN 202011037231A CN 111880751 B CN111880751 B CN 111880751B
- Authority
- CN
- China
- Prior art keywords
- hard disk
- migrated
- migration
- data node
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0617—Improving the reliability of storage systems in relation to availability
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0619—Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0647—Migration mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a hard disk migration method, a distributed storage cluster system and a storage medium, wherein the method is applied to a metadata server and comprises the following steps: establishing a corresponding relation among the user file, the data node information, the hard disk information and the data block storage information to obtain a data relation table, and storing the data relation table; after a hard disk migration instruction is received, limiting the operation of data blocks in a hard disk to be migrated through a current data node server, wherein the current data node server is a data node server where the hard disk to be migrated is currently located; after the hard disk migration is completed, receiving update information reported by a new data node server, wherein the new data node server is a data node server to which the hard disk to be migrated is pre-migrated; and updating the information corresponding to the hard disk to be migrated in the data relation table based on the updating information, and removing the limitation of the data block in the hard disk to be migrated. By means of the method, the reliability and the availability of the distributed storage cluster system can be improved.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a hard disk migration method, a distributed storage cluster system, and a storage medium.
Background
In the distributed storage cluster system, each data node server and the hard disk thereof are distributed with unique mark information of the cluster by the metadata server when the data node servers and the hard disks thereof are on line for the first time, so that the migration of the physical positions of the data node servers and the hard disks in the cluster can be supported, namely, as long as the cluster identifications carried by the data node servers and the hard disks are not changed, the data node servers and the hard disks can be sensed by the metadata server of the cluster, and the integrity of cluster data in the hard disk migration process is ensured.
Some current hard disk migration schemes have the following defects: 1) if the memory partition is damaged before the hard disk migration, the hard disk information in the data node server cannot be cleared, and further the hard disk migration action cannot be completed; 2) and the storage cluster adopting a flat design ensures that the write-in service performance is poorer. Some technical solutions have the following problems: 1) under the condition of a large number of hard disk migrations, the node performance and the pressure of the memory are large, and the normal service of the cluster is influenced when the pressure is serious; 2) in the hard disk migration process, data blocks which fail due to the offline of the hard disk need to be updated only after the hard disk migration is completed and the full amount of the data blocks is reported, and in this period of time, reading services executed by a service layer on files fail, so that the user experience is influenced; 3) in the hard disk migration process, the data node server needs to report all file storage information in the hard disk to the metadata server, so that a communication protocol packet reported by a data block is large, and excessive system bandwidth and memory resources are occupied.
Disclosure of Invention
The application provides a hard disk migration method, a distributed storage cluster system and a storage medium, which can improve the reliability and the availability of the distributed storage cluster system.
In order to solve the above technical problem, a technical solution adopted by the present application is to provide a hard disk migration method, where the method is applied to a metadata server, and includes: establishing a corresponding relation among the user file, the data node information, the hard disk information and the data block storage information to obtain a data relation table, and storing the data relation table; after a hard disk migration instruction is received, limiting the data blocks in the hard disk to be migrated to operate through a current data node server, wherein the current data node server is the data node server where the hard disk to be migrated is located currently; after the hard disk migration is completed, receiving update information reported by a new data node server, wherein the new data node server is a data node server to which the hard disk to be migrated is pre-migrated, and the update information comprises new data node information and new hard disk information; and updating the information corresponding to the hard disk to be migrated in the data relation table based on the updating information, and removing the limitation of the data block in the hard disk to be migrated.
In order to solve the foregoing technical problem, another technical solution adopted in the present application is to provide a distributed storage cluster system, where the distributed storage cluster system includes a metadata server, a plurality of data node servers connected to the metadata server, and a hard disk to be migrated connected to the data node servers, and the metadata server includes a memory and a processor connected to each other, where the memory is used to store a computer program, and the computer program is used to implement the hard disk migration method when executed by the processor.
In order to solve the above technical problem, another technical solution adopted by the present application is to provide a computer-readable storage medium for storing a computer program, wherein the computer program is used for implementing the hard disk migration method when being executed by a processor.
Through the scheme, the beneficial effects of the application are that: pre-establishing a corresponding relation among user files, data node information, hard disk information and data block storage information to form a data relation table; the hard disk to be migrated which is ready to be pulled out can be restricted from being read and/or written in, so that the data in the hard disk to be migrated can be kept consistent in the migration process; after the user pulls the hard disk to be migrated out of the current data node server and inserts a new data node server, the new data node server can send update information for recording new data node information and new hard disk information to the metadata server, so that the metadata server can update the data relation table stored by the metadata server according to the information reported by the new data node server; because the hard disk data is not changed, the data node server only needs to report the hard disk hot plug event to the metadata node server, so that the data migration signaling can be simplified, and the influence of the disk scanning and reporting pressure of data migration on the normal cluster service is reduced; the read-write service fails only when the hard disk to be migrated is pulled out of the current data node server and a new data node server is inserted, and the read-write service of the hard disk to be migrated is not influenced at other time, so that the availability and reliability of the distributed storage cluster system can be effectively improved; and all information in the hard disk to be migrated does not need to be reported to the metadata server, so that the reported data volume is reduced, and the occupied bandwidth and the memory resource are reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. Wherein:
FIG. 1 is a schematic structural diagram of an embodiment of a distributed storage cluster system provided herein;
FIG. 2 is a flowchart illustrating an embodiment of a hard disk migration method provided in the present application;
FIG. 3 is a flowchart illustrating a hard disk migration method according to another embodiment of the present application;
FIG. 4 is a schematic structural diagram of another embodiment of a distributed storage cluster system provided by the present application;
FIG. 5 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The hard disk online migration is a process of performing hot plug on a hard disk between different data node servers under the condition that the cluster storage service is not stopped, and the application background of the hard disk online migration comprises the following aspects:
(1) in the actual use process, as the service scale increases, the storage cluster system is inevitably subjected to a situation of insufficient capacity, and at this time, the storage cluster system needs to be expanded.
(2) In the field of security video monitoring, service pressure from a front-end camera can exist all the time, so that a storage cluster system is required to have online capacity expansion capacity, namely, normal service cannot be influenced by cluster capacity expansion action.
(3) Since the metadata server usually implements load balancing based on the available capacity of the data node server, that is, the video stream at the front end is written into the data node server with a large available capacity as much as possible, the service pressure of the data node server and its hard disk newly added to the storage cluster system in a short period is very large, so that problems of insufficient system resources and memory, reduced service processing capability, or overtime network response occur, which affects user experience.
Therefore, in the process of implementing the storage cluster system expansion, in addition to the newly added data node servers and the hard disks thereof, the new hard disks need to be exchanged with the old hard disks in the original data node servers, so as to achieve the purpose of making the available capacities of all the data node servers basically consistent.
The scheme of the application can be applied to the distributed storage cluster system, and cluster signaling is enriched by optimizing the storage formats of the management data node server and the data blocks in the metadata server so as to support the real-time migration of the hard disks in the distributed storage cluster system, so that the migration of a large number of hard disks is avoided to increase the service pressure of the distributed storage cluster system, and the availability and the reliability of the distributed storage cluster system are effectively improved.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic structural diagram of an embodiment of a distributed storage cluster system provided in the present application, where the distributed storage cluster system 10 includes a metadata server 11, a plurality of data node servers 12 connected to the metadata server 11, and a hard disk 13 to be migrated connected to the data node servers 12; fig. 2 is a schematic flowchart of an embodiment of a hard disk migration method provided in the present application, where the method is applied to a metadata server, and includes:
step 21: and establishing a corresponding relation among the user file, the data node information, the hard disk information and the data block storage information to obtain a data relation table, and storing the data relation table.
The metadata server can pre-establish the corresponding relation among the user file, the data node information, the hard disk information and the data block storage information, and generate a data relation table, so that the data relation table can be directly updated when the hard disk is migrated.
Further, the user file may be a locally stored file related to the user; the data node information is name (ID) information of the data node server and is used for distinguishing different data node servers; the hard disk information is slot position information of a hard disk in a data node server where the hard disk is located currently, specifically, at least one notch is arranged on the data node server, and the hard disk information is used for indicating the notch of the data server into which the hard disk is inserted; the data block storage information may be used to record information stored in the data block in the hard disk, for example, the data relationship table may be as follows:
wherein, file 1 is composed of information stored by data chunk A1, data chunk A2, data chunk B1, data chunk B2, and data chunk B3; file 2 is comprised of information stored by data block C1, data block D1, and data block D2.
It can be understood that how many parts each user file is divided into can be determined by the size of the user file, and the larger the user file is, the more data blocks the storage cluster system divides into; the distribution condition of each data block can be determined by the busy and idle conditions and the available capacity of the data node server and the hard disk of the data node server at that time of the storage cluster system, and preferentially, the data node server and the hard disk with low current write pressure or more residual storage capacity are selected to execute the current write action.
Step 22: and after the hard disk migration instruction is received, the data blocks in the hard disk to be migrated are limited to be operated through the current data node server.
The hard disks to be migrated are hard disks which need to be plugged and unplugged by a user, and are one hard disk connected to the data node server in the distributed storage cluster system, and the number of the hard disks to be migrated can be one or more and can be adjusted along with application requirements; the current data node server is the data node server where the hard disk to be migrated is currently located, when the hard disk migration is needed, a user can pull out the hard disk to be migrated on the current data node server, and after the data node server detects that the user pulls out the hard disk to be migrated, the data node server can report a hard disk pulling-out event to the metadata server so as to inform the metadata server that a hard disk is currently pulled out of the current data node server.
Further, before the metadata server receives the hard disk pull-out event reported by the current data node server, that is, when the user prepares to pull out the hard disk to be migrated from the current data node server but does not pull out the hard disk to be migrated yet, in order to ensure the consistency of data in the hard disk to be migrated before and after migration, the metadata server may limit reading and/or writing operations on the hard disk to be migrated after receiving a hard disk migration instruction issued by the user.
Step 23: and after the hard disk migration is completed, receiving the updated information reported by the new data node server.
The new data node server is a data node server to which the hard disk to be migrated is pre-migrated, a user can pull the hard disk to be migrated out of the current data node server and insert the new data node server, the new data node server can generate update information after detecting that the hard disk to be migrated is inserted into a notch of the new data node server, and report the update information to the metadata server, wherein the update information comprises new data connection information, new hard disk information and a hard disk online event, and the hard disk online event is used for indicating that the hard disk is inserted into the new data node server currently.
Step 24: and updating the information corresponding to the hard disk to be migrated in the data relation table based on the updating information, and removing the limitation of the data block in the hard disk to be migrated.
After receiving the update information reported by the new data service, the metadata server can update the information related to the hard disk to be migrated in the data relation table stored by the metadata server; for example, before updating, the data node information associated with the hard disk to be migrated is the data node server a, and the hard disk information associated with the hard disk to be migrated is the second slot, that is, the hard disk to be migrated is inserted into the second slot of the data node server a; after the user pulls the hard disk to be migrated from the data node server a and inserts the hard disk into the first slot of the data server B, the data relationship table is updated, the data node information associated with the hard disk to be migrated is updated to the data node server B, and the hard disk information associated with the hard disk to be migrated is updated to the first slot.
The embodiment provides a hard disk migration method, which can establish a data relation table comprising user files, data node information, hard disk information and data block storage information in a metadata server, wherein the data relation table can be dynamically updated along with the execution of writing-in service or deleting service; before the hard disk migration is carried out, the data node server can limit the hard disk to be migrated, so that the data information in the hard disk to be migrated is prevented from being modified by subsequent services; only in the process of hard disk migration, namely in the time period from the current data node server pulling out of the hard disk to be migrated to the new data node server inserting into the hard disk to be migrated, the metadata server can not provide the read-write service of the relevant file for the user, thereby greatly reducing the influence of the hard disk migration action on the user service and improving the availability of the distributed storage cluster system; in addition, only the metadata server needs to modify the data relation table, and the data relation table does not depend on the full scanning and data block reporting of the hard disk to be migrated in the new data node server, so that the pressure on a system, a memory and a network load where the new data node server is located after the hard disk is migrated is avoided, and the reliability of the distributed storage cluster system is improved.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating another embodiment of a hard disk migration method provided in the present application, where the method includes:
step 31: and establishing a corresponding relation among the user file, the data node information, the hard disk information and the data block storage information to obtain a data relation table, and storing the data relation table.
The metadata server comprises a first storage device and a second storage device, wherein a data relation table is stored in the first storage device, and the data relation table can be read into the second storage device in the starting process of the metadata server; specifically, the first storage device may be a hard disk, and the second storage device may be a memory.
The metadata server is responsible for maintaining a data relation table composed of user files, data node information, hard disk information and data block storage information, and only the data node information and the hard disk information in the data relation table need to be modified in the hard disk migration process, and the data node server does not need to wait for the completion of scanning and reporting of the data block storage information in the newly migrated hard disk to be migrated.
It is to be understood that, if the data relationship table in the second storage device is updated, when the business layer pressure is low, the metadata server may synchronize the updated data relationship table to the first storage device after updating the data relationship table in the second storage device.
Step 32: after a hard disk migration instruction is received, the state of a data block in a hard disk to be migrated is marked as read only by the current data node server, and a hard disk migration command is sent to the current data node server.
Before the hard disk migration is carried out, a user can issue a hard disk migration instruction to a metadata server, after the metadata server receives the hard disk migration instruction, the metadata server can send a hard disk migration command to a current data node server where a hard disk to be migrated is located, and the hard disk migration command is used for indicating that the state of a data block in the hard disk to be migrated is marked to be readable.
The metadata server can set the user file associated with the hard disk to be migrated into a read-only state, the read service of the user file is not influenced by the state, and the write service of the user file can be executed by other online hard disks, so that the normal service of the distributed storage cluster system is not influenced by the hard disk migration.
Furthermore, the data block in the hard disk to be migrated can be set as read-only on the metadata server, and the hard disk migration command is sent to the current data node server, and the current data node server ensures that the hard disk to be migrated is read-only and unwritable, so that the data block in the hard disk to be migrated is consistent before and after migration.
Step 33: and receiving cluster identification information in the hard disk to be migrated, which is reported by the current data node server, and informing the current data node server to delete the hard disk to be migrated from the task queue so as to limit the writing operation of the hard disk to be migrated.
After a user pulls out a hard disk to be migrated from a current data node server, the current data node server can report cluster identification information related to the hard disk to be migrated to a metadata server; specifically, the cluster identification information includes cluster information, data node information, and hard disk information, where the cluster information is used to indicate in which distributed storage cluster system a current hard disk to be migrated is located.
The metadata server can inform the current data node server to clear the hard disk to be migrated from the write-in and delete service table, that is, the write-in operation is not accepted any more, so as to prevent the storage information of the data block in the hard disk to be migrated from being modified by subsequent services.
In a specific embodiment, the metadata server supports the following two hard disk migration modes:
a) and (4) concurrent hard disk migration, which is recorded as a concurrent migration mode, is applied to the condition that cluster identification information recorded in the hard disk to be migrated is not damaged, and can migrate a plurality of hard disks to be migrated at one time.
b) The serial hard disk migration is recorded as a serial migration mode, and is applied to a situation that cluster identification information recorded in a hard disk to be migrated is damaged, and in order to ensure that a metadata server can correctly modify a data relation table, the migration of the hard disk to be migrated needs to be executed block by block.
Further, the metadata server may detect whether the cluster identification information on the hard disk to be migrated is normal, that is, determine whether the cluster identification information is damaged or lost.
When the cluster identification information in the hard disk to be migrated is normal, the migration mode of the hard disk is a concurrent migration mode, and a user can execute concurrent migration actions, for example, the user can perform migration operation on one or more hard disks to be migrated by pulling out a plurality of hard disks to be migrated from the current data node server; the current data node server forwards the concurrent migration operation sent by the user to the metadata server after detecting the concurrent migration operation sent by the user; when receiving the concurrent migration operation forwarded by the current data node server, the metadata server can prompt a user to simultaneously migrate all the hard disks to be migrated after selecting all the hard disks to be migrated at one time, and the storage cluster system is responsible for maintaining the state of the data block in each hard disk to be migrated and updating the cluster identification information in the whole migration action, namely marking the states of the data blocks in all the hard disks to be migrated as readable, so that the failure of concurrent migration caused by errors is prevented.
When the cluster identification information in the hard disk to be migrated is abnormal, the migration mode of the hard disk is a serial migration mode, a user can execute a serial migration action, namely, only one hard disk to be migrated can be migrated, and after the migration of the hard disk to be migrated is completed, the next hard disk to be migrated can be migrated; the current data node server forwards the serial migration operation sent by the user to the metadata server after detecting the serial migration operation sent by the user; when the metadata server receives the serial migration operation forwarded by the current data node server, the metadata server can prompt a user to perform migration of other hard disks to be migrated after completing migration of the current hard disk to be migrated, so that errors in user operation are prevented.
After the metadata server marks all the hard disks to be migrated, the metadata server can remind a user of executing a hard disk migration action, namely, the user starts to execute the operation of pulling out the hard disks to be migrated from the current data node server and inserting a new data node server.
Step 34: after a hard disk pulling event is received, the state of the data block in the hard disk to be migrated is marked as migration, so that the hard disk to be migrated is limited from being read until the migration of the hard disk to be migrated is completed.
After the hard disk to be migrated is pulled out from the current data node server, the current data node server may report the data node information and the hard disk information to the metadata server, and the metadata server may mark the data block associated with the hard disk to be migrated as in-migration in the data relationship table, and at this time, the data block in the hard disk to be migrated cannot be read by the service layer until the migration of the hard disk to be migrated is completed, so that the user needs to complete the hard disk migration action as soon as possible.
Step 35: after the hard disk migration is completed, receiving new update information reported by a data node server, modifying data node information corresponding to a hard disk to be migrated in a data relation table into new data node information, modifying hard disk information corresponding to the hard disk to be migrated into new hard disk information, and modifying the state of a data block in the hard disk to be migrated into normal.
After the user finishes the migration action of the hard disk, the new data node server can report old cluster identification information (only in a concurrent migration mode), new data node information, new slot position information and an online event of the hard disk on the hard disk to be migrated to the metadata server; specifically, the old cluster identification information is the corresponding cluster identification information of the hard disk to be migrated before migration.
The metadata server can modify the data relationship table maintained in the memory according to the information reported by the new data node server, that is, the data node information and the hard disk information in the original data relationship table are modified into the new data node information and the new hard disk information after migration, and the data block associated with the hard disk to be migrated is marked as normal, so that the normal read-write operation can be performed on the hard disk to be migrated. The metadata server can also generate new cluster identification information according to the information reported by the new data node server, and write back to the hard disk to be migrated so as to update the cluster identification information on the hard disk to be migrated.
Further, if the migration mode is the serial migration mode, only one piece of information in the data relationship table needs to be updated, so that the data relationship table can be updated only by using new data node information and new slot position information without depending on old cluster identification information; if the migration mode is a concurrent migration mode, multiple pieces of information to be updated may exist in the data relationship table at the same time, and at this time, if the old cluster identification information cannot be obtained, the new cluster identification information cannot be corresponded to the old cluster identification information, and the update cannot be completed, so that when the old cluster identification information is abnormal, only serial migration can be performed.
The embodiment provides two hard disk migration scenes, the concurrent migration mode is suitable for the condition that the cluster identification information in the hard disk to be migrated is normal, and the migration time of the hard disk to be migrated can be greatly reduced; the serial migration mode is suitable for the condition that the cluster identification information is damaged, and the data block in the hard disk to be migrated can be migrated as long as the data block is not damaged, so that the availability of the distributed storage cluster system is improved; even if the cluster identification information stored in the hard disk is damaged (or lost), serial migration can still be performed, so that the hard disk can be migrated, and the availability of the distributed storage cluster system is improved; data node information, hard disk information and data block storage information can be managed in a centralized mode through the metadata server, the write-in offset of the current object can be directly searched from the metadata server before the file is read and written every time, the service path is effectively shortened, and the cluster performance is improved; in addition, in the process of hard disk migration, the metadata server only needs to update the data relation table in the memory, so that the data migration action is fast, and the concurrent migration of a plurality of hard disks is supported; the hard disk migration process can be shortened, the distributed storage cluster system only does not allow a user to read and write the hard disk to be migrated between the hard disk pulling-out action and the hard disk inserting action, and the whole distributed storage cluster system supports the reading and writing operation in other time periods, so that the availability of the distributed storage cluster system is improved; in addition, after the hard disk to be migrated is migrated to a new data node server, the new data node server is not required to scan and report the storage information of the data blocks on the hard disk to be migrated to the metadata server, so that the system load of the data node server is reduced, and the reliability of the distributed storage cluster system is improved; in addition, compared with a scheme requiring complex interaction, the method simplifies the signaling capacity between the data node server and the metadata server in the hard disk migration process, can improve the reliability of the communication process, and can reduce the network load.
Referring to fig. 4, fig. 4 is a schematic structural diagram of another embodiment of a distributed storage cluster system provided in the present application, where the distributed storage cluster system 40 includes a metadata server 41, a plurality of data node servers 42, and a hard disk 43 to be migrated, where each data node server 42 is connected to the metadata server 41, and the hard disk 43 to be migrated is connected to one data node server 42; the metadata server 41 comprises a memory 411 and a processor 412 connected to each other, the memory 411 being used for storing a computer program, which when executed by the processor 412, is used for implementing the hard disk migration method in the above-described embodiments.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present application, where the computer-readable storage medium 50 is used for storing a computer program 51, and the computer program 51 is used for implementing the hard disk migration method in the foregoing embodiment when being executed by a processor.
The computer readable storage medium 50 may be a server, a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules or units is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.
Claims (9)
1. A hard disk migration method is applied to a metadata server, and comprises the following steps:
establishing a corresponding relation among a user file, data node information, hard disk information and data block storage information to obtain a data relation table, and storing the data relation table, wherein the data node information is name information of a data node server, and the hard disk information is slot position information of a hard disk in the data node server where the hard disk is located at present;
after a hard disk migration instruction is received, cluster identification information in a hard disk to be migrated, which is reported by a current data node server, is received; the cluster identification information comprises cluster information, the data node information and the hard disk information; detecting whether the cluster identification information is normal; if so, the migration mode is a concurrent migration mode, and the concurrent migration operation forwarded by the current data node server is received; if not, the migration mode is a serial migration mode, and the serial migration operation forwarded by the current data node server is received; limiting the data blocks in the hard disk to be migrated to be operated through a current data node server, wherein the current data node server is the data node server where the hard disk to be migrated is located currently;
after the hard disk migration is completed, receiving update information reported by a new data node server, wherein the new data node server is a data node server to which the hard disk to be migrated is pre-migrated, and the update information comprises new data node information and new hard disk information;
and updating the information corresponding to the hard disk to be migrated in the data relation table based on the updating information, and removing the limitation on the data block in the hard disk to be migrated.
2. The hard disk migration method according to claim 1, wherein the step of restricting, by the current data node server, the operation on the data blocks in the hard disk to be migrated includes:
marking the state of the data block in the hard disk to be migrated as read-only through the current data node server;
the step of updating the information corresponding to the hard disk to be migrated in the data relationship table based on the update information and removing the limitation on the data blocks in the hard disk to be migrated includes:
and modifying the data node information corresponding to the hard disk to be migrated in the data relation table into the new data node information, modifying the hard disk information corresponding to the hard disk to be migrated into the new hard disk information, and modifying the state of the data block in the hard disk to be migrated into a normal state.
3. The hard disk migration method according to claim 1, wherein before the step of receiving the update information reported by the new data node server after the hard disk migration is completed, the method further comprises:
and informing the current data node server to delete the hard disk to be migrated from the task queue so as to limit the writing operation on the hard disk to be migrated.
4. The hard disk migration method according to claim 1, wherein before the step of limiting, by the current data node server, the operation on the data block in the hard disk to be migrated after the hard disk migration instruction is received, the method comprises:
and after the hard disk migration instruction is received, sending a hard disk migration command to the current data node server, wherein the hard disk migration command is used for indicating that the state of the data block in the hard disk to be migrated is marked to be readable.
5. The hard disk migration method according to claim 1, wherein the method further comprises:
when the migration mode is the concurrent migration mode, prompting a user to simultaneously migrate all the hard disks to be migrated after selecting all the hard disks to be migrated at one time;
and when the migration mode is the serial migration mode, prompting a user to perform the migration of other hard disks to be migrated after completing the migration of the current hard disk to be migrated.
6. The hard disk migration method according to claim 1, wherein before the step of receiving the update information reported by the new data node server after the hard disk migration is completed, the method further comprises:
after a hard disk pulling event is received, marking the state of the data block in the hard disk to be migrated as migration to limit the reading operation on the hard disk to be migrated until the migration of the hard disk to be migrated is completed.
7. The hard disk migration method according to claim 1, wherein the metadata server includes a first storage device and a second storage device, the first storage device having the data relationship table stored therein, the method further comprising:
reading the data relation table into the second storage device in the starting process;
and after the data relation table in the second storage device is updated, synchronizing the updated data relation table to the first storage device.
8. A distributed storage cluster system, comprising a metadata server, a plurality of data node servers connected to the metadata server, and a hard disk to be migrated connected to the data node servers, wherein the metadata server comprises a memory and a processor connected to each other, wherein the memory is used for storing a computer program, and the computer program is used for implementing the hard disk migration method according to any one of claims 1 to 7 when being executed by the processor.
9. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, is adapted to implement the hard disk migration method of any one of claims 1 to 7.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011037231.1A CN111880751B (en) | 2020-09-28 | 2020-09-28 | Hard disk migration method, distributed storage cluster system and storage medium |
PCT/CN2021/121441 WO2022063322A1 (en) | 2020-09-28 | 2021-09-28 | Hard drive migration method, distributed storage cluster system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011037231.1A CN111880751B (en) | 2020-09-28 | 2020-09-28 | Hard disk migration method, distributed storage cluster system and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111880751A CN111880751A (en) | 2020-11-03 |
CN111880751B true CN111880751B (en) | 2020-12-25 |
Family
ID=73199960
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011037231.1A Active CN111880751B (en) | 2020-09-28 | 2020-09-28 | Hard disk migration method, distributed storage cluster system and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111880751B (en) |
WO (1) | WO2022063322A1 (en) |
Families Citing this family (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112463050A (en) * | 2020-11-26 | 2021-03-09 | 新华三技术有限公司成都分公司 | Storage system capacity expansion method, device, equipment and machine-readable storage medium |
CN112988062B (en) * | 2021-01-28 | 2023-02-14 | 腾讯科技(深圳)有限公司 | Metadata reading limiting method and device, electronic equipment and medium |
CN113778982B (en) * | 2021-03-09 | 2025-02-21 | 北京沃东天骏信息技术有限公司 | Data migration method and device |
CN113467722B (en) * | 2021-07-26 | 2024-04-30 | 浙江大华技术股份有限公司 | Data migration method and device of distributed storage system |
CN113470726A (en) * | 2021-07-28 | 2021-10-01 | 浙江大华技术股份有限公司 | Hard disk online detection method and device |
CN113590586B (en) * | 2021-07-29 | 2022-03-22 | 东方微银科技股份有限公司 | Method and device for migrating fragmented data among nodes of distributed graph database system |
CN113596172B (en) * | 2021-08-04 | 2023-11-14 | 百度在线网络技术(北京)有限公司 | Method and device for updating nodes in distributed cluster |
CN113885798B (en) * | 2021-09-29 | 2025-02-28 | 浙江大华技术股份有限公司 | A data operation method, device, equipment and medium |
CN114625695A (en) * | 2022-03-29 | 2022-06-14 | 阿里巴巴(中国)有限公司 | Data processing method and device |
CN114979153B (en) * | 2022-04-07 | 2023-10-27 | 浙江大华技术股份有限公司 | Load balancing method, computer equipment and storage device |
CN114895849B (en) * | 2022-04-29 | 2024-11-01 | 重庆紫光华山智安科技有限公司 | Data migration storage method, device and management node |
CN114968095B (en) * | 2022-05-11 | 2024-09-17 | 重庆紫光华山智安科技有限公司 | Distributed hard disk management method, system, electronic device and readable storage medium |
CN114816278B (en) * | 2022-06-30 | 2022-11-11 | 苏州浪潮智能科技有限公司 | Data migration method, system, equipment and storage medium of storage server |
CN115952005B (en) * | 2023-02-24 | 2023-05-30 | 浪潮电子信息产业股份有限公司 | Method, device, equipment and readable storage medium for metadata load balancing |
CN118760657B (en) * | 2024-09-09 | 2024-11-19 | 腾讯科技(深圳)有限公司 | Storage type change method, related device and medium |
CN119397055B (en) * | 2024-12-31 | 2025-04-22 | 浙江大华技术股份有限公司 | Metadata processing method and device, storage medium and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102622315A (en) * | 2012-02-24 | 2012-08-01 | 华为技术有限公司 | Method, device and system for controlling disc visiting |
CN105278882A (en) * | 2015-10-26 | 2016-01-27 | 创新科存储技术有限公司 | Disk management method of distributed file system |
CN106528005A (en) * | 2017-01-12 | 2017-03-22 | 郑州云海信息技术有限公司 | Disk adding method and device for distributed type storage system |
CN108595119A (en) * | 2018-03-30 | 2018-09-28 | 浙江大华技术股份有限公司 | A kind of method of data synchronization and distributed system |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7146475B2 (en) * | 2003-11-18 | 2006-12-05 | Mainstar Software Corporation | Data set level mirroring to accomplish a volume merge/migrate in a digital data storage system |
CN102364474B (en) * | 2011-11-17 | 2014-08-20 | 中国科学院计算技术研究所 | Metadata storage system for cluster file system and metadata management method |
US9250823B1 (en) * | 2014-05-20 | 2016-02-02 | Emc Corporation | Online replacement of physical storage in a virtual storage system |
CN107807794B (en) * | 2017-10-31 | 2021-02-26 | 新华三技术有限公司 | Data storage method and device |
CN109189326B (en) * | 2018-07-25 | 2020-09-08 | 华为技术有限公司 | Distributed cluster management method and device |
CN111381766B (en) * | 2018-12-28 | 2022-08-02 | 杭州海康威视系统技术有限公司 | A method for dynamically loading a disk and a cloud storage system |
-
2020
- 2020-09-28 CN CN202011037231.1A patent/CN111880751B/en active Active
-
2021
- 2021-09-28 WO PCT/CN2021/121441 patent/WO2022063322A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102622315A (en) * | 2012-02-24 | 2012-08-01 | 华为技术有限公司 | Method, device and system for controlling disc visiting |
CN105278882A (en) * | 2015-10-26 | 2016-01-27 | 创新科存储技术有限公司 | Disk management method of distributed file system |
CN106528005A (en) * | 2017-01-12 | 2017-03-22 | 郑州云海信息技术有限公司 | Disk adding method and device for distributed type storage system |
CN108595119A (en) * | 2018-03-30 | 2018-09-28 | 浙江大华技术股份有限公司 | A kind of method of data synchronization and distributed system |
Also Published As
Publication number | Publication date |
---|---|
WO2022063322A1 (en) | 2022-03-31 |
CN111880751A (en) | 2020-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111880751B (en) | Hard disk migration method, distributed storage cluster system and storage medium | |
CN110311831B (en) | Container cloud-based system resource monitoring method and related equipment | |
CN108235751B (en) | Method, device and data storage system for identifying sub-health of object storage device | |
CN104202375A (en) | Method and system for synchronous data | |
CN105824846B (en) | Data migration method and device | |
CN105338078A (en) | Data storage method and device used for storing system | |
CN104346373A (en) | Partition log queue synchronization management method and device | |
CN103593257B (en) | A kind of data back up method and device | |
CN108595119B (en) | Data synchronization method and distributed system | |
CN111399753B (en) | Method and device for writing pictures | |
US20140156853A1 (en) | Computer and resource retrieval method | |
CN113946276A (en) | Disk management method and device in cluster and server | |
CN109298977A (en) | A kind of virtual machine business quick recovery method, system, device and storage medium | |
CN112711382A (en) | Data storage method and device based on distributed system and storage node | |
CN108710646A (en) | A kind of method and device that data synchronize | |
CN110569231B (en) | Data migration method, device, equipment and medium | |
CN112486831A (en) | Test system, test method, electronic equipment and storage medium | |
CN118170726A (en) | File cut-off method, equipment and storage medium of distributed file system | |
CN116401122A (en) | Method, system, device and medium for processing node faults of distributed storage system | |
CN105357462B (en) | A kind of PVR subregion method for recording and system | |
CN111190549A (en) | A method, device, device and medium for obtaining available capacity of a shared volume | |
CN108614873B (en) | Data processing method and device | |
CN117851304B (en) | Hard disk replacement method, device, equipment and medium | |
CN111405313A (en) | Method and system for storing streaming media data | |
CN116991815B (en) | Log collection method, device, equipment and medium of distributed storage system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |