A management method, system and server for OSD services
By determining whether the OSD service is a newly started service in the distributed storage system and performing dual confirmation management methods, the problem of OSD service information being easily disordered and causing data loss is solved, and the security and integrity of data storage are achieved.
Patent Information
- Application Number
- CN202310168229.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2043-02-24
AI Technical Summary
In distributed storage systems, OSD service information is prone to disorder, leading to data loss.
When receiving the OSD service startup instruction, it determines whether the OSD service is a newly started OSD service, and saves its identification information to the hard disk, and sends startup information to the MON service of the management server to perform double confirmation to avoid information disorder.
It effectively avoids OSD service information disorder, ensures the security and integrity of data storage, and prevents data loss.
Smart Images

Figure CN116346644B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of control, and particularly to a management method, system and server for an OSD service. Background Art
[0002] A distributed storage system requires multiple servers, and each server is equipped with multiple hard disks to provide storage support for data. The OSD (Object Storage Device) service is a component used to manage each hard disk in the server. Generally, one hard disk corresponds to one OSD service process, and its main functions include processing data storage, reconstruction, and providing some monitoring information to the MON (monitor) service, etc. Since the hard disk is a component where data is frequently written in a distributed storage, and at the same time the number of hard disks in the system is relatively large, the processing related to hard disk failures is relatively common in cluster maintenance work. At the same time, the expansion and contraction of the storage cluster are also closely related to the hard disks. Since the OSD service is used to manage the hard disks, the management of the OSD service by the server is relatively important. Careless operation is likely to cause the OSD service information in the storage cluster to be disordered or even lead to data loss. Summary of the Invention
[0003] The purpose of the present invention is to provide a management method, system and server for an OSD service, which can avoid the disorder of OSD service information or even data loss.
[0004] To solve the above technical problems, the present invention provides a management method for an OSD service, including:
[0005] When receiving a start instruction for the OSD service, determining whether the OSD service is a newly started OSD service;
[0006] If it is a newly started OSD service, saving the identification information of the OSD service to the hard disk corresponding to the OSD service, where the OSD service and the identification information are in one-to-one correspondence;
[0007] Sending start information to the MON service in the management server, where the start information includes the identification information of the OSD service;
[0008] When the MON service determines that the OSD service is a newly started OSD service, controlling the start of the OSD service.
[0009] Preferably, when the MON service determines that the OSD service is a newly started OSD service, controlling the start of the OSD service includes:
[0010] When the MON service determines that the OSD service is a newly started OSD service and saves the identification information to a preset space, control the OSD service to start; the preset space is used to save the identification information of the OSD services in the distributed storage cluster.
[0011] Preferably, after sending the start information to the MON service in the management server, it further includes:
[0012] When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, control the OSD service to start.
[0013] Preferably, saving the identification information of the OSD service to the hard disk corresponding to the OSD service includes:
[0014] Save the number of the OSD service, the identifier of the OSD service, and the identifier of the distributed storage cluster to the control partition of the hard disk corresponding to the OSD service, and the data in the control partition is modifiable data;
[0015] Save the number of the OSD service, the identifier of the OSD service, the identifier of the distributed storage cluster, and the version information of the OSD service to the raw data area of the hard disk corresponding to the OSD service, and the data in the raw data area is non-modifiable data.
[0016] Preferably, after determining whether the OSD service is a newly started OSD service, it further includes:
[0017] If it is not a newly started OSD service, read the identification information of the OSD service from the control partition and the raw data area respectively;
[0018] Judge whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and the version information of the OSD service in the raw data area is the same as the version information of the running OSD service;
[0019] If the identification information is different or the version information is different, determine that the OSD service is abnormal and do not control the OSD service to start.
[0020] Preferably, after judging whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and the version information of the OSD service in the raw data area is the same as the version information of the running OSD service, it further includes:
[0021] If the identification information is the same and the version information is the same, send start information to the MON service in the management server;
[0022] When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, control the OSD service to start.
[0023] Preferably, when the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, controlling the OSD service to start includes:
[0024] When the MON service determines that the OSD service is not a newly started OSD service and determines that the identification information is consistent with the identification information stored in the preset space of the MON service, control the OSD service to start.
[0025] Preferably, if the identification information is the same and the version information is the same, after sending the start information to the MON service in the management server, it further includes:
[0026] When the MON service determines that the OSD service is not a newly started OSD service and the identification information fails to pass the verification by the MON service, determine that the OSD service is abnormal and do not control the OSD service to start.
[0027] To solve the above technical problems, the present invention also provides a management system for an OSD service, including:
[0028] A judgment unit, configured to judge whether the OSD service is a newly started OSD service when receiving a start instruction for the OSD service; if so, trigger the storage unit;
[0029] A storage unit, configured to store the identification information of the OSD service in the hard disk corresponding to the OSD service, and the OSD service corresponds to the identification information one by one;
[0030] A sending unit, configured to send start information to the MON service in the management server, and the start information includes the identification information of the OSD service;
[0031] A control unit, configured to control the OSD service to start when the MON service determines that the OSD service is a newly started OSD service.
[0032] To solve the above technical problems, the present invention also provides a server, including:
[0033] A memory, configured to store a computer program;
[0034] A processor, configured to implement the steps of the above OSD service management method when executing the computer program.
[0035] The present invention provides a management method, system and server for OSD services, which are applied to the control field. When receiving a start instruction for an OSD service, it is determined whether the OSD service is a newly started OSD service; if it is a newly started OSD service, the identification information of the OSD service is saved to the hard disk corresponding to the OSD service; start information including the identification information of the OSD service is sent to the MON service in the management server; when the MON service determines that the OSD service is a newly started OSD service, the above-mentioned OSD service is controlled to start. When the OSD service is newly created, the identification information is saved to the hard disk corresponding to the OSD service, and at the same time, the identification information is also sent to the MON service in the management server. Performing multiple management checks and confirmations during service creation can avoid disorder of OSD service information and even data loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required in the prior art and the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0037] Figure 1 It is a flowchart of a management method for an OSD service provided by the present invention;
[0038] Figure 2 It is a schematic structural diagram of a management system for an OSD service provided by the present invention;
[0039] Figure 3 It is a schematic structural diagram of a server provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0040] The core of the present invention is to provide a management method, system and server for OSD services, which can avoid disorder of OSD service information and even data loss.
[0041] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0042] A distributed storage system requires multiple servers, and each server is equipped with multiple hard disks to provide storage support for data. The OSD (Object Storage Device) service is a component used to manage each hard disk in the server. Generally, one hard disk corresponds to one OSD service process. Its main functions include processing data storage, reconstruction, and providing some monitoring information to the MON (monitor) service, etc. Since the hard disk is a component where data is frequently written in the distributed storage, and the number of hard disks in the system is relatively large, the handling related to hard disk failures is relatively common in cluster maintenance work. At the same time, the expansion and contraction of the storage cluster are also closely related to the hard disks. The OSD service is used to manage the hard disks, so the server's management of the OSD service is relatively important. Careless operations can easily lead to disorder of the OSD service information in the storage cluster and even data loss.
[0043] In a distributed cluster, multiple processes of a single service are usually distinguished by numbers. For example, in a distributed storage cluster composed of a total of three servers, and each server has 12 disks, then the cluster has a total of 36 disks corresponding to 36 OSD service processes, numbered 0 - 35 respectively. If only this number is used as the unique identifier of a certain OSD service in the cluster, there are certain potential risks as follows:
[0044] 1. When replacing a disk, inserting an old disk from another cluster into the server without initialization, adding a hard disk with existing data that does not belong to this cluster to the cluster, which affects the data security of the cluster;
[0045] 2. If a new OSD is created and an existing number is wrongly specified, it will cause the OSD service with the original number to be abnormal, and it is impossible to determine which OSD provides the service;
[0046] 3. The application program for creating the OSD service has been updated in version, and the new and old versions are not compatible. If the new version program is not controlled to start the service created by the old version, it will affect the stability of the cluster.
[0047] 4. If the number and cluster information of each OSD are only stored on the local disk of the OSD, then if the local verification passes, but the information stored this time does not match the cluster, when the OSD is added to this cluster at this time, there will still be problems.
[0048] Figure 1 The flowchart of a management method for an OSD service provided by the present invention includes:
[0049] S11: When receiving a start instruction for the OSD service, determine whether the OSD service is a newly started OSD service; if so, enter step S12;
[0050] When the server receives the start instruction of the OSD service, it needs to determine whether the OSD service is a restarted OSD service or a newly started OSD service. Since some data of the restarted OSD service is saved on this server, while there is no data of the newly started OSD service saved on this server. Therefore, it is necessary to make a preliminary judgment. If the OSD service is a newly started OSD service, then proceed to the following steps.
[0051] S12: Save the identification information of the OSD service to the hard disk corresponding to the OSD service, and the OSD service corresponds to the identification information one by one;
[0052] If the OSD service is a newly started service, then it is necessary to save the identification information of the OSD service to the server. The identification information corresponds to the OSD service one by one, so that the server can determine the OSD service through the saved identification information.
[0053] Specifically, each newly started OSD service will save the identification information to the server. If the OSD service is restarted, the server can determine that the OSD service is not a newly started OSD service but a restarted OSD service based on the identification information, and then perform different startup processes.
[0054] S13: Send the start information to the MON service in the management server, and the start information includes the identification information of the OSD service;
[0055] During the startup process of the OSD service, not only the server running the OSD service needs to confirm, but also the MON service in the management server needs to confirm. The double confirmation by the server and the management server can avoid errors to a greater extent.
[0056] It should be noted that the MON service and the OSD service are two non-interfering services.
[0057] After this server determines that the current OSD service is a newly started OSD service, send the start information to the MON service of the management server. The MON service determines whether it is a newly started OSD service based on the identification information.
[0058] It should be noted that all the identification information of the OSD services is saved in the MON service. Therefore, when receiving the identification information of the OSD service, it can be determined whether the OSD service is a newly started OSD service.
[0059] S14: When the MON service determines that the OSD service is a newly started OSD service, control the start of the OSD service.
[0060] After double confirmation by the server and the management server, it can be determined that the OSD service is a newly started OSD service and can be started.
[0061] The present invention provides a management method for OSD services, which is applied to the control field. When a start instruction for an OSD service is received, it is determined whether the OSD service is a newly started OSD service; if it is a newly started OSD service, the identification information of the OSD service is saved to the hard disk corresponding to the OSD service; start information including the identification information of the OSD service is sent to the MON service in the management server; when the MON service determines that the OSD service is a newly started OSD service, the OSD service is controlled to start. When the OSD service is newly created, the identification information is saved to the hard disk corresponding to the OSD service, and at the same time, the identification information is also sent to the MON service in the management server. Multiple management checks and confirmations are performed during service creation, which can avoid disorder of OSD service information and even data loss.
[0062] Based on the above embodiments:
[0063] As a preferred embodiment, when the MON service determines that the OSD service is a newly started OSD service, controlling the OSD service to start includes:
[0064] When the MON service determines that the OSD service is a newly started OSD service and saves the identification information to a preset space, the OSD service is controlled to start; the preset space is used to save the identification information of the OSD services in the distributed storage cluster.
[0065] The server sends start information to the MON service, which includes the number of the OSD service and the identifier of the OSD service. If the OSD number does not exist in the MON record and it is a newly started OSD service, the MON service will record the number of this OSD service and the identifier of the OSD service into the osdmap. The osdmap information is stored on the disk in the MON service, and then this newly created OSD can start normally and join the cluster. The osdmap is a preset space for saving identification information.
[0066] In the server, the identification information of all OSD services in the distributed cluster is saved to the preset space, which is convenient for subsequent determination of whether it is a newly started OSD service.
[0067] As a preferred embodiment, after sending the start information to the MON service in the management server, it further includes:
[0068] When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, the OSD service is controlled to start.
[0069] If the OSD service number or OSD service identifier in the identification information of the OSD service in the startup information sent to the MON service exists within the preset space of the MON service, the MON service needs to verify the identification information. If both the OSD service number and the OSD service identifier are consistent with those saved in the preset space, the verification of the identification information passes, and the OSD service can be started.
[0070] As a preferred embodiment, saving the identification information of the OSD service to the hard disk corresponding to the OSD service includes:
[0071] Saving the OSD service number, the OSD service identifier, and the identifier of the distributed storage cluster to the control partition of the hard disk corresponding to the OSD service, where the data in the control partition is modifiable data;
[0072] Saving the OSD service number, the OSD service identifier, the identifier of the distributed storage cluster, and the version information of the OSD service to the raw data area of the hard disk corresponding to the OSD service, where the data in the raw data area is non-modifiable data.
[0073] When the OSD service starts, it determines whether it is a newly created service. If it is newly created, it will write the OSD service number, the OSD service identifier, and the distributed storage cluster to the 100M control partition of the disk corresponding to the OSD in the form of a file. At the same time, it constructs a superblock object, including the OSD service number, the OSD service identifier, the identifier of the distributed storage cluster, and the version information of the OSD service, and writes the superblock object to the raw data partition of the OSD corresponding hard disk.
[0074] The 100M control partition is a visual partition, and the data saved in the 100M control partition can be viewed and modified by the user, while the raw data partition is a non-visual partition, and the data saved in the raw data partition cannot be viewed and modified by the user.
[0075] Saving the data to the 100M control partition and the raw data partition respectively plays a dual guarantee role for the server.
[0076] As a preferred embodiment, after determining whether the OSD service is a newly started OSD service, it further includes:
[0077] If it is not a newly started OSD service, read the identification information of the OSD service from the control partition and the raw data area respectively;
[0078] Determine whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and whether the version information of the OSD service in the raw data area is the same as the version information of the running OSD service;
[0079] If the identification information is different or the version information is different, it is determined that the OSD service is abnormal, and the startup of the OSD service is not controlled.
[0080] If it is not a newly started OSD service, read the number of the OSD service, the identifier of the OSD service, and the identifier of the distributed storage cluster from the 100M control partition of the hard disk, parse the number of the OSD service, the identifier of the OSD service, the identifier of the distributed storage cluster, and the version information of the OSD service from the raw data area, and compare whether the data saved in the control partition and the raw data area is the same. At the same time, judge whether the currently running version information is the same as that saved in the raw data area. If there are differences, an error needs to be reported, and the startup of the OSD service is not controlled.
[0081] It should be noted that the version information of the OSD service running is a fixed string.
[0082] As a preferred embodiment, after determining whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and the version information of the OSD service in the raw data area is the same as the version information of the running OSD service, it further includes:
[0083] If the identification information is the same and the version information is the same, send startup information to the MON service in the management server;
[0084] When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, control the startup of the OSD service.
[0085] After the server running the OSD service passes the verification, send the startup information containing the identification information to the MON service, and the MON service will perform a secondary verification on the OSD service according to the identification information and version information of the OSD service saved by itself.
[0086] It should be noted that the OSD service reaching this step is often a restarted OSD service rather than a newly started OSD service.
[0087] If the MON service passes the verification, the restarted OSD service can be restarted.
[0088] As a preferred embodiment, when the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, controlling the startup of the OSD service includes:
[0089] When the MON service determines that the OSD service is not a newly started OSD service and determines that the identification information is consistent with the identification information saved in the preset space of the MON service, control the startup of the OSD service.
[0090] Specifically, the MON service verification needs to compare the OSD service with the identification information initially saved in the preset space. After passing the verification of this server and then passing the verification of the management server, the OSD service can be started after both double verifications are passed.
[0091] It should be noted that the identification information saved in the preset space of the MON service is the identification information saved when the OSD service is a newly started OSD service.
[0092] As a preferred embodiment, if the identification information is the same and the version information is the same, after sending the start information to the MON service in the management server, it further includes:
[0093] When the MON service determines that the OSD service is not a newly started OSD service and the verification of the identification information fails through the MON service, it is determined that the OSD service is abnormal and the start of the OSD service is not controlled.
[0094] It should be noted that in any of the above steps, when the verification information fails, it is determined that the OSD service is abnormal and the start of the OSD service is not allowed, so that the user can determine the fault.
[0095] The MON service is the last layer of verification. If the MON service verification fails, then even if the server running the OSD service passes the verification, the OSD service cannot be started.
[0096] It should also be noted that the management server can be independent of all servers running the OSD service, or the management server can be a server running the OSD service, but the management server needs to satisfy that the MON service and the OSD service run independently of each other.
[0097] Figure 2 It is a schematic structural diagram of a management system for an OSD service provided by the present invention. The management system for the OSD service includes:
[0098] A judgment unit 21, configured to judge whether the OSD service is a newly started OSD service when receiving a start instruction of the OSD service; if so, trigger the saving unit;
[0099] A saving unit 22, configured to save the identification information of the OSD service to the hard disk corresponding to the OSD service, and the OSD service corresponds to the identification information one by one;
[0100] A sending unit 23, configured to send start information to the MON service in the management server, and the start information includes the identification information of the OSD service;
[0101] A control unit 24, configured to control the start of the OSD service when the MON service determines that the OSD service is a newly started OSD service.
[0102] When the server receives the start instruction of the OSD service, it needs to determine whether the OSD service is a restarted OSD service or a newly started OSD service. Since some data of the restarted OSD service is saved in this server, while there is no data of the newly started OSD service saved in this server. Therefore, it is necessary to make a preliminary judgment first. If the OSD service is a newly started OSD service, then proceed to the subsequent steps.
[0103] If the OSD service is a newly started service, then it is necessary to save the identification information of the OSD service to the server. The identification information corresponds to the OSD service one by one, so the server can determine the OSD service through the saved identification information.
[0104] Specifically, each newly started OSD service saves the identification information to the server. If the OSD service is restarted, the server can determine that the OSD service is not a newly started OSD service but a restarted OSD service based on the identification information, and then perform different startup processes.
[0105] During the startup process of the OSD service, not only does the server running the OSD service need to confirm, but also the MON service in the management server needs to confirm. The double confirmation by the server and the management server can avoid errors to a greater extent.
[0106] It should be noted that the MON service and the OSD service are two non-interfering services.
[0107] After this server determines that the current OSD service is a newly started OSD service, it sends the startup information to the MON service of the management server. The MON service determines whether it is a newly started OSD service based on the identification information.
[0108] It should be noted that all the identification information of the OSD services is saved in the MON service. Therefore, when receiving the identification information of the OSD service, it can be determined whether the OSD service is a newly started OSD service.
[0109] After double confirmation by the server and the management server, it can be determined that the OSD service is a newly started OSD service and can be started.
[0110] The present invention provides a management system for OSD services, which is applied to the control field. When receiving a start instruction for an OSD service, it determines whether the OSD service is a newly started OSD service; if it is a newly started OSD service, it saves the identification information of the OSD service to the hard disk corresponding to the OSD service; it sends start information to the MON service in the management server, and the start information includes the identification information of the OSD service; when the MON service determines that the OSD service is a newly started OSD service, it controls the start of the OSD service. When the OSD service is newly created, the identification information is saved to the hard disk corresponding to the OSD service, and at the same time, the identification information is also sent to the MON service in the management server. Performing multiple management checks and confirmations during service creation can avoid disorder of OSD service information and even data loss.
[0111] Based on the above embodiments:
[0112] As a preferred embodiment, the control unit 24 is specifically configured to control the start of the OSD service when the MON service determines that the OSD service is a newly started OSD service and saves the identification information to a preset space; the preset space is used to save the identification information of the OSD service in the distributed storage cluster.
[0113] The server sends start information to the MON service, and the message includes the number of the OSD service and the identifier of the OSD service. If the OSD number does not exist in the MON record and it is a newly started OSD service, the MON service will record the number of this OSD service and the identifier of the OSD service into the osdmap. The osdmap information is stored on the disk in the MON service, and then this newly created OSD can be started normally and joined the cluster. The osdmap is a preset space for saving identification information.
[0114] In the server, the identification information of all OSD services in the distributed cluster is saved to the preset space, which is convenient for subsequent determination of whether it is a newly started OSD service.
[0115] As a preferred embodiment, it further includes a second control unit, which is configured to control the start of the OSD service when the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service.
[0116] If the number of the OSD service or the identifier of the OSD service in the identification information of the OSD service in the start information sent to the MON service exists in the preset space of the MON service, then the MON service needs to verify the identification information. If both the number of the OSD service and the identifier of the OSD service are consistent with those saved in the preset space, the verification of the identification information passes, and the OSD service can be started.
[0117] As a preferred embodiment, the storage unit 22 is specifically configured to save the number of the OSD service, the identifier of the OSD service, and the identifier of the distributed storage cluster to the control partition of the hard disk corresponding to the OSD service, and the data in the control partition is modifiable data;
[0118] Save the number of the OSD service, the identifier of the OSD service, the identifier of the distributed storage cluster, and the version information of the OSD service to the raw data area of the hard disk corresponding to the OSD service, and the data in the raw data area is unmodifiable data.
[0119] When the OSD service starts, it determines whether it is a newly created service. If it is newly created, it will write the number of the OSD service, the identifier of the OSD service, and the distributed storage cluster to the 100M control partition of the disk corresponding to the OSD in the form of a file. At the same time, it constructs a superblock object, including the number of the OSD service, the identifier of the OSD service, the identifier of the distributed storage cluster, and the version information of the OSD service, and writes the superblock object to the raw data partition of the hard disk corresponding to the OSD.
[0120] The 100M control partition is a visual partition, and the data saved in the 100M control partition can be viewed and modified by the user, while the raw data partition is an invisible partition, and the data saved in the raw data partition cannot be viewed and modified by the user.
[0121] Saving the data to the 100M control partition and the raw data partition respectively plays a dual guarantee role for the server.
[0122] As a preferred embodiment, it further includes a reading unit, which is used to read the identification information of the OSD service from the control partition and the raw data area respectively if the OSD service is not newly started;
[0123] The first judgment unit is used to judge whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and whether the version information of the OSD service in the raw data area is the same as the version information of the running OSD service;
[0124] The first determination unit is used to determine that the OSD service is abnormal and does not control the start of the OSD service if the identification information is different or the version information is different.
[0125] If it is not a newly started OSD service, read the number of the OSD service, the identifier of the OSD service, and the identifier of the distributed storage cluster from the 100M control partition of the hard disk, parse the number of the OSD service, the identifier of the OSD service, the identifier of the distributed storage cluster, and the version information of the OSD service from the raw data area, and compare whether the data saved in the control partition and the raw data area is the same. At the same time, determine whether the currently running version information is the same as that saved in the raw data area. If there are differences, an error needs to be reported and the startup of the OSD service is not controlled.
[0126] It should be noted that the version information of the OSD service running is a fixed string.
[0127] As a preferred embodiment, it further includes a second sending unit, which is used to send startup information to the MON service in the management server if the identification information is the same and the version information is the same.
[0128] A second control unit is used to control the startup of the OSD service when the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service.
[0129] After the server running the OSD service passes the verification, send the startup information containing the identification information to the MON service, and the MON service will perform a secondary verification on the OSD service according to the identification information and version information of the OSD service saved by itself.
[0130] It should be noted that the OSD service reaching this step is often a restarted OSD service rather than a newly started OSD service.
[0131] If the MON service passes the verification, the restarted OSD service can be restarted.
[0132] As a preferred embodiment, the second control unit is further used for:
[0133] When the MON service determines that the OSD service is not a newly started OSD service and determines that the identification information is consistent with the identification information saved in the preset space of the MON service, control the startup of the OSD service.
[0134] Specifically, the MON service verification needs to compare the OSD service with the identification information initially saved in the preset space. After passing the verification of this server and then passing the verification of the management server, the OSD service can be started after both double verifications pass.
[0135] It should be noted that the identification information saved in the preset space of the MON service is the identification information saved when the OSD service is a newly started OSD service.
[0136] As a preferred embodiment, the third control unit is configured to determine that the OSD service is abnormal and does not control the startup of the OSD service when the MON service determines that the OSD service is not a newly started OSD service and the verification of the identification information by the MON service fails.
[0137] It should be noted that in any of the above steps, when the verification information fails, it is determined that the OSD service is abnormal and the startup of the OSD service is not allowed, so that the user can determine the fault.
[0138] The MON service is the last layer of verification. If the verification by the MON service fails, then even if the server running the OSD service passes the verification, the OSD service cannot be started.
[0139] It should also be noted that the management server can be independent of all servers running the OSD service, or the management server can be a server running the OSD service, but the management server needs to satisfy that the MON service and the OSD service run independently of each other.
[0140] Figure 3 The following is a schematic structural diagram of a server provided by the present invention. The server includes:
[0141] A memory 31 for storing a computer program;
[0142] A processor 32 for implementing the steps of the above OSD service management method when executing the computer program.
[0143] Specifically, when the processor 32 executes the computer program, the steps of the above OSD service management method are implemented as follows:
[0144] S11: When receiving a startup instruction for the OSD service, determine whether the OSD service is a newly started OSD service; if so, proceed to step S12;
[0145] When the server receives a startup instruction for the OSD service, it is necessary to determine whether the OSD service is a restarted OSD service or a newly started OSD service. Since some data of the restarted OSD service is stored in this server, while no data of the newly started OSD service is stored in this server. Therefore, it is necessary to make a preliminary judgment. If the OSD service is a newly started OSD service, then proceed to the subsequent steps.
[0146] S12: Save the identification information of the OSD service to the hard disk corresponding to the OSD service, and the OSD service and the identification information are in one-to-one correspondence;
[0147] If the OSD service is a newly started service, the identification information of the OSD service needs to be saved to the server. The identification information corresponds to the OSD service one by one, so that the server can determine the OSD service through the saved identification information.
[0148] Specifically, each newly started OSD service saves the identification information to the server. If the OSD service is restarted, the server can determine that the OSD service is not a newly started OSD service but a restarted OSD service based on the identification information, and then perform different startup processes.
[0149] S13: Send startup information to the MON service in the management server. The startup information includes the identification information of the OSD service.
[0150] During the startup process of the OSD service, not only the server running the OSD service needs to confirm, but also the MON service in the management server needs to confirm. The double confirmation by the server and the management server can avoid errors to a greater extent.
[0151] It should be noted that the MON service and the OSD service are two non-interfering services.
[0152] After the server determines that the current OSD service is a newly started OSD service, it sends the startup information to the MON service of the management server. The MON service determines whether it is a newly started OSD service based on the identification information.
[0153] It should be noted that all the identification information of the OSD services is saved in the MON service. Therefore, when receiving the identification information of the OSD service, it can be determined whether the OSD service is a newly started OSD service.
[0154] S14: When the MON service determines that the OSD service is a newly started OSD service, control the OSD service to start.
[0155] After double confirmation by the server and the management server, it can be determined that the OSD service is a newly started OSD service and can be started.
[0156] The present invention provides a server, which is applied to the control field. When receiving a startup instruction for the OSD service, it determines whether the OSD service is a newly started OSD service; if it is a newly started OSD service, it saves the identification information of the OSD service to the hard disk corresponding to the OSD service; it sends startup information to the MON service in the management server, and the startup information includes the identification information of the OSD service; when the MON service determines that the OSD service is a newly started OSD service, it controls the startup of the OSD service. When the OSD service is newly created, the identification information is saved to the hard disk corresponding to the OSD service, and at the same time, the identification information is also sent to the MON service in the management server. Performing multiple management checks and confirmations during service creation can avoid disorder of OSD service information and even data loss.
[0157] Based on the above embodiments:
[0158] As a preferred embodiment, when the MON service determines that the OSD service is a newly started OSD service and controls the startup of the OSD service, it includes:
[0159] When the MON service determines that the OSD service is a newly started OSD service and saves the identification information to a preset space, it controls the startup of the OSD service; the preset space is used to save the identification information of the OSD service in the distributed storage cluster.
[0160] The server sends startup information to the MON service. The message includes the number of the OSD service and the identifier of the OSD service. If the OSD number does not exist in the MON record and it is a newly started OSD service, the MON service will record the number of this OSD service and the identifier of the OSD service into the osdmap. The osdmap information is stored on disk in the MON service. After that, this newly created OSD can be started normally and joined the cluster. The osdmap is a preset space for saving identification information.
[0161] In the server, the identification information of all OSD services in the distributed cluster is saved to the preset space, which is convenient for subsequent determination of whether it is a newly started OSD service.
[0162] As a preferred embodiment, after sending the startup information to the MON service in the management server, it further includes:
[0163] When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, it controls the startup of the OSD service.
[0164] If the OSD service number or the OSD service identifier in the identification information of the OSD service in the startup information sent to the MON service exists within the preset space of the MON service, then the MON service needs to verify the identification information. If both the OSD service number and the OSD service identifier are consistent with those stored in the preset space, the verification of the identification information passes, and the OSD service can be started.
[0165] As a preferred embodiment, saving the identification information of the OSD service to the hard disk corresponding to the OSD service includes:
[0166] Saving the OSD service number, the OSD service identifier, and the identifier of the distributed storage cluster to the control partition of the hard disk corresponding to the OSD service, where the data in the control partition is modifiable data;
[0167] Saving the OSD service number, the OSD service identifier, the identifier of the distributed storage cluster, and the version information of the OSD service to the raw data area of the hard disk corresponding to the OSD service, where the data in the raw data area is non-modifiable data.
[0168] When the OSD service starts, it determines whether it is a newly created service. If it is newly created, it will write the OSD service number, the OSD service identifier, and the distributed storage cluster to the 100M control partition of the disk corresponding to the OSD in the form of a file. At the same time, it constructs a superblock object, including the OSD service number, the OSD service identifier, the identifier of the distributed storage cluster, and the version information of the OSD service, and writes the superblock object to the raw data partition of the hard disk corresponding to the OSD.
[0169] The 100M control partition is a visual partition, and the data saved in the 100M control partition can be viewed and modified by the user, while the raw data partition is a non-visual partition, and the data saved in the raw data partition cannot be viewed and modified by the user.
[0170] Saving the data to the 100M control partition and the raw data partition respectively plays a dual guarantee role for the server.
[0171] As a preferred embodiment, after determining whether the OSD service is a newly started OSD service, it further includes:
[0172] If it is not a newly started OSD service, then read the identification information of the OSD service from the control partition and the raw data area respectively;
[0173] Determine whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and whether the version information of the OSD service in the raw data area is the same as the version information of the running OSD service;
[0174] If the identification information is different or the version information is different, it is determined that the OSD service is abnormal, and the start of the OSD service is not controlled.
[0175] If it is not a newly started OSD service, read the number of the OSD service, the identifier of the OSD service, and the identifier of the distributed storage cluster from the 100M control partition of the hard disk, parse the number of the OSD service, the identifier of the OSD service, the identifier of the distributed storage cluster, and the version information of the OSD service from the raw data area, and compare whether the data saved in the control partition and the raw data area is the same. At the same time, judge whether the currently running version information is the same as that saved in the raw data area. If there are differences, an error needs to be reported, and the start of the OSD service is not controlled.
[0176] It should be noted that the version information of the OSD service running is a fixed string.
[0177] As a preferred embodiment, after determining whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and the version information of the OSD service in the raw data area is the same as the version information of the running OSD service, it further includes:
[0178] If the identification information is the same and the version information is the same, send a start message to the MON service in the management server;
[0179] When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, control the start of the OSD service.
[0180] After the server running the OSD service passes the verification, send the start message containing the identification information to the MON service, and the MON service will perform a secondary verification on the OSD service according to the identification information and version information of the OSD service saved by itself.
[0181] It should be noted that the OSD service reaching this step is often a restarted OSD service rather than a newly started OSD service.
[0182] If the MON service passes the verification, the restarted OSD service can be restarted.
[0183] As a preferred embodiment, when the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, controlling the start of the OSD service includes:
[0184] When the MON service determines that the OSD service is not a newly started OSD service and determines that the identification information is consistent with the identification information saved in the preset space of the MON service, control the start of the OSD service.
[0185] Specifically, the MON service verification needs to compare the OSD service with the identification information initially saved in the preset space. After passing the verification of this server and then passing the verification of the management server, the OSD service can be started after both double verifications are passed.
[0186] It should be noted that the identification information saved in the preset space of the MON service is the identification information saved when the OSD service is a newly started OSD service.
[0187] As a preferred embodiment, if the identification information is the same and the version information is the same, after sending the start information to the MON service in the management server, it further includes:
[0188] When the MON service determines that the OSD service is not a newly started OSD service and the verification of the identification information fails through the MON service, it is determined that the OSD service is abnormal and the start of the OSD service is not controlled.
[0189] It should be noted that in any of the above steps, when the verification information fails, it is determined that the OSD service is abnormal and the start of the OSD service is not allowed, so that the user can determine the fault.
[0190] The MON service is the last layer of verification. If the MON service verification fails, then even if the server running the OSD service passes the verification, the OSD service cannot be started.
[0191] It should also be noted that the management server can be independent of all servers running the OSD service, or the management server can be a server running the OSD service, but the management server needs to satisfy that the MON service and the OSD service run independently of each other.
[0192] The present invention provides a management method for an OSD service, which is applied to the control field. When receiving a start instruction for the OSD service, it is determined whether the OSD service is a newly started OSD service; if it is a newly started OSD service, the identification information of the OSD service is saved to the hard disk corresponding to the OSD service; start information including the identification information of the OSD service is sent to the MON service in the management server; when the MON service determines that the OSD service is a newly started OSD service, the above-mentioned OSD service is controlled to start. Saving the identification information to the hard disk corresponding to the OSD service when the OSD service is newly created, and at the same time sending the identification information to the MON service of the management server, and performing multiple management checks and confirmations during service creation will avoid the disorder of OSD service information and even data loss.
[0193] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.
[0194] It should also be noted that in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0195] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0196] The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well known in the technical field.
[0197] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A management method for OSD services, characterized in that, Including: When receiving a start instruction for the OSD service, determine whether the OSD service is a newly started OSD service; If it is a newly started OSD service, save the identification information of the OSD service to the hard disk corresponding to the OSD service, and the OSD service corresponds to the identification information one by one; Send start information to the MON service in the management server, and the start information includes the identification information of the OSD service; When the MON service determines that the OSD service is a newly started OSD service, control the OSD service to start; Among them, saving the identification information of the OSD service to the hard disk corresponding to the OSD service includes: Save the number of the OSD service, the identifier of the OSD service, and the identifier of the distributed storage cluster to the control partition of the hard disk corresponding to the OSD service, and the data in the control partition is modifiable data; Save the number of the OSD service, the identifier of the OSD service, the identifier of the distributed storage cluster, and the version information of the OSD service to the raw data area of the hard disk corresponding to the OSD service, and the data in the raw data area is non-modifiable data; After determining whether the OSD service is a newly started OSD service, it further includes: If it is not a newly started OSD service, read the identification information of the OSD service from the control partition and the raw data area respectively; Judge whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and whether the version information of the OSD service in the raw data area is the same as the version information of the running OSD service; If the identification information is different or the version information is different, determine that the OSD service is abnormal and do not control the OSD service to start.
2. The management method for OSD services according to claim 1, characterized in that, When the MON service determines that the OSD service is a newly started OSD service, controlling the OSD service to start includes: When the MON service determines that the OSD service is a newly started OSD service and saves the identification information to a preset space, control the OSD service to start; the preset space is used to save the identification information of the OSD service in the distributed storage cluster.
3. The management method for OSD services according to claim 1, characterized in that, After sending the start information to the MON service in the management server, it further includes: When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, control the OSD service to start.
4. The management method for OSD services according to claim 1, characterized in that, After judging whether the identification information saved in the control partition is the same as the identification information saved in the raw data area and whether the version information of the OSD service in the raw data area is the same as the version information of the running OSD service, it further includes: If the identification information is the same and the version information is the same, send start information to the MON service in the management server; When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, control the OSD service to start.
5. The management method for OSD services according to claim 4, characterized in that, When the MON service determines that the OSD service is not a newly started OSD service and the identification information passes the verification by the MON service, controlling the start of the OSD service includes: When the MON service determines that the OSD service is not a newly started OSD service and determines that the identification information is consistent with the identification information stored in the preset space of the MON service, controlling the start of the OSD service.
6. The management method for OSD services according to claim 4, characterized in that, If the identification information is the same and the version information is the same, after sending the start information to the MON service in the management server, it further includes: When the MON service determines that the OSD service is not a newly started OSD service and the identification information fails to pass the verification by the MON service, determining that the OSD service is abnormal and not controlling the start of the OSD service.
7. A management system for OSD services, characterized in that, It includes: A judgment unit, configured to judge whether the OSD service is a newly started OSD service when receiving a start instruction of the OSD service; If so, triggering the storage unit; A storage unit, configured to store the identification information of the OSD service into the hard disk corresponding to the OSD service, and the OSD service corresponds to the identification information one by one; A sending unit, configured to send start information to the MON service in the management server, and the start information includes the identification information of the OSD service; A control unit, configured to control the start of the OSD service when the MON service determines that the OSD service is a newly started OSD service; Wherein, the storage unit is specifically configured to store the number of the OSD service, the identifier of the OSD service, and the identifier of the distributed storage cluster into the control partition of the hard disk corresponding to the OSD service, and the data in the control partition is modifiable data; store the number of the OSD service, the identifier of the OSD service, the identifier of the distributed storage cluster, and the version information of the OSD service into the raw data area of the hard disk corresponding to the OSD service, and the data in the raw data area is unmodifiable data; The management system further includes: A reading unit, configured to, if the OSD service is not a newly started OSD service, read the identification information of the OSD service from the control partition and the raw data area respectively; A first judgment unit, configured to judge whether the identification information stored in the control partition is the same as the identification information stored in the raw data area and whether the version information of the OSD service in the raw data area is the same as the version information of the running OSD service; A first determination unit, configured to, if the identification information is different or the version information is different, determine that the OSD service is abnormal and not control the start of the OSD service.
8. A server, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the management method of the OSD service according to any one of claims 1 to 6 when executing the computer program.
Citation Information
Patent Citations
Method and system for determining instance object conversion order in dynamic update of software
CN101393528A
Distributed storage online upgrading method, device and equipment and readable medium
CN112748884A