Data recovery method and distributed storage system, device, and program product
By setting the cluster identification and monitoring the number of failures in the distributed storage system, entering the data recovery stage, calculating health values and performing data recovery operations, the problem of low data recovery efficiency in the distributed storage system is solved and efficient utilization of resources is achieved.
Patent Information
- Application Number
- CN202410858370.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Distributed storage systems find it difficult to find a balance between data recovery and front-end services, resulting in insufficient resource utilization, inability to effectively perform data recovery, and the lack of an adaptive data recovery model.
When an OSD node fails, set the cluster identification to enter the peer-to-peer interconnection stage, monitor the number of failures, delete the identification after exceeding the preset number and enter the data recovery stage, calculate the health value of the distributed storage system, and perform target data operations based on the health value. Recover data.
It reduces frequent PG peer-to-peer interconnection operations, avoids repeated calculation consumption, makes full use of resources for data recovery, solves the problem of inability to effectively perform data recovery in distributed storage systems, and achieves the effect of efficient resource utilization.
Smart Images

Figure CN118394560B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a data recovery method and a distributed storage system, device, and program product. Background Art
[0002] In related technologies, distributed storage systems can effectively solve the problems of scale changes, equipment changes, data changes, etc. caused by large-scale deployment of clusters. Distributed storage systems have high reliability, high automation, and high scalability. High reliability is reflected in the ability to handle failures in a timely manner and to effectively recover the affected data when a cluster system fails. When a distributed storage system recovers data, it consumes a large amount of computing, network, and hard disk resources of the server cluster, which is crucial for efficient use of resources. At the same time, the smooth progress of front-end business is also inseparable from stable performance support to ensure smooth continuous access and writing.
[0003] When faced with a conflict between data recovery and front-end business needs, users often need to make a choice: data recovery priority or front-end business priority. Data recovery priority can quickly restore data integrity and security, and is suitable for scenarios with high data security requirements. Front-end business priority, on the other hand, places more emphasis on the smoothness of real-time business processing, and is suitable for situations where user experience needs to be guaranteed. In related technologies, there is a lack of adaptive data recovery mode, which cannot fully utilize physical resources, nor can it ensure the normal operation of front-end business while maximizing back-end recovery efficiency. Summary of the invention
[0004] The embodiments of the present application provide a data recovery method and a distributed storage system, device, and program product to at least solve the problem in the related art that data cannot be effectively recovered in a distributed storage system.
[0005] According to one embodiment of the present application, a data recovery method is provided, which is applied to a distributed storage system, and the method includes: when an OSD node in the distributed storage system fails and enters the peer-to-peer interconnection stage of a PG node connected to the OSD node, setting a cluster identifier of the distributed storage system, wherein the peer-to-peer interconnection stage is a stage of establishing a connection between the PG node and other PG nodes, and the cluster identifier is used to prevent entering a data recovery stage, and the data recovery stage is a stage of recovering data in the OSD node after establishing a connection between the PG node and the other PG nodes; determining the number of times the peer-to-peer interconnection stage is entered within a preset time period, and when the number is greater than the preset number and / or the number does not continue to increase, deleting the cluster identifier to enter the data recovery stage; calculating the health value of the distributed storage system in the data recovery stage, wherein the health value shown is used to represent the ability of the distributed storage system to process business; performing target data operations according to the health value to recover the data in the OSD node.
[0006] In an exemplary embodiment, when an OSD node in the distributed storage system fails and enters the peer-to-peer interconnection stage of the PG nodes connected to the OSD node, the cluster identifier of the distributed storage system is set, including: monitoring the status of the distributed storage system in real time through a network monitoring tool to obtain status information; when it is determined from the status information that the process map of the OSD node has changed, determining that the OSD node has failed and entering the peer-to-peer interconnection stage, wherein the process map is a map for managing the storage process of the OSD node; and adding the cluster identifier to the distributed storage system to prevent entering the data recovery stage.
[0007] In an exemplary embodiment, the number of times the peer-to-peer interconnection stage is entered within a preset time period is determined, and when the number is greater than the preset number and / or the number does not continue to increase, the cluster identifier is deleted to enter the data recovery stage, including: continuously monitoring the number of times the peer-to-peer interconnection stage is entered within the preset time period; when the number is greater than the preset number and / or the number does not continue to increase, determining that the multiple PG nodes corresponding to the multiple OSD nodes that have failed within the preset time period have all entered the peer-to-peer interconnection stage, wherein the multiple OSD nodes are nodes to be recovered; determining the paths of the multiple OSD nodes, and releasing the cluster identifier to enter the data recovery stage.
[0008] In an exemplary embodiment, calculating the health value of the distributed storage system during the data recovery phase includes: determining a first data recovery parameter of the distributed storage system; and calculating the health value of the distributed storage system during the process of performing the target data operation according to the first data recovery parameter.
[0009] In an exemplary embodiment, determining a first data recovery parameter of the distributed storage system includes: calculating a target backfill value, wherein the target backfill value is a parameter value for the PG node to perform a data backfill operation; calculating a target recovery value, wherein the target recovery value is a parameter value for the PG node to perform a data recovery operation; determining the first data recovery parameter based on the target backfill value and the target recovery value; wherein the target data operation includes the data backfill operation and / or the data recovery operation.
[0010] In an exemplary embodiment, calculating the target backfill value includes: determining the IOPS resources allowed in the distributed storage system for performing the data backfill operation, wherein the IOPS resources are used to represent the number of times the distributed storage system performs data backfill in the data backfill operation per second; calculating a first ratio between the IOPS resources and the number of the PG nodes that need to perform the data backfill operation to determine the available IOPS resources when each PG node performs the data backfill operation; determining the number of the OSD nodes that are allowed to perform the data backfill operation simultaneously to obtain a first upper limit value; and determining the target backfill value using the available IOPS resources and the first upper limit value.
[0011] In an exemplary embodiment, calculating the target recovery value includes: determining the network bandwidth resources allowed in the distributed storage system for performing the data recovery operation, wherein the network bandwidth resources are used to represent the data transmission capacity of the distributed storage system when performing the data recovery operation; calculating a second ratio between the network bandwidth resources and the average amount of data stored in the PG node to determine the number of the PG nodes allowed to simultaneously perform the data recovery operation; determining the number of the PG nodes that simultaneously perform the data recovery operation to obtain a second upper limit value; and determining the target recovery value using the number of PG nodes and the second upper limit value.
[0012] In an exemplary embodiment, after determining the first data recovery parameter based on the target backfill value and the target recovery value, the method further includes: setting the waiting time of the data recovery operation in the target data operation to a preset time; setting the priority of the data recovery operation to a target priority; and performing the data recovery operation using the preset time and the target priority.
[0013] In an exemplary embodiment, in the process of performing the target data operation according to the first data recovery parameter, the health value of the distributed storage system is calculated, including: determining an operating status score of the distributed storage system, wherein the operating status score is used to represent the operating performance of the distributed storage system; determining a total node health score of all nodes in the distributed storage system, wherein the total node health score is used to represent the operating performance of all nodes; and calculating the sum of the operating status score of a first ratio and the total node health score of a second ratio to obtain the health value.
[0014] In an exemplary embodiment, determining the operation status score of the distributed storage system includes: determining a proportional score value of online nodes, wherein the proportional score value of the online nodes is used to represent the proportional relationship between the number of online nodes and the total number of nodes in the distributed storage system; determining a resource health value of the distributed storage system based on the IPOS resource value and the network bandwidth resource value in the distributed storage system; determining a node health value of the distributed storage system based on the OSD nodes and the PG nodes in the distributed storage system; determining a front-end performance score of the distributed storage system based on the IPOS resource value of the front-end business in the distributed storage system and the latency of the front-end business; and calculating the sum of the proportional score value of a third proportion, the resource health value of the third proportion, the node health value of the third proportion, and the front-end performance score of the third proportion to obtain the operation status score.
[0015] In an exemplary embodiment, determining a resource health value of the distributed storage system based on the IPOS resource value and the network bandwidth resource value in the distributed storage system includes: determining an average IPOS resource and a maximum IPOS resource in the distributed storage system; calculating a third ratio of the average IPOS resource to the maximum IPOS resource, and calculating the product of the third ratio and a first preset value to obtain the IPOS resource value; determining an actual network bandwidth and a maximum network bandwidth of the distributed storage system; calculating a fourth ratio of the actual network bandwidth to the maximum network bandwidth, and calculating the product of the fourth ratio and the first preset value to obtain the network bandwidth resource value; calculating the sum of the IPOS resource value and the network bandwidth resource value to obtain the resource health value.
[0016] In an exemplary embodiment, determining the node health value of the distributed storage system based on the OSD nodes and the PG nodes in the distributed storage system includes: calculating a fifth ratio between the number of online OSD nodes and the total number of OSD nodes in the distributed storage system, and calculating the product between the fifth ratio and a second preset value to obtain the OSD node health value; calculating a sixth ratio between the number of online PG nodes and the total number of PG nodes in the distributed storage system, and calculating the product between the sixth ratio and the second preset value to obtain the PG node health value; calculating the sum of the OSD node health value and the PG node health value to obtain the node health value.
[0017] In an exemplary embodiment, based on the IPOS resource value of the front-end business in the distributed storage system and the latency of the front-end business, the front-end performance score of the distributed storage system is determined, including: calculating the seventh ratio between the IPOS resources actually occupied by the front-end business and the maximum IPOS resources allocated to the front-end business, and calculating the product between the seventh ratio and the third preset value to obtain the IPOS resource value; calculating the eighth ratio between the latency of the front-end business and the maximum tolerable latency of the front-end business, and calculating the product between the eighth ratio and the third preset value to obtain the latency; calculating the sum of the IPOS resource value and the latency to obtain the front-end performance score.
[0018] In an exemplary embodiment, determining the total node health score of all nodes in the distributed storage system includes: determining the node health score of each node in the distributed storage system using at least one of the following information in the distributed storage system: the connection status of the node, the CPU usage of the node, the memory usage of the node, and the hard disk health status of the node; and determining the total node health score based on the node health score of each of the nodes.
[0019] In an exemplary embodiment, after executing the target data operation according to the health value to recover the data in the OSD node, the method further includes one of the following: when the health value is greater than a first preset health value, determining that an abnormality has occurred in the front-end business in the distributed storage system, and adjusting the operating parameters of the target data operation to restore the front-end business to normal; when the health value is less than a second preset health value, determining that the distributed storage system includes remaining resources that allow the target data operation to be executed, and adjusting the operating parameters of the target data operation to utilize the remaining resources to execute the target data operation; when the health value is greater than the second preset health value and less than the first preset health value, executing the data recovery operation in the target data operation to recover the data in the OSD node.
[0020] According to another embodiment of the present application, a distributed storage system is provided, including an OSD node and a PG node, and the distributed storage system is used to implement the steps of the method described above.
[0021] According to another embodiment of the present application, a data recovery device is provided, which is applied to a distributed storage system, and the device includes: a first setting module, which is used to set the cluster identifier of the distributed storage system when an OSD node in the distributed storage system fails and enters the peer-to-peer interconnection stage of the PG node connected to the OSD node, wherein the peer-to-peer interconnection stage is a stage in which a connection is established between the PG node and other PG nodes, and the cluster identifier is used to prevent entry into a data recovery stage, and the data recovery stage is a stage in which data in the OSD node is recovered after the connection is established between the PG node and the other PG nodes; a first determination module, which is used to determine the number of times the peer-to-peer interconnection stage is entered within a preset time period, and when the number is greater than the preset number and / or the number does not continue to increase, delete the cluster identifier to enter the data recovery stage; a first calculation module, which is used to calculate the health value of the distributed storage system in the data recovery stage, wherein the health value is used to represent the ability of the distributed storage system to process business; a first execution module, which is used to perform target data operations according to the health value to recover the data in the OSD node.
[0022] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0023] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0024] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0025] Through this application, since it is applied to a distributed storage system, when an OSD node fails and enters the peer-to-peer interconnection stage of the PG node connected to the OSD node, the cluster identifier of the distributed storage system is set to prevent entry into the data recovery stage, and when the number of times the peer-to-peer interconnection stage is entered is greater than the preset number and / or the number does not continue to increase, the cluster identifier is deleted to enter the data recovery stage, and the health value of the distributed storage system is calculated in the data recovery stage, and the target data operation is performed according to the health value to restore the data in the OSD node. Thereby, the possibility of frequently introducing new PG peer-to-peer interconnection operation calculations can be reduced, and repeated invalid calculation consumption can be avoided, and resources can be fully utilized for data recovery. Therefore, the problem that data recovery cannot be effectively performed in the distributed storage system in the related art can be solved, and the effect of efficiently utilizing resources for data recovery can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a hardware structure block diagram of a mobile terminal of a data recovery method according to an embodiment of the present application;
[0027] Figure 2 is a flow chart of a data recovery method according to an embodiment of the present application;
[0028] Figure 3 is a structural block diagram of a distributed storage system according to an embodiment of the present application;
[0029] Figure 4 is a flow chart according to a specific embodiment of the present application;
[0030] Figure 5 It is a structural block diagram of a data recovery device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0033] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a data recovery method according to an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0034] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data recovery method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] In this embodiment, a data recovery method is provided, which is applied to a distributed storage system. Figure 2 is a flow chart of a data recovery method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0037] Step S202, when an OSD node in the distributed storage system fails and enters a peer-to-peer interconnection stage of a PG node connected to the OSD node, setting a cluster identifier of the distributed storage system, wherein the peer-to-peer interconnection stage is a stage of establishing a connection between the PG node and other PG nodes, and the cluster identifier is used to prevent entering a data recovery stage, wherein the data recovery stage is a stage of recovering data in the OSD node after establishing a connection between the PG node and the other PG nodes;
[0038] Step S204, determining the number of times the peer-to-peer interconnection phase is entered within a preset time period, and when the number is greater than a preset number and / or the number does not continue to increase, deleting the cluster identifier to enter the data recovery phase;
[0039] Step S206, calculating the health value of the distributed storage system in the data recovery phase, wherein the health value is used to represent the ability of the distributed storage system to process services;
[0040] Step S208: Execute target data operation according to the health value to restore data in the OSD node.
[0041] Through the above steps, since it is applied to a distributed storage system, when an OSD node fails and enters the peer-to-peer interconnection stage of a PG node connected to the OSD node, the cluster identifier of the distributed storage system is set to prevent entry into the data recovery stage, and when the number of times the peer-to-peer interconnection stage is entered is greater than the preset number and / or the number does not continue to increase, the cluster identifier is deleted to enter the data recovery stage, and the health value of the distributed storage system is calculated in the data recovery stage, and the target data operation is performed according to the health value to restore the data in the OSD node. Thereby, the possibility of frequently introducing new PG peer-to-peer interconnection operation calculations can be reduced, and repeated invalid calculation consumption can be avoided, and resources can be fully utilized for data recovery. Therefore, the problem that data recovery cannot be effectively performed in a distributed storage system in the related art can be solved, and the effect of efficiently utilizing resources for data recovery can be achieved.
[0042] Optionally, the distributed storage system in this embodiment includes but is not limited to a CEPH cluster, which is an open source distributed storage system that can provide scalable object storage, block storage and file systems. A CEPH cluster is a collection of multiple CEPH storage nodes that work together to provide a storage solution with high availability, high performance and scalability. A CEPH cluster typically includes multiple different types of nodes, including monitor nodes, object storage nodes, block storage nodes and metadata server nodes. The monitor node is responsible for managing the state and configuration information of the cluster, the object storage node is responsible for storing object data, the block storage node is responsible for providing block storage services, and the metadata server node is responsible for maintaining the metadata information of the file system. The CEPH cluster uses the CRUSH algorithm to achieve data distribution and replication. By distributing and storing data on multiple storage nodes, the reliability and performance of the data can be improved. In addition, CEPH also supports dynamic expansion and reduction of the cluster size, and can flexibly adjust the storage capacity and performance according to demand.
[0043] Optionally, the OSD (Object Storage Daemon) node is an important component in the CEPH cluster, responsible for storing data and processing data read and write requests. Each OSD node contains an OSD daemon that manages storage devices and distributes data to different OSDs in the cluster through the CRUSH algorithm to ensure high reliability and availability of data. OSD nodes play a key role in the CEPH cluster. They can be dynamically expanded and reduced to adapt to changes in the size of the cluster. In addition, OSD nodes are also responsible for data replication and recovery, as well as monitoring and reporting the health status of storage devices. Through the collaboration of multiple OSD nodes, the CEPH cluster can achieve high-performance, high-scalability, and high-reliability storage services.
[0044] Optionally, in a CEPH cluster, a PG (Placement Group) node is a data storage unit responsible for distributing data to different OSD nodes. When the data stored in the OSD nodes in a CEPH cluster changes and PG rebalancing is required, the PG peering phase will begin. During the PG peering phase, each OSD node will communicate with each other to coordinate the redistribution of data to ensure data consistency and reliability. During this process, each PG will migrate, copy, or restore data as needed until all PGs are in a consistent state. PG peering is an important phase in a CEPH cluster, which ensures high availability and reliability of data in the cluster. Through PG peering, the CEPH cluster can handle node failures, data corruption, and other situations in a timely manner to ensure data integrity and stability.
[0045] Optionally, the recovery process of CEPH mainly includes three stages: peer-to-peer interconnection stage, data recovery stage and data backfill stage.
[0046] Peer-to-peer interconnection phase: When the PG node is in an inactive state, the peer-to-peer interconnection phase will be performed. Multiple OSD nodes exchange information to confirm the version and status of the PG node and the status of other OSD nodes. By comparing logs and version information, determine which OSD node has the latest data.
[0047] Data recovery phase: After the peer-to-peer interconnection phase is completed, if data inconsistencies are found, the data recovery phase will be entered. Use the information in the log of the PG node to recover the inconsistent objects. The recovery process mainly synchronizes the data of each replica by copying the missing objects.
[0048] Data backfill phase: If the data cannot be fully recovered during the data recovery phase, such as the log of the PG node is lost or damaged, the data backfill operation will be triggered. The data backfill operation is a more thorough data synchronization process that ensures data consistency by scanning all objects of the entire PG node. During this process, the OSD node with the latest data will send its object list to other OSD nodes, and then compare and synchronize the missing objects one by one.
[0049] In this embodiment, after the CEPH cluster enters the peer-to-peer interconnection stage of the PG nodes, the possibility of frequently introducing new PG node peer-to-peer interconnection calculations due to changes in the OSD MAP is reduced, thereby avoiding repeated and invalid calculation consumption.
[0050] In an exemplary embodiment, when an OSD node in a distributed storage system fails and enters the peer-to-peer interconnection stage of the PG nodes connected to the OSD node, a cluster identifier of the distributed storage system is set, including: monitoring the status of the distributed storage system in real time through a network monitoring tool to obtain status information; when it is determined from the status information that the process map of the OSD node has changed, determining that the OSD node has failed and entering the peer-to-peer interconnection stage, wherein the process map is a map of storage processes for managing OSD nodes; and adding the cluster identifier to the distributed storage system to prevent entering the data recovery stage.
[0051] Optionally, the network monitoring tool includes but is not limited to the open source network monitoring tool Zabbix, which can monitor the status of the CEPH cluster in real time. Monitoring items can be configured through Zabbix to monitor various indicators of the CEPH cluster. For example, status information includes storage capacity, input / output I / O performance, node health status, etc. Through the graphical interface of Zabbix, users can intuitively view the real-time status of the CEPH cluster and discover and solve problems in a timely manner. At the same time, Zabbix also supports the alarm function. When an abnormal situation occurs in the CEPH cluster, the administrator can be notified in time to handle it to ensure the stable operation of the cluster. By using the Zabbix tool to monitor the status of the CEPH cluster in real time, the administrator can better manage and maintain the CEPH cluster to ensure the security and reliability of the data.
[0052] Optionally, the process map of the OSD node includes but is not limited to OSD MAP, which is a map used to manage object storage daemon OSD nodes in the CEPH cluster.
[0053] The reasons for changes in the process map of an OSD node include one of the following: The state of the OSD changes: For example, an OSD is added to or removed from the cluster, which causes a change in the OSD MAP. The configuration of the storage pool changes: When the configuration of the storage pool changes, it may affect the distribution and mapping of the OSD, resulting in a change in the OSD MAP. The cluster topology changes: If the topology of the cluster changes, such as adding a storage node or adjusting the network topology, it will also cause a change in the OSD MAP. When the OSD MAP changes, the cluster administrator needs to perform relevant operations and adjustments in a timely manner to ensure the normal operation of the cluster and the reliability of the data.
[0054] Optionally, the method of adding the cluster identifier to the distributed storage system includes but is not limited to:
[0055] Use the ceph osd set norecover command to set the OSD node to an unrecoverable state. In this state, ceph will not attempt to automatically recover data if an OSD fails. Using this command can prevent data corruption that may occur due to automatic recovery in certain situations (such as hardware failure).
[0056] Use the ceph osd set norebalance command to set the OSD node to a state where it does not participate in load balancing. In a ceph cluster, load balancing is an automatic process used to balance data distribution between OSDs to prevent some OSDs from being overloaded. Use this command to prevent automatic load balancing in certain situations (such as performance testing or specific data distribution requirements).
[0057] Use the CEPH osd set nobackfill command to set the OSD node to a state where it does not participate in data backfill. This command can be used to prevent automatic data backfill in certain situations (such as performance testing or specific data distribution requirements).
[0058] This embodiment can effectively prevent the data recovery phase from being entered by adding a cluster identifier to the distributed storage system, thereby avoiding repeated and invalid computing consumption.
[0059] In an exemplary embodiment, the number of times the peer-to-peer interconnection stage is entered within a preset time period is determined, and when the number is greater than the preset number and / or the number does not continue to increase, the cluster identifier is deleted to enter the data recovery stage, including: continuously monitoring the number of times the peer-to-peer interconnection stage is entered within a preset time period; when the number is greater than the preset number and / or the number does not continue to increase, determining that multiple PG nodes corresponding to multiple OSD nodes that failed within the preset time period have entered the peer-to-peer interconnection stage, wherein the multiple OSD nodes are nodes for which data recovery is to be performed; determining the paths of the multiple OSD nodes, and releasing the cluster identifier to enter the data recovery stage.
[0060] Optionally, this embodiment can also continuously monitor the number of times entering the peer-to-peer interconnection stage through the Zabbix tool. For example, when it is detected that the number of PG nodes entering the peer-to-peer interconnection stage is no longer increasing, that is, all failed PG nodes have completed the peer-to-peer interconnection stage, the object to be restored and the path of the OSD node are determined, and the cluster identifier set above is released to enter the data recovery stage of the PG node. Thereby, the duration of peer-to-peer interconnection can be reduced, and a large number of PG nodes can simultaneously perform data recovery operations or data backfill operations to correct invalid data migration or calculation problems.
[0061] It should be noted that this embodiment continuously monitors the OSD MAP. If the state of the cluster OSD node changes again during the recovery process, which causes the peer-to-peer interconnection of new PG nodes, the cluster identifier will be reset.
[0062] In an exemplary embodiment, calculating the health value of a distributed storage system during a data recovery phase includes: determining a first data recovery parameter of the distributed storage system; and calculating the health value of the distributed storage system during the process of performing a target data operation according to the first data recovery parameter.
[0063] Optionally, the first data recovery parameter includes, but is not limited to, a parameter determined by information such as network bandwidth, the amount of data that needs to be backfilled and recovered, and the maximum performance of the hard disk. For example, the first data recovery parameter is the best practice value for calculating parameters related to data recovery, f (backfills), f (rec_active), f (rec_sleep), and f (rec_priority). This allows the remaining resources to be fully utilized for data recovery while ensuring the normal operation of the front-end business and the CEPH cluster.
[0064] Optionally, determining a first data recovery parameter of the distributed storage system includes: calculating a target backfill value, wherein the target backfill value is a parameter value for a PG node to perform a data backfill operation; calculating a target recovery value, wherein the target recovery value is a parameter value for a PG node to perform a data recovery operation; determining a first data recovery parameter based on the target backfill value and the target recovery value; wherein the target data operation includes a data backfill operation and / or a data recovery operation.
[0065] Optionally, calculating the target backfill value includes: determining the IOPS resources allowed for performing data backfill operations in the distributed storage system, wherein the IOPS resources are used to represent the number of times the distributed storage system performs data backfill operations per second; calculating a first ratio between the IOPS resources and the number of PG nodes that need to perform data backfill operations to determine the available IOPS resources for each PG node when performing the data backfill operation; determining the number of OSD nodes that are allowed to perform data backfill operations simultaneously to obtain a first upper limit value; and determining the target backfill value using the available IOPS resources and the first upper limit value.
[0066] Optionally, the calculation formula of the target backfill value includes but is not limited to: max_backfill=\min\left(\left\lfloor\frac{server hard disk IOPS resources\times \alpha}{number of PG nodes that need data backfill}\right\rfloor, total number of OSD nodes\times \beta\right)), where the server hard disk IOPS resources are used to represent the input / output operation performance of the hard disk on each server. \alpha is used to represent an adjustment coefficient (0 < (\alpha) < 1), which is used to allocate the part of the server hard disk IOPS resources that can be used for data backfill operations to ensure that the front-end business is not overly affected, and the default value is 0.4. The number of PG nodes that need data backfill operations is used to represent the number of PG nodes that need to perform data backfill operations obtained by monitoring the status information of CEPH after a failure occurs. The total number of OSD nodes is used to represent the total number of OSD nodes in the CEPH cluster. \beta is a coefficient used to represent the upper limit of the target backfill value based on the total number of OSD nodes to avoid too many OSD nodes performing data recovery at the same time and causing negative impact on cluster performance. The default setting is 0.1.
[0067] For example, the specific calculation process includes the following steps:
[0068] S1, calculate the IOPS resources available for data backfill operations: server hard disk resource IOPS × \alpha. This calculation ensures that a certain amount of hard disk IOPS resources are allocated for data backfill operations while ensuring front-end business.
[0069] S2, divide the IOPS resources available for data backfill operation calculated in the previous step by the number of PG nodes that need to perform data backfill operation to determine the IOPS resources that each PG node that needs to perform data backfill operation can obtain. It should be noted that this result is rounded down because there can be no partial IOPS.
[0070] S3, calculate the upper limit of the data backfill operation that the OSD node can support, that is, the total number of OSD nodes × \beta. This calculation is to prevent too many OSD nodes from performing data recovery at the same time, thereby affecting the stability of the CEPH cluster.
[0071] S4, the target backfill value is the smaller value of the above two calculation results. This is to ensure that when restoring data, it will not cause too much impact on the stability of the front-end business and back-end cluster.
[0072] Optionally, calculating the target recovery value includes: determining network bandwidth resources allowed for performing data recovery operations in the distributed storage system, wherein the network bandwidth resources are used to represent the data transmission capacity of the distributed storage system when performing data recovery operations; calculating a second ratio between the network bandwidth resources and the average amount of data stored in the PG node to determine the number of PG nodes allowed to perform data recovery operations simultaneously; determining the number of PG nodes that perform data recovery operations simultaneously to obtain a second upper limit value; and determining the target recovery value using the number of PG nodes and the second upper limit value.
[0073] Optionally, the calculation formula of the target recovery value includes: recovery_max_active = \min\left(\left\lfloor \frac{server network bandwidth\times \gamma}{PG average data volume} \right\rfloor, total number of PGs\times \delta\right)), where recovery_max_active is used to indicate the number of PG nodes that can be in active recovery state at the same time. The server network bandwidth resource is used to indicate the average network transmission speed of the servers in the cluster, usually in Mbps (megabits per second) or Gbps (gigabits per second). \gamma is used to indicate an adjustment factor, whose value is between 0 and 1. This factor is used to adjust the portion of the server network bandwidth that can be used for data recovery operations, and the default value is 0.5. The average data volume of the PG node is used to indicate the average amount of data stored in each PG, usually in MB (megabytes) or GB (gigabytes). This value can be obtained through the zabbix monitoring tool. The total number of PG nodes is used to indicate the total number of PG nodes in the CEPH cluster. PG nodes are logical containers used by CEPH to disperse storage objects. \delta is used to represent an empirical coefficient, which is used to limit the upper limit of recovery_max_active based on the total number of PG nodes. The default value is 8%.
[0074] For example, the specific calculation process includes the following steps:
[0075] S1, calculate the network bandwidth resources available for performing data recovery operations, specifically: server network bandwidth resources × \gamma. Wherein \gamma is an adjustment coefficient, and its value is between 0 and 1. This coefficient is used to adjust the portion of the server network bandwidth resources that can be used for data recovery operations, for example, 0.5. This calculation ensures that sufficient network bandwidth resources are available when performing data recovery operations.
[0076] S2, divide the network bandwidth resources available for data recovery calculated in the previous step by the average data volume of the PG node to determine the number of PG nodes that can be recovered simultaneously under network resource constraints. It should be noted that this result needs to be rounded down because some PG nodes cannot be recovered.
[0077] S3, calculate the upper limit of data recovery that the PG node can support: the total number of PG nodes × \delta. Wherein, \delta is an empirical coefficient used to limit the upper limit of the target recovery value according to the total number of PG nodes, for example, 8%. This embodiment is to prevent too many PG nodes from performing data recovery operations at the same time, thereby affecting the performance and stability of the cluster.
[0078] S4, the target recovery value is taken as the smaller value of the above two calculation results. This embodiment is to ensure that the data recovery process does not consume excessive network resources while maintaining the stability and performance of the cluster.
[0079] In this embodiment, the best practice values of the target backfill value and the target recovery value need to consider multiple factors to ensure that after a CEPH cluster fails, the IOPS resources and latency of the front-end business can be prioritized and the back-end data can be effectively recovered.
[0080] Optionally, after determining the first data recovery parameter based on the target backfill value and the target recovery value, the above method also includes: setting the waiting time of the data recovery operation in the target data operation to a preset time; setting the priority of the data recovery operation to a target priority; and performing the data recovery operation using the preset time and the target priority.
[0081] For example, the waiting time f (rec_sleep) is 0.5, the adjustment range is 0.05 each time, the minimum value is 0.1, and the maximum value is 0.5. The target priority f (rec_priority) is kept at a higher priority to ensure the priority access of the front-end business. The fixed value is 32 and is not adjusted.
[0082] In an exemplary embodiment, in the process of performing a target data operation according to a first data recovery parameter, a health value of a distributed storage system is calculated, including: determining an operating status score of the distributed storage system, wherein the operating status score is used to represent the operating performance of the distributed storage system; determining a total node health score of all nodes in the distributed storage system, wherein the total node health score is used to represent the operating performance of all nodes; and calculating the sum of the operating status score of a first ratio and the total node health score of a second ratio to obtain a health value.
[0083] Optionally, determining the operation status score of the distributed storage system includes: determining a proportional score value of online nodes, wherein the proportional score value of online nodes is used to represent the proportional relationship between the number of online nodes and the total number of nodes in the distributed storage system; determining a resource health value of the distributed storage system based on an IPOS resource value and a network bandwidth resource value in the distributed storage system; determining a node health value of the distributed storage system based on an OSD node and a PG node in the distributed storage system; determining a front-end performance score of the distributed storage system based on the IPOS resource value of a front-end service in the distributed storage system and a latency of the front-end service; and calculating a sum of a proportional score value of a third scale, a resource health value of a third scale, a node health value of a third scale, and a front-end performance score of a third scale to obtain an operation status score.
[0084] Optionally, the running status score can be calculated by the following formula: CEPH_Health = 0.25 *Node_online + 0.25 * Resource_Health + 0.25 * PG_OSD_Health + 0.25 * Front_End_Performance, where CEPH_Health is used to represent the running status score, Node_online is used to represent the ratio score value, Resource_Health is used to represent the resource health value, PG_OSD_Health is used to represent the node health value, and Front_End_Performance is used to represent the front-end performance score. The third ratio can be flexibly set as needed, for example, it can be set to 0.25.
[0085] For example, Node_online = (number of online nodes / total number of nodes) 100. Specifically, determine the number of online nodes and the total number of nodes in the CEPH cluster. Calculate the ratio of the number of online nodes to the total number of nodes. Multiply the ratio by 100 to get the percentage score of Node_Health.
[0086] Optionally, determining a resource health value of a distributed storage system based on an IPOS resource value and a network bandwidth resource value in the distributed storage system includes: determining an average IPOS resource and a maximum IPOS resource in the distributed storage system; calculating a third ratio of the average IPOS resource to the maximum IPOS resource, and calculating the product between the third ratio and a first preset value to obtain an IPOS resource value; determining an actual network bandwidth and a maximum network bandwidth of the distributed storage system; calculating a fourth ratio between the actual network bandwidth and the maximum network bandwidth, and calculating the product between the fourth ratio and the first preset value to obtain a network bandwidth resource value; and calculating the sum of the IPOS resource value and the network bandwidth resource value to obtain a resource health value.
[0087] For example, Resource_Health=(average hard disk IOPS / maximum hard disk IOPS)*50+(actual network bandwidth / maximum network bandwidth)*50.
[0088] Specifically, it is divided into two parts: hard disk IOPS resources and network bandwidth resources:
[0089] The specific part of the hard disk IOPS is as follows: Determine the average hard disk IOPS resource and the maximum hard disk IOPS resource of the server. Calculate the ratio of the average hard disk IOPS resource to the maximum hard disk IOPS resource and multiply it by 50.
[0090] The network bandwidth part is as follows: Determine the actual network bandwidth resources and the maximum network bandwidth resources of the server. Calculate the ratio of the actual network bandwidth resources to the maximum network bandwidth resources and multiply it by 50. Add the above two parts together to get the Resource_Health score.
[0091] Optionally, determining the node health value of the distributed storage system based on the OSD nodes and PG nodes in the distributed storage system includes: calculating a fifth ratio between the number of online OSD nodes and the total number of OSD nodes in the distributed storage system, and calculating the product between the fifth ratio and the second preset value to obtain the OSD node health value; calculating a sixth ratio between the number of online PG nodes and the total number of PG nodes in the distributed storage system, and calculating the product between the sixth ratio and the second preset value to obtain the PG node health value; calculating the sum of the OSD node health value and the PG node health value to obtain the node health value.
[0092] For example, the node health value PG_OSD_Health = (number of online OSDs / total number of OSDs)*50+(number of active PGs / total number of PGs)*50.
[0093] It is divided into two parts: the number of online OSD nodes and the number of active PG nodes:
[0094] The online OSD quantity part is as follows: Determine the number of online OSD nodes and the total number of OSD nodes. Calculate the ratio of the number of online OSD nodes to the total number of OSD nodes and multiply it by 50.
[0095] The number of active PG nodes is as follows: Determine the number of active PG nodes and the total number of PG nodes. Calculate the ratio of the number of active PG nodes to the total number of PG nodes and multiply by 50.
[0096] Add the above two parts together to get the PG_OSD_Health score.
[0097] Optionally, based on the IPOS resource value of the front-end business and the latency of the front-end business in the distributed storage system, the front-end performance score of the distributed storage system is determined, including: calculating the seventh ratio between the IPOS resources actually occupied by the front-end business and the maximum IPOS resources allocated to the front-end business, and calculating the product between the seventh ratio and the third preset value to obtain the IPOS resource value; calculating the eighth ratio between the latency of the front-end business and the maximum tolerable latency of the front-end business, and calculating the product between the eighth ratio and the third preset value to obtain the latency; calculating the sum of the IPOS resource value and the latency to obtain the front-end performance score.
[0098] For example, the front-end performance score Front_End_Performance = (actual IOPS of the front-end business / maximum IOPS of the front-end business)*50 + (1-(front-end business latency / maximum acceptable latency))*50.
[0099] It is divided into two parts: front-end business IOPS resources and latency:
[0100] The front-end business IOPS resource part is as follows: determine the actual IOPS resources of the front-end business and the maximum IOPS resources of the front-end business. Calculate the ratio of the actual IOPS resources of the front-end business to the maximum IOPS resources of the front-end business and multiply it by 50.
[0101] The latency part is as follows: Determine the latency of the front-end service and the maximum acceptable latency. Calculate the ratio of 1 minus (front-end service latency divided by the maximum acceptable latency) and multiply by 50.
[0102] Add the above two parts together to get the score of Front_End_Performance.
[0103] In an exemplary embodiment, determining the total node health score of all nodes in a distributed storage system includes: determining the node health score of each node in the distributed storage system using at least one of the following information in the distributed storage system: the connection status of the node, the CPU usage of the node, the memory usage of the node, and the hard disk health status of the node; and determining the total node health score based on the node health score of each node.
[0104] Optionally, the node health score of each node is Node_Healthi=Ci×Wc+(100−Cpu_ui)×Wcpu+(100−Mem_ui)×Wmem+Hdd_hi×Whdd.
[0105] Node health score Node_Health = , in order to make the full score of the health value 100 points, the weights need to be normalized to ensure that their sum is 1. Set: (Wc = 0.2, Wcpu = 0.3, Wmem =0.3, Whdd = 0.2). N is used to represent the number of nodes in the server cluster, Ci is used to represent the connection status of node i (1 represents successful connection, 0 represents failed connection), Cpu_ui is used to represent the CPU usage of node i (expressed in percentage), Mem_ui is used to represent the memory usage of node i (expressed in percentage), Hdd_hi is used to represent the hard disk health status of node i (1 represents healthy, 0 represents faulty or unhealthy, which can be the result obtained through SMART detection or other hard disk health detection tools), Wc, Wcpu, Wmem, Whdd are used to represent the weights of connection status, CPU usage, memory usage, and hard disk health, respectively.
[0106] Optionally, Cluster_Health=70%*CEPH_Health()+30%*node_Health().
[0107] This embodiment can effectively utilize resources and ensure the efficiency of front-end business operation and back-end data recovery by adjusting the parameters of the data recovery operation and monitoring the health status.
[0108] In an exemplary embodiment, after executing the target data operation according to the health value to restore the data in the OSD node, the above method also includes one of the following: when the health value is greater than the first preset health value, determining that an abnormality has occurred in the front-end business in the distributed storage system, and adjusting the operating parameters of the target data operation to restore the front-end business to normal; when the health value is less than the second preset health value, determining that the distributed storage system includes remaining resources that allow the target data operation to be executed, adjusting the operating parameters of the target data operation to utilize the remaining resources to execute the target data operation; when the health value is greater than the second preset health value and less than the first preset health value, executing the data recovery operation in the target data operation to restore the data in the OSD node.
[0109] Optionally, the first preset health value and the second preset health value can be flexibly set. For example, the first preset health value can be set to 80, and the second preset health value can be set to 60. In this way, the data recovery strategy can be adaptively and dynamically adjusted, the environmental health status can be monitored, resources can be effectively utilized, and the optimal solution for front-end business operation and back-end data recovery efficiency can be guaranteed.
[0110] In this embodiment, a distributed storage system is also provided. Figure 3As shown, it is a structural block diagram of a distributed storage system, including OSD nodes and PG nodes. The distributed storage system is used to implement the steps of the method in the above embodiment.
[0111] The present application is described in detail below with reference to specific embodiments:
[0112] This specific embodiment aims at the problem that continuous failures or epoch delays occur in the CEPH cluster in the related technology, resulting in the need for new PG nodes to enter the peer-to-peer interconnection stage after the PG node data recovery stage, increasing the overhead of computing and I / O resources and prolonging the data recovery time. Based on the problem that the prior art lacks an adaptive data recovery mode and cannot fully utilize physical resources, this embodiment proposes a method for adaptively optimizing the CEPH cluster storage data recovery strategy, such as Figure 4 FIG. 1 is a flowchart of a method of this specific embodiment, which specifically includes the following steps:
[0113] S401, the zabbix tool monitors the status of the CEPH cluster in real time and obtains status information;
[0114] S402, when a network, node, hard disk or other failure occurs, the OSD MAP changes and the CEPH cluster enters the data recovery mechanism;
[0115] S403, enter the PG node peer interconnection stage, add cluster identifiers CEPH OSD set norecover, CEPHOSD set norebalance, CEPH OSD set no backfill, and prevent the PG nodes that have completed the peer interconnection stage from starting data recovery operations;
[0116] S404, continuously monitor the PG peer interconnection status;
[0117] S405, when it is detected that the number of peering PGs is no longer increasing, that is, all failed PG nodes have completed the peering stage, determine the object and OSD node path to be restored and backfilled, release the cluster identifier set above, and enter the data recovery stage of the PG node; it can reduce the peering duration and the invalid data migration or calculation correction problems caused by the simultaneous peering recovery and backfilling of a large number of PG nodes; continuously monitor the OSD MAP, if the cluster OSD state changes again during the recovery process, causing a new PG peering, the cluster identifier will be reset;
[0118] S406, during the recovery process, enter the adaptive data recovery mode; calculate the best practice values of data recovery related parameters f(backfills), f(rec_active), f(rec_sleep) and f(rec_priority) based on known variables such as network bandwidth, the amount of data to be backfilled and recovered, and the maximum performance of the hard disk. Make full use of the remaining resources for data recovery while ensuring the normal operation of the front-end business and CEPH cluster;
[0119] S407, define the health value of the CEPH cluster's business carrying capacity; Cluster_Health = 70%*CEPH_Health() + 30%*node_Health(), determined by the 70% weight of the CEPH cluster health status and the 30% weight of the physical node monitoring value; use the thresholds of 60 and 80 to determine whether to increase or decrease f(backfills), f(rec_active), and f(rec_sleep), balancing the recovery capacity of the backend storage to adapt to changes in the frontend business;
[0120] S408, Cluster_Health >80, the front-end business is affected, and it is necessary to adjust w=5% each time to reduce the coefficient of data recovery and data backfill to ensure the normal operation of the front-end business;
[0121] S409, Cluster_Health <60, more resources are allowed to be used for backend data recovery. The coefficients of data recovery and data backfill are adjusted by increasing by 1% each time; the recovery_sleep is adjusted up and down by 0.05.
[0122] S410, 60< Cluster_Health <80, then maintain the best practice of current data recovery capability, and finally all PGs are repaired and the CEPH cluster status is error-free.
[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0124] In this embodiment, a data recovery device is also provided, which is applied to a distributed storage system. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0125] Figure 5 is a structural block diagram of a data recovery device according to an embodiment of the present application, such as Figure 5 As shown, the device comprises:
[0126] A first setting module 52 is used to set a cluster identifier of the distributed storage system when an OSD node in the distributed storage system fails and enters a peer-to-peer interconnection stage of a PG node connected to the OSD node, wherein the peer-to-peer interconnection stage is a stage of establishing a connection between the PG node and other PG nodes, and the cluster identifier is used to prevent entering a data recovery stage, wherein the data recovery stage is a stage of recovering data in the OSD node after establishing a connection between the PG node and the other PG nodes;
[0127] A first determination module 54 is used to determine the number of times the peer-to-peer interconnection phase is entered within a preset time period, and when the number is greater than a preset number and / or the number does not continue to increase, delete the cluster identifier to enter the data recovery phase;
[0128] A first calculation module 56, configured to calculate a health value of the distributed storage system during the data recovery phase, wherein the health value is used to indicate the ability of the distributed storage system to process services;
[0129] The first execution module 58 is used to perform a target data operation according to the health value to restore the data in the OSD node.
[0130] In an exemplary embodiment, the above-mentioned first setting module includes: a first monitoring unit, used to monitor the status of the distributed storage system in real time through a network monitoring tool to obtain status information; a first determination unit, used to determine that the OSD node has a fault and enter the peer interconnection stage when it is determined from the status information that the process map of the OSD node has changed, wherein the process map is a map of the storage process for managing the OSD node; a first adding unit, used to add the cluster identifier to the distributed storage system to prevent entering the data recovery stage.
[0131] In an exemplary embodiment, the above-mentioned first determination module includes: a second monitoring unit, used to continuously monitor the number of times the peer interconnection stage is entered within the preset time period; a second determination unit, used to determine, when the number is greater than the preset number and / or the number does not continue to increase, that the multiple PG nodes corresponding to the multiple OSD nodes that failed within the preset time period have entered the peer interconnection stage, wherein the multiple OSD nodes are nodes to be recovered data; a third determination unit, used to determine the paths of the multiple OSD nodes and release the cluster identifier to enter the data recovery stage.
[0132] In an exemplary embodiment, the above-mentioned first calculation module includes: a fourth determination unit, used to determine the first data recovery parameter of the distributed storage system; a first calculation unit, used to calculate the health value of the distributed storage system during the process of performing the target data operation according to the first data recovery parameter.
[0133] In an exemplary embodiment, the above-mentioned fourth determination unit includes: a first calculation subunit, used to calculate a target backfill value, wherein the target backfill value is a parameter value for the PG node to perform a data backfill operation; a second calculation subunit, used to calculate a target recovery value, wherein the target recovery value is a parameter value for the PG node to perform a data recovery operation; a first determination subunit, used to determine the first data recovery parameter based on the target backfill value and the target recovery value; wherein the target data operation includes the data backfill operation and / or the data recovery operation.
[0134] In an exemplary embodiment, the above-mentioned first calculation sub-unit is used to calculate the target backfill value in the following manner: determine the IOPS resources allowed in the distributed storage system for performing the data backfill operation, wherein the IOPS resources are used to represent the number of times the distributed storage system performs data backfill in the data backfill operation per second; calculate a first ratio between the IOPS resources and the number of the PG nodes that need to perform the data backfill operation to determine the available IOPS resources when each PG node performs the data backfill operation; determine the number of the OSD nodes that are allowed to perform the data backfill operation simultaneously to obtain a first upper limit value; and determine the target backfill value using the available IOPS resources and the first upper limit value.
[0135] In an exemplary embodiment, the second calculation sub-unit is used to calculate the target recovery value in the following manner: determine the network bandwidth resources in the distributed storage system that are allowed to be used to perform the data recovery operation, wherein the network bandwidth resources are used to represent the data transmission capacity of the distributed storage system when performing the data recovery operation; calculate a second ratio between the network bandwidth resources and the average amount of data stored in the PG node to determine the number of the PG nodes that are allowed to perform the data recovery operation simultaneously; determine the number of the PG nodes that perform the data recovery operation simultaneously to obtain a second upper limit value; and determine the target recovery value using the number of PG nodes and the second upper limit value.
[0136] In an exemplary embodiment, the above-mentioned device also includes: a second setting module, which is used to set the waiting time of the data recovery operation in the target data operation to a preset time after determining the first data recovery parameter based on the target backfill value and the target recovery value; a third setting module, which is used to set the priority of the data recovery operation to a target priority; and a first execution module, which is used to execute the data recovery operation using the preset time and the target priority.
[0137] In an exemplary embodiment, the above-mentioned first calculation unit includes: a second determination subunit, used to determine the operating status score of the distributed storage system, wherein the operating status score is used to represent the operating performance of the distributed storage system; a third determination subunit, used to determine the total node health score of all nodes in the distributed storage system, wherein the total node health score is used to represent the operating performance of all nodes; a third calculation subunit, used to calculate the sum of the operating status score of the first ratio and the total node health score of the second ratio to obtain the health value.
[0138] In an exemplary embodiment, the second determination subunit is used to determine the operation status score of the distributed storage system in the following manner: determine a proportional score value of online nodes, wherein the proportional score value of online nodes is used to represent the proportional relationship between the number of online nodes and the total number of nodes in the distributed storage system; determine a resource health value of the distributed storage system based on the IPOS resource value and the network bandwidth resource value in the distributed storage system; determine a node health value of the distributed storage system based on the OSD node and the PG node in the distributed storage system; determine a front-end performance score of the distributed storage system based on the IPOS resource value of the front-end business in the distributed storage system and the latency of the front-end business; calculate the sum of the proportional score value of the third proportion, the resource health value of the third proportion, the node health value of the third proportion, and the front-end performance score of the third proportion to obtain the operation status score.
[0139] In an exemplary embodiment, the second determination subunit is used to determine the resource health value of the distributed storage system based on the IPOS resource value and the network bandwidth resource value in the distributed storage system in the following manner: determine the average IPOS resource and the maximum IPOS resource in the distributed storage system; calculate a third ratio of the average IPOS resource to the maximum IPOS resource, and calculate the product between the third ratio and a first preset value to obtain the IPOS resource value; determine the actual network bandwidth and the maximum network bandwidth of the distributed storage system; calculate a fourth ratio between the actual network bandwidth and the maximum network bandwidth, and calculate the product between the fourth ratio and the first preset value to obtain the network bandwidth resource value; calculate the sum of the IPOS resource value and the network bandwidth resource value to obtain the resource health value.
[0140] In an exemplary embodiment, the above-mentioned second determination subunit is used to determine the node health value of the distributed storage system based on the OSD nodes and the PG nodes in the distributed storage system in the following manner: calculate the fifth ratio between the number of online OSD nodes and the total number of OSD nodes in the distributed storage system, and calculate the product between the fifth ratio and the second preset value to obtain the OSD node health value; calculate the sixth ratio between the number of online PG nodes and the total number of PG nodes in the distributed storage system, and calculate the product between the sixth ratio and the second preset value to obtain the PG node health value; calculate the sum of the OSD node health value and the PG node health value to obtain the node health value.
[0141] In an exemplary embodiment, the second determination subunit is used to determine the front-end performance score of the distributed storage system based on the IPOS resource value of the front-end business in the distributed storage system and the delay of the front-end business in the following manner: calculating the seventh ratio between the IPOS resources actually occupied by the front-end business and the maximum IPOS resources allocated to the front-end business, and calculating the product between the seventh ratio and the third preset value to obtain the IPOS resource value; calculating the eighth ratio between the delay of the front-end business and the maximum tolerable delay of the front-end business, and calculating the product between the eighth ratio and the third preset value to obtain the delay; calculating the sum of the IPOS resource value and the delay to obtain the front-end performance score.
[0142] In an exemplary embodiment, the third determination subunit is used to determine the total node health score of all nodes in the distributed storage system in the following manner: determining the node health score of each node in the distributed storage system using at least one of the following information in the distributed storage system: the connection status of the node, the CPU usage of the node, the memory usage of the node, and the hard disk health status of the node; determining the total node health score based on the node health score of each of the nodes.
[0143] In an exemplary embodiment, the above-mentioned device also includes: a second determination module, which is used to perform the target data operation according to the health value to restore the data in the OSD node. When the health value is greater than the first preset health value, it is determined that the front-end business in the distributed storage system is abnormal, and the operating parameters of the target data operation are adjusted to restore the front-end business to normal; a third determination module, which is used to determine that the distributed storage system includes remaining resources that allow the target data operation to be performed when the health value is less than the second preset health value, and adjust the operating parameters of the target data operation to utilize the remaining resources to perform the target data operation; a second execution module, which is used to execute the data recovery operation in the target data operation to restore the data in the OSD node when the health value is greater than the second preset health value and less than the first preset health value.
[0144] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0145] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0146] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0147] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.
[0148] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0149] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0150] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0151] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0152] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0153] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0154] The above description is only the 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 modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A data recovery method, characterized in that: Applied to a distributed storage system, the method comprises: In the case where an OSD node in the distributed storage system fails and enters a peer-to-peer interconnection stage of a PG node connected to the OSD node, a cluster identifier of the distributed storage system is set, wherein the peer-to-peer interconnection stage is a stage of establishing a connection between the PG node and other PG nodes, and the cluster identifier is used to prevent entry into a data recovery stage, wherein the data recovery stage is a stage of recovering data in the OSD node after establishing a connection between the PG node and the other PG nodes; Determine the number of times the peer-to-peer interconnection phase is entered within a preset time period, and if the number is greater than a preset number and / or the number does not continue to increase, delete the cluster identifier to enter the data recovery phase; Calculating a health value of the distributed storage system during the data recovery phase, wherein the health value is used to represent the ability of the distributed storage system to process services; Target data operations are performed according to the health value to recover data in the OSD node.
2. The method according to claim 1, characterized in that When an OSD node in the distributed storage system fails and enters a peer-to-peer interconnection phase of a PG node connected to the OSD node, setting a cluster identifier of the distributed storage system includes: Monitor the status of the distributed storage system in real time through a network monitoring tool to obtain status information; In the case where it is determined from the status information that a process map of the OSD node has changed, determining that the OSD node has failed, and entering the peer-to-peer interconnection phase, wherein the process map is a map for managing storage processes of the OSD node; The cluster identifier is added to the distributed storage system to prevent entering the data recovery phase.
3. The method according to claim 1, characterized in that: Determining the number of times the peer-to-peer interconnection phase is entered within a preset time period, and when the number is greater than a preset number and / or the number does not continue to increase, deleting the cluster identifier to enter the data recovery phase, includes: Continuously monitoring the number of times the peer-to-peer interconnection phase is entered within the preset time period; When the number is greater than the preset number and / or the number does not continue to increase, it is determined that the multiple PG nodes corresponding to the multiple OSD nodes that failed within the preset time period have entered the peer-to-peer interconnection stage, wherein the multiple OSD nodes are nodes to be restored; Paths of the plurality of OSD nodes are determined, and the cluster identifier is released to enter the data recovery phase.
4. The method according to claim 1, characterized in that: Calculating the health value of the distributed storage system in the data recovery phase includes: Determining a first data recovery parameter of the distributed storage system; In the process of executing the target data operation according to the first data recovery parameter, a health value of the distributed storage system is calculated.
5. The method according to claim 4, characterized in that Determining a first data recovery parameter of the distributed storage system includes: Calculate a target backfill value, wherein the target backfill value is a parameter value for the PG node to perform a data backfill operation; Calculate a target recovery value, wherein the target recovery value is a parameter value for the PG node to perform a data recovery operation; determining the first data recovery parameter based on the target backfill value and the target recovery value; The target data operation includes the data backfill operation and / or the data recovery operation.
6. The method according to claim 5, characterized in that Calculate the target backfill value, including: Determine an IOPS resource allowed in the distributed storage system for performing the data backfill operation, wherein the IOPS resource is used to represent the number of times the distributed storage system performs data backfill in the data backfill operation per second; Calculate a first ratio between the IOPS resources and the number of the PG nodes that need to perform the data backfill operation to determine the available IOPS resources when each of the PG nodes performs the data backfill operation; Determine the number of the OSD nodes that are allowed to simultaneously perform the data backfill operation, and obtain a first upper limit value; The target backfill value is determined using the available IOPS resources and the first upper limit value.
7. The method according to claim 5, characterized in that Calculate the target recovery value, including: Determining a network bandwidth resource allowed in the distributed storage system for performing the data recovery operation, wherein the network bandwidth resource is used to represent a data transmission capability of the distributed storage system when performing the data recovery operation; Calculating a second ratio between the network bandwidth resources and the average amount of data stored in the PG nodes to determine the number of the PG nodes that are allowed to simultaneously perform the data recovery operation; Determine the number of the PG nodes that simultaneously perform the data recovery operation to obtain a second upper limit value; The target recovery value is determined using the number of the PG nodes and the second upper limit value.
8. The method according to claim 5, characterized in that After determining the first data recovery parameter based on the target backfill value and the target recovery value, the method further includes: Setting the waiting time of the data recovery operation in the target data operation to a preset time; Setting the priority of the data recovery operation to a target priority; The data recovery operation is performed using the preset time and the target priority.
9. The method according to claim 4, characterized in that In the process of performing the target data operation according to the first data recovery parameter, calculating the health value of the distributed storage system includes: Determining an operation status score of the distributed storage system, wherein the operation status score is used to represent the operation performance of the distributed storage system; Determine a total node health score of all nodes in the distributed storage system, wherein the total node health score is used to represent the operating performance of all nodes; The sum of the running status score of the first proportion and the total node health score of the second proportion is calculated to obtain the health value.
10. The method according to claim 9, characterized in that Determining an operating status score of the distributed storage system includes: Determine a proportional score value of the online nodes, wherein the proportional score value of the online nodes is used to represent a proportional relationship between the number of the online nodes and the total number of nodes in the distributed storage system; Determine a resource health value of the distributed storage system based on an IPOS resource value and a network bandwidth resource value in the distributed storage system; Determine a node health value of the distributed storage system based on the OSD node and the PG node in the distributed storage system; Determining a front-end performance score of the distributed storage system based on the IPOS resource value of the front-end service in the distributed storage system and the latency of the front-end service; The sum of the proportion score value of the third proportion, the resource health value of the third proportion, the node health value of the third proportion, and the front-end performance score of the third proportion is calculated to obtain the running status score.
11. The method according to claim 10, characterized in that Determining a resource health value of the distributed storage system based on an IPOS resource value and a network bandwidth resource value in the distributed storage system includes: Determining an average IPOS resource and a maximum IPOS resource in the distributed storage system; Calculating a third ratio of the average IPOS resource to the maximum IPOS resource, and calculating a product of the third ratio and a first preset value to obtain the IPOS resource value; Determine the actual and maximum network bandwidth of the distributed storage system; Calculating a fourth ratio between the actual network bandwidth and the maximum network bandwidth, and calculating a product between the fourth ratio and the first preset value to obtain the network bandwidth resource value; The sum of the IPOS resource value and the network bandwidth resource value is calculated to obtain the resource health value.
12. The method according to claim 10, characterized in that Determining a node health value of the distributed storage system based on the OSD node and the PG node in the distributed storage system includes: Calculate a fifth ratio between the number of online OSD nodes and the total number of OSD nodes in the distributed storage system, and calculate the product between the fifth ratio and the second preset value to obtain an OSD node health value; Calculate a sixth ratio between the number of online PG nodes and the total number of PG nodes in the distributed storage system, and calculate the product between the sixth ratio and the second preset value to obtain a PG node health value; Calculate the sum of the OSD node health value and the PG node health value to obtain the node health value.
13. The method according to claim 10, characterized in that Determining a front-end performance score of the distributed storage system based on an IPOS resource value of a front-end service in the distributed storage system and a delay of the front-end service includes: Calculating a seventh ratio between the IPOS resources actually occupied by the front-end service and the maximum IPOS resources allocated to the front-end service, and calculating the product of the seventh ratio and a third preset value to obtain the IPOS resource value; Calculating an eighth ratio between the delay of the front-end service and the maximum tolerable delay of the front-end service, and calculating the product between the eighth ratio and the third preset value to obtain the delay; The sum of the IPOS resource value and the delay is calculated to obtain the front-end performance score.
14. The method according to claim 9, characterized in that Determine an overall node health score for all nodes in the distributed storage system, including: Determine a node health score of each node in the distributed storage system using at least one of the following information in the distributed storage system: a connection status of the node, a CPU usage rate of the node, a memory usage rate of the node, and a hard disk health status of the node; The node health score is determined based on the node health score of each of the nodes.
15. The method according to claim 1, characterized in that After performing the target data operation according to the health value to restore the data in the OSD node, the method further includes one of the following: When the health value is greater than a first preset health value, determining that a front-end service in the distributed storage system is abnormal, and adjusting an operation parameter of the target data operation to restore the front-end service to normal; In a case where the health value is less than a second preset health value, determining that the distributed storage system includes remaining resources that allow the target data operation to be performed, and adjusting an operation parameter of the target data operation to perform the target data operation using the remaining resources; When the health value is greater than the second preset health value and less than the first preset health value, a data recovery operation in the target data operation is performed to recover the data in the OSD node.
16. A distributed storage system, characterized in that: Comprising OSD nodes and PG nodes, the distributed storage system is used to implement the steps of the method described in any one of claims 1-15.
17. A data recovery device, characterized in that: Applied to a distributed storage system, the device comprises: A first setting module is used to set the cluster identifier of the distributed storage system when an OSD node in the distributed storage system fails and enters a peer-to-peer interconnection stage of a PG node connected to the OSD node, wherein the peer-to-peer interconnection stage is a stage of establishing a connection between the PG node and other PG nodes, and the cluster identifier is used to prevent entering a data recovery stage, wherein the data recovery stage is a stage of recovering data in the OSD node after establishing a connection between the PG node and the other PG nodes; A first determination module is used to determine the number of times the peer-to-peer interconnection phase is entered within a preset time period, and when the number is greater than a preset number and / or the number does not continue to increase, delete the cluster identifier to enter the data recovery phase; A first calculation module, configured to calculate a health value of the distributed storage system in the data recovery phase, wherein the health value is used to represent the ability of the distributed storage system to process services; The first execution module is used to perform a target data operation according to the health value to restore the data in the OSD node.
18. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 15 are implemented.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 15 when executed by a processor.
20. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 15 are implemented.
