A method, device, system, electronic device and medium for data migration
By selecting the target migration host among multiple candidate migration hosts and migrating the target data to an alternative disk, the impact of data migration on the business of distributed storage systems when disk corruption is solved, and more efficient data migration is achieved.
Patent Information
- Application Number
- CN202210744111.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-06-27
AI Technical Summary
When the existing distributed storage system is damaged, all hosts participate in data migration, resulting in a surge in read and write requests and affecting normal business.
Reduce the number of host reads and writes by selecting the target migration host among multiple candidate migration hosts.
It reduces the impact on the normal business of the system, ensures the performance of the distributed storage system, and reduces the impact on the normal business.
Smart Images

Figure CN115016738B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of distributed storage, and specifically to a method, device, system, electronic device and medium for data migration. Background Art
[0002] Existing distributed storage systems contain a large number of hosts and disks, and the probability of hardware damage is high. If the damaged disk cannot be rebuilt quickly, the data integrity and availability of the distributed storage system will be greatly reduced.
[0003] In order to solve the above problem, in the related technology, after the disk of a host is damaged, the disks on all other hosts will migrate the data stored in the bad disk, that is, all hosts in the system must participate in the data migration of the bad disk, resulting in a large number of read and write requests for each disk, thereby affecting normal business requests.
[0004] Therefore, how to reduce the impact on the normal business of the system in the event of a damaged disk becomes a problem that needs to be solved. Summary of the invention
[0005] Embodiments of the present application provide a method, device, system, electronic device and medium for data migration. Through some embodiments of the present application, it is at least possible to reduce the read and write requests of each host in the system in the event of a damaged disk, thereby reducing the impact on the normal business of the system.
[0006] In a first aspect, the present application provides a method for data migration, which is applied to a host to be migrated, and the method includes: confirming that there is at least one damaged disk in the host to be migrated, and sending a data migration instruction to a platform server, wherein the data migration instruction is used to request an available alternative disk from the platform server, and the available alternative disk is located on a host other than the host to be migrated in a distributed storage system; receiving address information of the target migration host returned by the platform server based on the data migration instruction, wherein the target migration host is selected by the platform server based on the working status of the alternative disks included in multiple candidate migration hosts; sending a request connection signal to the target migration host based on the address information; obtaining a disk path generated by the target migration host based on the request connection signal, wherein the disk path is a data transmission channel between the host to be migrated and the target migration host; and migrating the target data to the alternative disk through the disk path.
[0007] Therefore, unlike the method in the related art of using all storage hosts to migrate data in a damaged disk, the embodiment of the present application migrates the target data to an alternative disk by selecting a target migration host from multiple candidate migration hosts, which can reduce the number of read and write times of the host read and write ports, thereby ensuring the performance of the distributed storage system and reducing the impact on normal business.
[0008] In combination with the first aspect, in some embodiments of the present application, after migrating the target data to the alternative disk through the disk path, the method also includes: confirming that there is no damaged disk in the host to be migrated, and generating a disconnection signal; obtaining the target data based on the disconnection signal, and storing the target data in a normal disk, wherein the normal disk is obtained by replacing at least one damaged disk.
[0009] Therefore, the embodiment of the present application can migrate the target data back to the normal disk of the host to be migrated by releasing the connection signal, thereby completing the data migration.
[0010] In combination with the first aspect, in some embodiments of the present application, after migrating the target data from the alternative disk to the normal disk based on the release signal, the method further includes: generating a data recovery instruction and sending the data recovery instruction to the platform server.
[0011] Therefore, the embodiment of the present application can change the status of the disk in the target migration host to idle by sending a data recovery instruction to the platform server.
[0012] In a second aspect, the present application provides a device for data migration, which is applied to a host to be migrated, and the device includes: an instruction sending module, configured to confirm that there is at least one damaged disk in the host to be migrated, and send a data migration instruction to a platform server, wherein the data migration instruction is used to request an available alternative disk from the platform server, and the available alternative disk is located on a host other than the host to be migrated in a distributed storage system; an address receiving module, configured to receive the address information of the target migration host returned by the platform server based on the data migration instruction, wherein the target migration host is selected by the platform server according to the working status of the alternative disks included in multiple candidate migration hosts; a signal sending module, configured to send a request connection signal to the target migration host according to the address information; a path acquisition module, configured to obtain a disk path generated by the target migration host based on the request connection signal, wherein the disk path is a data transmission channel between the host to be migrated and the target migration host; a data migration module, configured to migrate the target data to the alternative disk through the disk path.
[0013] In combination with the second aspect, in some embodiments of the present application, the data migration module is further configured to: confirm that there is no damaged disk in the host to be migrated, and generate a disconnection signal; obtain the target data based on the disconnection signal, and store the target data in a normal disk, wherein the normal disk is obtained by replacing at least one damaged disk.
[0014] In combination with the second aspect, in some implementations of the present application, the data migration module is further configured to: generate a data recovery instruction, and send the data recovery instruction to the platform server.
[0015] In a third aspect, the present application provides a method for data migration, which is applied to a platform server, and the method comprises: in response to a data migration instruction sent by the host to be migrated, selecting a target migration host from the multiple candidate migration hosts and obtaining the address information of the target migration host, wherein the target migration host is selected based on the working status of the alternative disks included in the multiple candidate migration hosts, and the target migration host is used to migrate the target data in the host to be migrated; and sending the address information of the target migration host to the host to be migrated.
[0016] Therefore, the embodiment of the present application can coordinate the working status of all spare disks in the distributed storage system through the platform server, thereby realizing the reasonable allocation of data migration.
[0017] In combination with the third aspect, in some embodiments of the present application, the platform server stores the working status of each candidate migration host among the multiple candidate migration hosts, and the working status is used to characterize whether the multiple candidate migration hosts are in use; selecting the target migration host from the multiple candidate migration hosts includes: obtaining the working status of each candidate migration host among the multiple candidate migration hosts; and selecting the target migration host from the multiple candidate migration hosts based on the working status.
[0018] In combination with the third aspect, in some embodiments of the present application, after selecting the target migration host from the multiple candidate migration hosts based on the working status, the method also includes: adjusting the working status of the candidate disk included in the target migration host to being in use.
[0019] In combination with the third aspect, in some embodiments of the present application, after selecting the target migration host from the multiple candidate migration hosts based on the working status, the method also includes: in response to a data recovery instruction sent by the host to be migrated, adjusting the working status of the alternative disk included in the target migration host to an idle state.
[0020] In a fourth aspect, the present application provides a data migration device, which is applied to a platform server, and the device includes: a screening module is configured to: in response to a data migration instruction sent by the host to be migrated, select a target migration host from the multiple candidate migration hosts and obtain the address information of the target migration host, wherein the target migration host is selected based on the working status of the alternative disks included in the multiple candidate migration hosts, and the target migration host is used to migrate the target data in the host to be migrated; an address sending module is configured to: send the address information of the target migration host to the host to be migrated.
[0021] In combination with the fourth aspect, in some embodiments of the present application, the platform server stores the working status of each candidate migration host among the multiple candidate migration hosts, and the working status is used to characterize whether the multiple candidate migration hosts are in use; the screening module is configured to: obtain the working status of each candidate migration host among the multiple candidate migration hosts; and select the target migration host from the multiple candidate migration hosts based on the working status.
[0022] In combination with the fourth aspect, in some implementations of the present application, the screening module is configured to: adjust the working status of the candidate disk included in the target migration host to being in use.
[0023] In combination with the fourth aspect, in some implementations of the present application, the screening module is configured to: in response to a data recovery instruction sent by the host to be migrated, adjust the working state of the candidate disk included in the target migration host to an idle state.
[0024] In a fifth aspect, the present application provides a distributed storage system, which includes: a host to be migrated, configured to: confirm that there is at least one damaged disk in the host to be migrated, and send a data migration instruction to a platform server, wherein the data migration instruction is used to request an available alternative disk from the platform server, and the available alternative disk is located on a host other than the host to be migrated in the distributed storage system; receive the address information of the target migration host returned by the platform server based on the data migration instruction, wherein the target migration host is selected by the platform server based on the working status of the alternative disks included in multiple candidate migration hosts; send a request connection signal to the target migration host based on the address information; obtain a disk path generated by the target migration host based on the request connection signal, wherein the disk path is a data transmission channel between the host to be migrated and the target migration host, and the target data is migrated to the alternative disk through the disk path. The platform server is configured to: respond to a data migration instruction sent by the host to be migrated, and execute a method as described in any embodiment of the third aspect according to the data migration instruction to obtain the target migration host and the address information of the target migration host; the target migration host is configured to: store the target data.
[0025] In combination with the fifth aspect, in some embodiments of the present application, if the distributed storage system includes M hosts, the number of the multiple candidate migration hosts is less than or equal to the value corresponding to the preset proportion of the M hosts, where M is an integer greater than 1.
[0026] In a sixth aspect, the present application provides an electronic device comprising: a processor, a memory and a bus; the processor is connected to the memory via the bus, and the memory stores computer-readable instructions, which, when executed by the processor, are used to implement the method described in any embodiment of the first and third aspects.
[0027] In a seventh aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described in any embodiment of the first aspect and the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 An interactive diagram of data migration shown in an embodiment of the present application;
[0029] Figure 2 A flow chart of a method for data migration shown in an embodiment of the present application;
[0030] Figure 3This is one of the schematic diagrams of the composition of a distributed storage system shown in an embodiment of the present application;
[0031] Figure 4 The second schematic diagram of the composition of a distributed storage system shown in an embodiment of the present application;
[0032] Figure 5 The third schematic diagram of the composition of a distributed storage system shown in an embodiment of the present application;
[0033] Figure 6 A schematic diagram of the internal structure of a data migration device shown in an embodiment of the present application;
[0034] Figure 7 This is a diagram of the internal structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0036] The embodiments of the present application can be applied to the scenario of migrating data from a damaged disk of a distributed storage system. In order to improve the problems in the background technology, in some embodiments of the present application, the data migration of the damaged disk is achieved by mapping the spare disk in the target migration host to the host to be migrated. For example: in some embodiments of the present application, when the host to be migrated confirms the existence of a damaged disk, it sends a data migration instruction to the platform server. The platform server responds to the data migration instruction, selects a target migration host, and sends the address information of the target migration host to the host to be migrated. After the host to be migrated establishes a connection with the target migration host through the address information, the target migration host maps its own spare disk to the host to be migrated, and the host to be migrated migrates the target data to the spare disk to achieve data migration.
[0037] It should be noted that the host to be migrated is a storage host with at least one damaged disk. The platform server is a device that provides host management services in addition to multiple storage hosts in the distributed storage system. The target migration host is a storage host that performs data migration with the host to be migrated.
[0038] The method steps in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0039] Figure 1 A system interaction diagram for data migration in some embodiments of the present application is provided, and the system includes a host to be migrated 110, a platform server 120, and a target migration host 130. Specifically, the host to be migrated 110 executes the following S1 and S2: S1, confirming that there is at least one damaged disk in the host to be migrated, S2, sending a data migration instruction, and after receiving the data migration instruction, the platform server 120 executes S3 to select a target migration host from multiple candidate migration hosts, obtains the address information of the target migration host, and executes S4 to send the address information of the target migration host. The host to be migrated 110 executes S5 to send a connection request signal to the target migration host according to the address information, and executes S6 to request a connection signal to the target migration host. The target migration host 130 executes S7 to establish a disk path, and then executes S8 to send the disk path to the host to be migrated. The host to be migrated 110 executes S9 to send target data to the target migration host based on the disk path.
[0040] What is different from the embodiment of the present application is that in the related art, after a disk of a host is damaged, the disks on all other hosts will migrate the data stored in the damaged disk, that is, all hosts in the system must participate in the data migration of the damaged disk, resulting in a large number of read and write requests for all disks, thereby affecting normal business requests. The embodiment of the present application migrates the target data to a target migration host selected from multiple candidate migration hosts. Therefore, unlike the related art, the embodiment of the present application does not require all hosts in the system to participate in the data migration of the damaged disk, and can achieve the transfer of the target data in the damaged disk.
[0041] It is understandable that if Figure 2 As shown, in the related art, a storage system cluster (i.e., a distributed storage system) is composed of multiple storage hosts (e.g., Figure 2The distributed storage system in the example includes storage host 1, storage host 2, and storage host 3, and each storage host is composed of multiple disks. In general, the configuration of each storage host is the same, so the amount of data carried on each disk and each storage host is generally uniform, and the access volume of each disk is also roughly the same. If a disk is damaged and the administrator does not replace it in time, then in order to ensure that the data security level is not reduced, the storage system cluster will read other copies and rebuild the data on the disk to other disks to ensure that multiple copies of data are available. At this time, other disks will carry more data, and the data is still evenly distributed on the remaining disks. However, the host with the damaged disk has one less disk. At this time, the total amount of data on the host is unbalanced, so the number of requests received by the host is also different, resulting in uneven utilization of the CPU and memory resources of each storage host. When a new disk is replaced, the utilization rate of the new disk is zero. In order to balance the data, each disk will migrate the previously rebuilt data back. Therefore, during the entire process, other normal disks need to participate in the data migration in and out of the disk, which may affect the performance of the entire cluster and cause business jams.
[0042] like Figure 3 As shown, there is a method in the related art to add a spare disk to each storage host. If there are many storage hosts, the entire cluster will need many hot spare disks, which will increase costs and cannot solve the problem of multiple disks of a storage host being damaged at the same time.
[0043] The following describes a specific implementation scheme of a data migration method performed by a host to be migrated in an embodiment of the present application.
[0044] At least to solve the problems in the background technology, such as Figure 4 As shown, some embodiments of the present application provide a method for data migration, the method comprising:
[0045] S410, confirming that there is at least one damaged disk in the host to be migrated, and sending a data migration instruction to the platform server.
[0046] It should be noted that, if the distributed storage system includes M hosts, the number of multiple candidate migration hosts is less than or equal to a value corresponding to a preset proportion of the M hosts, where M is an integer greater than 1.
[0047] That is to say, if the pre-configuration ratio is 30%, then the value corresponding to the pre-configuration ratio of M hosts is 30% multiplied by M, that is, only 30% multiplied by M storage hosts including spare disks are needed in the distributed storage system. For another example, more than 3 hosts that do not exceed 10% of the total number of storage hosts are selected in the distributed storage system, and each selected host adds or selects a disk as a spare disk.
[0048] It can be understood that the data migration instruction is used to request the platform server for available candidate disks, and the available candidate disks are located on hosts other than the host to be migrated in the distributed storage system.
[0049] In one embodiment of the present application, first, when the network traffic of the host to be migrated is abnormal or the task execution is abnormal, it is confirmed that there is at least one damaged disk in the host to be migrated. At this time, in order not to affect the overall business, the target data in the at least one damaged disk needs to be migrated. Therefore, a data migration instruction is sent to the platform server.
[0050] Then, the platform server selects a target migration host from a plurality of candidate migration hosts in response to the data migration instruction sent by the host to be migrated and obtains the address information of the target migration host.
[0051] Specifically, the platform server stores the working status of each candidate migration host among multiple candidate migration hosts. It can be understood that the working status is used to indicate whether the multiple candidate migration hosts are in use. For example, the working status of the candidate disk in storage host 1 is in use, and the working status of the candidate disk in storage host 2 is idle. After receiving the data migration instruction, the platform server selects a target migration host whose working status of the candidate disk is idle from the multiple candidate migration hosts. If there are multiple idle candidate disks, they are randomly selected.
[0052] After the platform server selects the target migration host, in order to enable the host to be migrated to connect with the target migration host, the address information of the target migration host is obtained and sent to the host to be migrated. It is understandable that the address information may be the IP address of the target migration host. The platform server also adjusts the working status of the candidate disk included in the target migration host to being used, so as to ensure that the target migration host is not selected next time the target migration host is searched.
[0053] S420: Receive address information of a target migration host returned by the platform server based on the data migration instruction.
[0054] That is, after the platform server sends the address information of the target migration host to the host to be migrated, the target migration host receives it.
[0055] S430: Send a connection request signal to the target migration host according to the address information.
[0056] That is, after the host to be migrated receives the address information of the target migration host, it searches for the target migration host corresponding to the address information in the distributed storage system, and after locking the target migration host, it sends a signal requesting connection to the target migration host.
[0057] After receiving the signal of requesting connection sent by the host to be migrated, the target migration host generates a disk path connected to the host to be migrated. It can be understood that the disk path is a data transmission channel between the host to be migrated and the target migration host. And the target migration host sends the disk path to the host to be migrated so that the host to be migrated can perform data migration according to the disk path.
[0058] It should be noted that the spare disk included in the target migration host can also be mapped to the host to be migrated through the target protocol (eg, iscsi protocol). It is understandable that the spare disks on multiple candidate migration hosts can be shared by all hosts in the distributed storage system.
[0059] S440: Obtain a disk path generated by the target migration host based on the connection request signal.
[0060] That is, after the target migration host sends the disk path to the host to be migrated, the target migration host correspondingly obtains the disk path.
[0061] S450, migrate the target data to the alternative disk through the disk path.
[0062] That is, the candidate disk in the target migration host can be mapped to the host to be migrated through the disk path, and the host to be migrated migrates the target data in the damaged disk to the candidate disk.
[0063] It should be noted that if the number of at least one damaged disk is 1, the number of corresponding target migration hosts is also 1. If the number of at least one damaged disk is 2, the number of corresponding target migration hosts is 2, that is, one damaged disk corresponds to one target migration host.
[0064] In one embodiment of the present application, after S450, the administrator of the distributed storage system will replace the damaged disk. When the device to be migrated confirms that there is no damaged disk in the host to be migrated, it generates a disconnection signal, and then sends the disconnection signal to the target migration host. After receiving the disconnection signal, the target migration host transfers the target data in the spare disk to the normal disk in the host to be migrated. It can be understood that the normal disk is obtained by replacing at least one damaged disk.
[0065] After confirming that the target data has been saved in all normal disks, the host to be migrated generates a data recovery instruction and sends it to the platform server. The platform server receives and responds to the data recovery instruction sent by the host to be migrated, and adjusts the working state of the candidate disk included in the target migration host to an idle state, so as to facilitate the use of the next data migration.
[0066] As a specific embodiment of the present application, Figure 3 As shown in the figure, storage host 2 does not have a hot spare disk, but it has two damaged disks. You can use the spare disks on other storage hosts to map the spare disks of other storage hosts to your host. For the upper-layer management program, it is just like using a local disk. The spare disk is in an idle state before being mapped, and in use after being mapped. The spare disk in use cannot be mapped by other hosts. When a storage host's disk is damaged, the data on it will not be rebuilt on other hosts. Instead, a spare disk is mapped locally, and the spare disk is created as a data disk, which is used as a physical disk to carry the data on the damaged disk. In this way, whether it is a storage or a disk, the amount of data carried on it remains unchanged, and the access request, CPU and memory load on each host remain basically unchanged. When the administrator replaces the damaged disk with a new physical disk, the data on the spare disk is migrated to the new disk (i.e., the normal disk). No other disks are required to participate in the migration process, so the impact on the cluster is relatively small.
[0067] The specific implementation steps of the data migration method provided in this application are as follows:
[0068] S1: The cluster (i.e., distributed storage system) selects individual disks as global candidate disks.
[0069] S2: If a host has a bad disk, select an idle spare disk and map it to the host, and set the spare disk to be in use.
[0070] S3: Use the mapped standby disk as a data disk and rebuild the data on the failed disk.
[0071] S4: After the new physical disk replaces the bad disk, the data on the backup disk is migrated to the new disk.
[0072] S5: Unmap the candidate disk, and set the candidate disk to an idle state.
[0073] As a specific embodiment of the present application, the present invention mainly provides a global alternative disk solution for a distributed storage system. It avoids the waste of storage resources caused by the need to equip each host with an alternative disk. For example, if a cluster has 10 hosts, only 3 hosts need to have alternative disks, which can reduce 70% of the alternative disks compared to a single-machine hot standby solution, and the cluster can support 3 disks being damaged at the same time. The use of alternative disks can reduce the risk of cluster degradation and ensure the security of multiple copies of data. When alternative disks are not used, if a disk fails, then most of the storage volumes in the cluster have a copy that is inaccessible and in a degraded state. If the cluster has no other storage space for data reconstruction, the storage volume will be degraded for a long time. If another disk is damaged, it is possible that multiple copies of the storage volume will be unavailable.
[0074] For example, a cluster has 3 hosts, each host has 4 disks, and the data volume on each disk is 1TB. One of the disks is broken. In the absence of a spare disk, the data on the bad disk will be dispersed and migrated to the other 11 disks. In this case, each disk needs to write 93GB (1TB / 11) of data. After replacing the new disk, each disk needs to read 93GB of data to migrate the data to the new disk. Before replacing the new disk, the host where the bad disk is located carries three-quarters of the data volume of other hosts, which easily leads to unbalanced access requests, CPU and memory loads of various hosts. With a global spare disk, other disks reduce the data writing and reading process. Data migration is only between the spare disk and the new disk, without the participation of other disks, reducing the impact on other disks.
[0075] Therefore, the data migration method provided by the present application realizes cross-host disk mapping through the iscsi protocol, achieves global sharing of candidate disks, reduces the total number of cluster candidate disks, avoids waste of storage resources, and solves the problem of simultaneous damage to multiple disks on a single host. At the same time, the global candidate disk can avoid unbalanced host access requests, CPU and memory loads, and can reduce the amount of data access to other disks during reconstruction and migration, avoiding affecting normal business requests of the system.
[0076] Therefore, this application can reduce the impact of a bad disk on normal business in the cluster, while also reducing the time of cluster degradation, improving data security, reducing waste of storage resources, and reducing the amount of data access to other disks during reconstruction and migration, thereby avoiding affecting the normal business requests of the system.
[0077] A specific embodiment of a method for data migration is described above, and a device for data migration will be described below.
[0078] like Figure 6As shown, a data migration device 600 includes: an instruction sending module 610, an address receiving module 620, a signal sending module 630, a path acquisition module 640 and a data migration module 650.
[0079] The instruction sending module 610 is configured to confirm that there is at least one damaged disk in the host to be migrated, and to send a data migration instruction to the platform server, wherein the data migration instruction is used to request an available alternative disk from the platform server, and the available alternative disk is located on a host other than the host to be migrated in the distributed storage system.
[0080] The address receiving module 620 is configured to receive the address information of the target migration host returned by the platform server based on the data migration instruction, wherein the target migration host is selected by the platform server according to the working status of the candidate disks included in multiple candidate migration hosts.
[0081] The signal sending module 630 is configured to send a connection request signal to the target migration host according to the address information.
[0082] The path acquisition module 640 is configured to acquire a disk path generated by the target migration host based on the connection request signal, wherein the disk path is a data transmission channel between the host to be migrated and the target migration host.
[0083] The data migration module 650 is configured to migrate the target data to the candidate disk through the disk path.
[0084] In some embodiments of the present application, the data migration module 650 is further configured to: confirm that there is no damaged disk in the host to be migrated, and generate a disconnection signal; obtain the target data based on the disconnection signal, and store the target data in a normal disk, wherein the normal disk is obtained by replacing at least one damaged disk.
[0085] In some implementations of the present application, the data migration module 650 is further configured to: generate a data recovery instruction, and send the data recovery instruction to the platform server.
[0086] In the embodiments of the present application, Figure 6 The modules shown can achieve Figures 1 to 5 The various processes executed by the host to be migrated in the method embodiment. Figure 6 The operations and / or functions of each module in Figures 1 to 5 The method embodiment in the embodiment includes the corresponding process of the host to be migrated. For details, please refer to the description in the above method embodiment. To avoid repetition, the detailed description is appropriately omitted here.
[0087] like Figure 7 As shown, an embodiment of the present application provides an electronic device 700, including: a processor 710, a memory 720 and a bus 730, wherein the processor is connected to the memory via the bus, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, they are used to implement a method as described in any one of the above embodiments. For details, please refer to the description in the above method embodiments. To avoid repetition, the detailed description is appropriately omitted here.
[0088] Among them, the bus is used to realize the direct connection and communication of these components. Among them, the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0089] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method described in the above embodiment may be executed.
[0090] Understandably, Figure 7 The structure shown is for illustration only and may also include Figure 5 More or fewer components as shown, or with Figure 7 Different configurations are shown. Figure 7 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0091] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a server, any of the methods described in all the above-mentioned implementation modes is implemented. For details, please refer to the description in the above-mentioned method embodiments. To avoid repetition, the detailed description is appropriately omitted here.
[0092] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0093] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for data migration, characterized in that: Applied to the host to be migrated, the method includes: Confirming that there is at least one damaged disk in the host to be migrated, and sending a data migration instruction to the platform server, wherein the data migration instruction is used to request an idle candidate disk from the platform server, and the available candidate disk is located on a host other than the host to be migrated in the distributed storage system; Receiving address information of a target migration host returned by the platform server based on the data migration instruction, wherein the target migration host is selected by the platform server according to the working status of candidate disks included in multiple candidate migration hosts; wherein the number of the multiple candidate migration hosts is less than or equal to the value corresponding to the preset proportion of the M hosts in the distributed storage system; Sending a connection request signal to the target migration host according to the address information; Acquire a disk path generated by the target migration host based on the connection request signal, wherein the disk path is a data transmission channel between the host to be migrated and the target migration host; Migrating the target data to the candidate disk through the disk path; confirming that there is no damaged disk in the host to be migrated, and generating a disconnection signal; when the damaged disk is replaced with a normal disk, the target data in the candidate disk is stored again in the normal disk, and the working state of the candidate disk is changed; Wherein, one damaged disk corresponds to one target migration host, and the candidate disk is mapped to the host to be migrated.
2. The method according to claim 1, characterized in that After migrating the target data to the candidate disk through the disk path, the method further includes: The target data is acquired based on the disconnection signal, and the target data is stored in a normal disk, wherein the normal disk is obtained by replacing at least one damaged disk.
3. The method according to claim 2, characterized in that After acquiring the target data based on the disconnection signal and storing the target data in a normal disk, the method further includes: A data recovery instruction is generated and sent to the platform server, wherein the data recovery instruction is used to enable the platform server to change the working state of the candidate disk.
4. A method for data migration, characterized in that: Applied to a platform server, the method comprises: In response to a data migration instruction sent by a host to be migrated, a target migration host is selected from a plurality of candidate migration hosts and address information of the target migration host is obtained, wherein the target migration host is selected according to the working status of the candidate disks included in the plurality of candidate migration hosts, and the target migration host is used to migrate target data in the host to be migrated; wherein the number of the plurality of candidate migration hosts is less than or equal to the value corresponding to the preset proportion of M hosts in the distributed storage system; confirming that there is no damaged disk in the host to be migrated, and generating a disconnection signal; when the damaged disk is replaced with a normal disk, the target data in the candidate disk is stored again in the normal disk, and the working status of the candidate disk is changed; Sending the address information of the target migration host to the host to be migrated; Wherein, one damaged disk corresponds to one target migration host, and the candidate disk is mapped to the host to be migrated.
5. The method according to claim 4, characterized in that The platform server stores a working status of each candidate migration host among the multiple candidate migration hosts, where the working status is used to indicate whether the multiple candidate migration hosts are in use; The selecting a target migration host from the plurality of candidate migration hosts comprises: Obtaining a working status of each candidate migration host among the multiple candidate migration hosts; The target migration host is selected from the plurality of candidate migration hosts based on the working status.
6. The method according to claim 5, characterized in that After selecting the target migration host from the plurality of candidate migration hosts based on the working status, the method further includes: The working status of the candidate disk included in the target migration host is adjusted to being in use.
7. The method according to claim 5, characterized in that After selecting the target migration host from the plurality of candidate migration hosts based on the working status, the method further includes: In response to the data recovery instruction sent by the host to be migrated, the working state of the candidate disk included in the target migration host is adjusted to an idle state.
8. A distributed storage system, characterized in that: The distributed storage system comprises: The host to be migrated is configured as follows: Confirming that there is at least one damaged disk in the host to be migrated, and sending a data migration instruction to the platform server, wherein the data migration instruction is used to request an idle candidate disk from the platform server, and the available candidate disk is located on a host other than the host to be migrated in the distributed storage system; receiving address information of the target migration host returned by the platform server based on the data migration instruction, wherein the target migration host is selected by the platform server according to the working status of candidate disks included in multiple candidate migration hosts; Sending a connection request signal to the target migration host according to the address information; Acquire a disk path generated by the target migration host based on the connection request signal, wherein the disk path is a data transmission channel between the host to be migrated and the target migration host; Migrating the target data to the candidate disk through the disk path; The platform server is configured as follows: In response to a data migration instruction sent by the host to be migrated, and according to the data migration instruction, executing the method according to any one of claims 4 to 7, obtaining the target migration host and the address information of the target migration host; The target migration host is configured as: storing the target data; The number of the plurality of candidate migration hosts is less than or equal to the value corresponding to the preset proportion of the M hosts in the distributed storage system; confirming that there is no damaged disk in the host to be migrated, and generating a disconnection signal; when the damaged disk is replaced with a normal disk, the target data in the candidate disk is stored again in the normal disk, and the working state of the candidate disk is changed; Wherein, one damaged disk corresponds to one target migration host, and the candidate disk is mapped to the host to be migrated.
9. The system according to claim 8, characterized in that If the distributed storage system includes M hosts, the number of the multiple candidate migration hosts is less than or equal to a value corresponding to a preset proportion of the M hosts, where M is an integer greater than 1.
10. A data migration device, characterized in that: Applied to a host to be migrated, the device is used to execute the method according to claim 1, comprising: an instruction sending module, configured to confirm that there is at least one damaged disk in the host to be migrated, and send a data migration instruction to the platform server, wherein the data migration instruction is used to request an available candidate disk from the platform server, and the available candidate disk is located on a host other than the host to be migrated in the distributed storage system; an address receiving module, configured to receive address information of a target migration host returned by the platform server based on the data migration instruction, wherein the target migration host is selected by the platform server according to working states of candidate disks included in a plurality of candidate migration hosts; a signal sending module, configured to send a connection request signal to the target migration host according to the address information; a path acquisition module, configured to acquire a disk path generated by the target migration host based on the connection request signal, wherein the disk path is a data transmission channel between the host to be migrated and the target migration host; The data migration module is configured to migrate the target data to the candidate disk through the disk path.
11. An electronic device, characterized in that: include: processor, memory, and bus; The processor is connected to the memory via the bus, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, they are used to implement the method according to any one of claims 1 to 7.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which implements the method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Data request method and apparatus and medium
CN112000635A
Storage system fault recovery method and device, computer equipment and medium
CN114265728A
Disk switching method, system and device, medium and distributed storage system
CN116560916A
Data Volume Rebuilder and Methods for Arranging Data Volumes for Improved RAID Reconstruction Performance
US20100251012A1