CN115695453B - Method, device, equipment and medium for improving stability of mirror image warehouse - Google Patents
Method, device, equipment and medium for improving stability of mirror image warehouse Download PDFInfo
- Publication number
- CN115695453B CN115695453B CN202211347594.4A CN202211347594A CN115695453B CN 115695453 B CN115695453 B CN 115695453B CN 202211347594 A CN202211347594 A CN 202211347594A CN 115695453 B CN115695453 B CN 115695453B
- Authority
- CN
- China
- Prior art keywords
- service
- mirror image
- image warehouse
- warehouse
- availability
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000012544 monitoring process Methods 0.000 claims abstract description 152
- 238000001514 detection method Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 16
- 230000009977 dual effect Effects 0.000 claims description 12
- 230000000977 initiatory effect Effects 0.000 claims 1
- 230000002159 abnormal effect Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000011084 recovery Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000000903 blocking effect Effects 0.000 description 4
- 230000005856 abnormality Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000002457 bidirectional effect Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 239000000523 sample Substances 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a method, a device, equipment and a medium for improving the stability of a mirror image warehouse, which relate to the technical field of computers and comprise the following steps: monitoring the running state of the local single-point mirror image warehouse service through a custom monitoring service to determine the type of the mirror image warehouse service used in the current environment; if the single-point mirror image warehouse service is provided, a first monitoring process is started through a custom monitoring service to monitor whether a high-availability storage cluster is continuously in an available state, and if so, the single-point mirror image warehouse service is switched to the high-availability mirror image warehouse cluster service; if the high available mirror image warehouse cluster service is provided, a second monitoring process is started through the custom monitoring service to monitor whether the high available storage cluster is continuously in an unavailable state, and if so, the high available mirror image warehouse cluster service is switched to the single-point mirror image warehouse service. By monitoring whether the high-availability storage cluster is available or not, the service type of the mirror image warehouse can be automatically switched, and the stability of the mirror image warehouse service is improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for improving stability of a mirror warehouse.
Background
In the existing various cloud computing platforms, service product components are diversified and complicated, containers and virtualization are gradually increased, and requirements on basic components are gradually increased, so that stable and reliable basic support is required to be provided in rapid iteration of the platform. One of the important problems is how to ensure the smoothness in daily operation of the environment and the quick stability in updating and upgrading, because the specificity and burst problems in the environment can have a certain influence on the mirror warehouse during the operation, updating and upgrading of the component service. The running, updating and upgrading of the service depend on the stability of the environment, and a strategy for guaranteeing the running stability of the basic components of the environment needs to be provided. Under the requirement of ensuring stability, the importance of stable operation of the basic component is reflected, and an automatic guarantee strategy and a recovery function with certain capacity can be provided for abnormal burst problems. And thus is particularly important for the stability, availability and disaster recovery capability of mirrored warehouses that provide a containerized basis.
In summary, how to improve the stability of the mirror warehouse is a problem to be solved at present.
Disclosure of Invention
In view of the above, the present invention aims to provide a method, apparatus, device and medium for improving the stability of a mirror warehouse, which can improve the stability of the mirror warehouse. The specific scheme is as follows:
in a first aspect, the application discloses a method for improving the stability of a mirror warehouse, comprising the following steps:
After the custom monitoring service is started, monitoring the running state of the local single-point mirror image warehouse service through the custom monitoring service to determine the type of the mirror image warehouse service used in the current environment;
If the mirror image warehouse service type is single-point mirror image warehouse service, a first monitoring process is started through the custom monitoring service to monitor whether a high-availability storage cluster is continuously in an available state, and if yes, the single-point mirror image warehouse service is switched to the high-availability mirror image warehouse cluster service;
And if the image warehouse service type is the high-availability image warehouse cluster service, starting a second monitoring process through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state, and if so, switching the high-availability image warehouse cluster service into the single-point image warehouse service.
Optionally, the monitoring, by the custom monitoring service, the running state of the local single-point mirror image warehouse service to determine the type of the mirror image warehouse service used by the current environment includes:
Monitoring the running state of the local single-point mirror image warehouse service through the custom monitoring service;
If the running state is in running, judging that the type of the mirror image warehouse service used in the current environment is single-point mirror image warehouse service;
And if the running state is not running, judging that the type of the mirror image warehouse service used by the current environment is high-availability mirror image warehouse cluster service.
Optionally, the monitoring whether the high available storage cluster is continuously in the available state by starting the first monitoring process through the custom monitoring service includes:
Continuously uploading the detection file to a high-availability storage cluster through the custom monitoring service, and starting a first monitoring process to monitor whether the number of times of continuous uploading success of the detection file meets a first preset condition;
if so, determining that the high-availability storage cluster is continuously in an available state.
Optionally, the monitoring whether the high-availability storage cluster is continuously in the unavailable state by starting a second monitoring process through the custom monitoring service includes:
continuously uploading the detection file to a high-availability storage cluster through the self-defined monitoring service, and starting a second monitoring process to monitor whether the number of times of continuous uploading failure of the detection file meets a second preset condition;
If yes, the high-availability storage cluster is judged to be in an unavailable state continuously.
Optionally, after the switching the single point mirror warehouse service to the high available mirror warehouse cluster service, the method further includes:
Writing target data into a mirror warehouse of the current environment; wherein the storage used by the mirror repository is the high availability storage cluster;
and triggering the writing operation of a local disk so as to synchronously write the target data written in the mirror warehouse into the local disk.
Optionally, after the switching the high-availability mirror warehouse cluster service to the single-point mirror warehouse service, the method further includes:
writing target data into a mirror warehouse of the current environment; the storage used by the mirror image warehouse is a local disk;
And triggering the writing operation of the high-availability storage cluster so as to synchronously write the target data written in the mirror warehouse into the high-availability storage cluster.
Optionally, in the process of synchronously writing the target data written in the mirror warehouse to the high-availability storage cluster, the method further includes:
And if the high-availability storage cluster is monitored to be unavailable, writing the target data into a preset dual-activity process, and when the high-availability storage cluster is monitored to be available, asynchronously writing the target data in the preset dual-activity process into the high-availability storage cluster.
In a second aspect, the present application discloses a device for improving the stability of a mirror warehouse, comprising:
The service type determining module is used for monitoring the running state of the local single-point mirror image warehouse service through the custom monitoring service after the custom monitoring service is started so as to determine the mirror image warehouse service type used in the current environment;
the first monitoring module is used for starting a first monitoring process through the self-defined monitoring service if the mirror image warehouse service type is single-point mirror image warehouse service, and if the first monitoring process is in a continuously available state, switching the single-point mirror image warehouse service into the high-availability mirror image warehouse cluster service;
and the second monitoring module is used for starting a second monitoring process through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state or not if the mirror image warehouse service type is the high-availability mirror image warehouse cluster service, and if so, switching the high-availability mirror image warehouse cluster service into the single-point mirror image warehouse service.
In a third aspect, the present application discloses an electronic device, comprising:
A memory for storing a computer program;
and a processor for executing the computer program to implement the steps of the method for improving the stability of the mirror warehouse disclosed above.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the previously disclosed method of improving the stability of a mirrored warehouse.
After the custom monitoring service is started, the running state of the local single-point mirror image warehouse service is monitored through the custom monitoring service to determine the type of the mirror image warehouse service used in the current environment; if the mirror image warehouse service type is single-point mirror image warehouse service, a first monitoring process is started through the custom monitoring service to monitor whether a high-availability storage cluster is continuously in an available state, and if yes, the single-point mirror image warehouse service is switched to the high-availability mirror image warehouse cluster service; and if the image warehouse service type is the high-availability image warehouse cluster service, starting a second monitoring process through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state, and if so, switching the high-availability image warehouse cluster service into the single-point image warehouse service. Therefore, the application determines the mirror image warehouse service type used by the current environment through the self-defined monitoring service, starts the monitoring process corresponding to the mirror image warehouse service type to monitor whether the high-availability storage cluster is continuously in the available state or is continuously in the unavailable state, and then determines whether to switch the current mirror image warehouse service type according to the monitoring result. The service type of the mirror image warehouse can be automatically switched by monitoring whether the high-availability storage cluster is available or not in real time through the self-defined monitoring service, so that the stability of the mirror image warehouse service is improved. In addition, through the continuously available or continuously unavailable judging conditions, temporary service abnormal scenes caused by network fluctuation and server blocking can be avoided, and stable operation and scene judgment of a service system are ensured.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for improving the stability of a mirror warehouse according to the present application;
FIG. 2 is a schematic diagram of a specific customized monitoring service operation flow disclosed in the present application;
FIG. 3 is a flowchart of a method for improving the stability of a mirror warehouse according to the present application;
FIG. 4 is a schematic diagram of a specific customized monitoring service operation flow disclosed in the present application;
FIG. 5 is a schematic diagram of a device for improving the stability of a mirror warehouse according to the present application;
fig. 6 is a block diagram of an electronic device according to the present disclosure.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The running, updating and upgrading of the service depend on the stability of the environment, and a strategy for guaranteeing the running stability of the basic components of the environment needs to be provided. Under the requirement of ensuring stability, the importance of stable operation of the basic component is reflected, and an automatic guarantee strategy and a recovery function with certain capacity can be provided for abnormal burst problems. And thus is particularly important for the stability, availability and disaster recovery capability of mirrored warehouses that provide a containerized basis. Therefore, the embodiment of the application discloses a method, a device, equipment and a medium for improving the stability of a mirror image warehouse, which can improve the stability of the mirror image warehouse.
Referring to fig. 1 and 2, an embodiment of the present application discloses a method for improving stability of a mirror warehouse, where the method includes:
Step S11: after the custom monitoring service is started, the running state of the local single-point mirror image warehouse service is monitored through the custom monitoring service to determine the type of the mirror image warehouse service used in the current environment.
In this embodiment, after the custom monitoring service (i.e. minor) is started, the running state of the local single-point mirror warehouse service is monitored by the custom monitoring service to determine whether the mirror warehouse service type used in the current environment is the single-point mirror warehouse service or the high-availability mirror warehouse cluster service. It can be appreciated that the custom monitoring service is used to monitor the storage and mirror service of the environment, while the mirror warehouse component (i.e. registry) provides mirror service for each component running in the environment, and in the embodiment of the present application, the two modes are single-point and high-availability.
Further, the monitoring the running state of the local single-point mirror warehouse service through the custom monitoring service to determine the type of the mirror warehouse service used in the current environment includes: monitoring the running state of the local single-point mirror image warehouse service through the custom monitoring service; if the running state is in running, judging that the type of the mirror image warehouse service used in the current environment is single-point mirror image warehouse service; and if the running state is not running, judging that the type of the mirror image warehouse service used by the current environment is high-availability mirror image warehouse cluster service. It can be understood that the mirror image warehouse service type of the current environment comprises a single-point mirror image warehouse service and a high-availability mirror image warehouse cluster service, the mirror image warehouse service type used by the current environment can be determined by monitoring the running state of the local single-point mirror image warehouse service, and particularly, if the running state is in running, the mirror image warehouse service type is judged to be the single-point mirror image warehouse service; and if the running state is not running, judging that the mirror image warehouse service type is high-availability mirror image warehouse cluster service. Similarly, the running state of the high-availability mirror warehouse cluster service can be monitored to determine the type of the mirror warehouse service.
Step S12: if the image warehouse service type is the single-point image warehouse service, a first monitoring process is started through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an available state, and if so, the single-point image warehouse service is switched to the high-availability image warehouse cluster service.
In this embodiment, if the image warehouse service type is a single-point image warehouse service, a corresponding first monitoring process is started through a custom monitoring service, and whether a high-availability storage cluster (i.e., minio clusters) is continuously in an available state is monitored by using the first monitoring process, if so, the current single-point image warehouse service is switched to the high-availability image warehouse cluster service. That is, if the high available storage cluster of the current environment is found to be available for multiple times, the single-point mirror image warehouse service of the current node is closed, and the high available mirror image warehouse cluster service is switched to. It should be noted that after the custom monitoring service is started, the highly available storage cluster information in the current environment is initialized.
Step S13: and if the image warehouse service type is the high-availability image warehouse cluster service, starting a second monitoring process through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state, and if so, switching the high-availability image warehouse cluster service into the single-point image warehouse service.
In this embodiment, if the image warehouse service type is the high available image warehouse cluster service, a second monitoring process is started through the custom monitoring service, and whether the high available storage cluster is continuously in an unavailable state is monitored by using the second monitoring process, if so, the current high available image warehouse cluster service is switched to the single-point image warehouse service. If the high available storage cluster of the current environment is not available, the high available mirror image warehouse cluster service of the current node is closed, and the current node is switched to the single-point mirror image warehouse service.
It should be noted that the above-mentioned switching of the mirror warehouse is based on the ip drift of keepalive; wherein keepalive represents vip service, proxy high available mirror warehouse cluster address. When the high available storage cluster of the environment is not available, the high available mirror image warehouse cluster service is not available, and after the single-point mirror image warehouse service is started, the vip of the registry automatically shifts to the single-node registry to provide the mirror image service. In addition, the user-defined monitoring service monitors the availability of the high-availability storage cluster in real time, judges the activity of the high-availability storage cluster through continuous multiple times of availability or unavailability, and decides which operation mode to switch the mirror image warehouse according to the activity, so that the monitoring accuracy is improved, temporary service abnormal scenes caused by network fluctuation and server blocking can be avoided, and the stable operation and scene judgment of a service system are ensured.
It should also be noted that the configuration files and service files of the high availability image repository cluster service and the single point image repository service are mutually exclusive. Because the two modes of the mirror repository are incompatible with each other, separate configuration files and service files are required, respectively, so that the corresponding service modes can be provided. And meanwhile, when the high-availability storage cluster or the high-availability mirror image warehouse cluster service is abnormal, the environment is ensured to exist in the environment with only one mirror image warehouse service mode, and the data is ensured not to be confused.
After the custom monitoring service is started, the running state of the local single-point mirror image warehouse service is monitored through the custom monitoring service to determine the type of the mirror image warehouse service used in the current environment; if the mirror image warehouse service type is single-point mirror image warehouse service, a first monitoring process is started through the custom monitoring service to monitor whether a high-availability storage cluster is continuously in an available state, and if yes, the single-point mirror image warehouse service is switched to the high-availability mirror image warehouse cluster service; and if the image warehouse service type is the high-availability image warehouse cluster service, starting a second monitoring process through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state, and if so, switching the high-availability image warehouse cluster service into the single-point image warehouse service. Therefore, the application determines the mirror image warehouse service type used by the current environment through the self-defined monitoring service, starts the monitoring process corresponding to the mirror image warehouse service type to monitor whether the high-availability storage cluster is continuously in the available state or is continuously in the unavailable state, and then determines whether to switch the current mirror image warehouse service type according to the monitoring result. The service type of the mirror image warehouse can be automatically switched by monitoring whether the high-availability storage cluster is available or not in real time through the self-defined monitoring service, so that the stability of the mirror image warehouse service is improved. In addition, through the continuously available or continuously unavailable judging conditions, temporary service abnormal scenes caused by network fluctuation and server blocking can be avoided, and stable operation and scene judgment of a service system are ensured.
Referring to fig. 3, an embodiment of the present application discloses a specific method for improving stability of a mirror warehouse, and compared with the previous embodiment, the present embodiment further describes and optimizes a technical solution.
The method specifically comprises the following steps:
Step S21: after the custom monitoring service is started, the running state of the local single-point mirror image warehouse service is monitored through the custom monitoring service to determine the type of the mirror image warehouse service used in the current environment.
Step S22: if the mirror image warehouse service type is single-point mirror image warehouse service, continuously uploading the detection file to a high-availability storage cluster through the self-defined monitoring service, and starting a first monitoring process to monitor whether the times of continuous uploading of the detection file meet a first preset condition or not.
In this embodiment, if the current environment uses the single-point mirror image warehouse service, the detection file is continuously uploaded to the high-availability storage cluster through the custom monitoring service, and the first monitoring process is started to monitor whether the number of times of continuous uploading of the detection file meets the first preset condition. Specifically, whether the uploading of the detection file is successful is monitored continuously for multiple times, wherein the first preset condition, namely the continuous success times, can be set automatically.
It should be noted that, the judgment basis of the custom monitoring service is determined by the availability of the high-availability storage cluster, but the ready probe and the ready probe of the high-availability storage cluster cannot provide satisfactory detection results, so that the custom monitoring service can upload detection files to the high-availability storage cluster in real time, and accurately judge whether the current high-availability storage cluster is available.
Step S23: and if so, judging that the high-availability storage cluster is continuously in an available state, and switching the single-point mirror image warehouse service into the high-availability mirror image warehouse cluster service.
In this embodiment, if the data is satisfied, it is determined that the high-availability storage cluster is in a normal state, i.e., is continuously in an available state. The user-defined monitoring service stops the single-point mirror image warehouse service of the current node, starts the high-availability mirror image warehouse cluster service, and switches the monitoring condition, namely, the monitoring condition when the high-availability mirror image warehouse cluster service is switched.
Further, after the switching the single-point mirror warehouse service to the high-availability mirror warehouse cluster service, the method further includes: writing target data into a mirror warehouse of the current environment; wherein the storage used by the mirror repository is the high availability storage cluster; and triggering the writing operation of a local disk so as to synchronously write the target data written in the mirror warehouse into the local disk. When the high-availability storage clusters in the system are available, providing high-availability mirror warehouse cluster service to the outside, and writing target data into the mirror warehouse of the current environment is needed, the writing operation of the local disk is touched through the dual-activity characteristic of mc (minio client component, namely minio-client), and the same target data is synchronously written into the local disk of the local single-point mirror warehouse service, so that the data consistency is ensured. It can be appreciated that the switching of the image repository is further based on consistency of the high-availability storage cluster data and the local disk storage data, wherein the high-availability storage cluster provides storage services for the high-availability image repository cluster service. Under the management of mc, a bidirectional mapping service is provided, namely, the data written into the high-availability storage cluster can be synchronously written into the local disk, so that the consistency and synchronization of the data when the mirror warehouse is switched between the high-availability mode and the single-point mode are ensured, and the data can be particularly shown in fig. 4.
It should be noted that, the local disk data used by the single-point mirror image warehouse service can be used as backup data, and can be imported into the high-availability storage cluster for storage at any time when the storage data of the high-availability storage cluster is lost, so as to provide disaster tolerance capability of the data. The local disk data can be used as backup data, so that when a major accident occurs in the current environment to cause high-availability storage cluster data to a certain extent, backup data still exist and can be quickly imported into the high-availability storage cluster, and a data basis is provided for normal operation of recovery service. When the problem of abnormal burst occurs, the mirror image warehouse service can be ensured to provide continuous, stable and accurate service.
Step S24: if the image warehouse service type is the high-availability image warehouse cluster service, continuously uploading the detection file to the high-availability storage cluster through the self-defined monitoring service, and starting a second monitoring process to monitor whether the number of times of continuous uploading failure of the detection file meets a second preset condition.
In this embodiment, if the current environment uses the high availability image warehouse cluster service, the detection file is continuously uploaded to the high availability storage cluster through the custom monitoring service, and a second monitoring process is started to monitor whether the number of times of continuous uploading failure of the detection file meets a second preset condition. Specifically, whether the file uploading failure is detected continuously and repeatedly is detected, wherein the second preset condition, namely the continuous failure times, can be set automatically.
Step S25: and if so, judging that the high-availability storage cluster is continuously in an unavailable state, and switching the high-availability mirror image warehouse cluster service into the single-point mirror image warehouse service.
In this embodiment, if the data is satisfied, it is determined that the high-availability storage cluster is in an abnormal state, i.e., is continuously in an unavailable state. The self-defined monitoring service stops the high-availability mirror image warehouse cluster service of the current node, starts the local single-point mirror image warehouse service, and switches the monitoring condition, namely the monitoring condition when the single-point mirror image warehouse service is switched, so that the automatic circulation is realized.
Further, after the switching the high-availability mirror warehouse cluster service to the single-point mirror warehouse service, the method further includes: writing target data into a mirror warehouse of the current environment; the storage used by the mirror image warehouse is a local disk; and triggering the writing operation of the high-availability storage cluster so as to synchronously write the target data written in the mirror warehouse into the high-availability storage cluster. When the high-availability storage clusters in the system are unavailable, the single-point mirror image warehouse service is provided for the outside, the target data is written into the mirror image warehouse at the moment, the writing operation of the high-availability storage clusters is triggered through the double-activity characteristic of mc, the same target data is synchronously written into the high-availability storage clusters of the high-availability mirror image warehouse cluster service, and the data consistency is ensured. It can be understood that the local disk provides storage service for the single-point mirror warehouse service, and under the management of mc, the data written into the local disk can be synchronously written into the high-availability storage cluster, so that the consistency and synchronization of the data are ensured when the mirror warehouse switches between the high-availability mode and the single-point mode.
In addition, it should be noted that, in the process of synchronously writing the target data written in the mirror warehouse into the high-availability storage cluster, the method further includes: and if the high-availability storage cluster is monitored to be unavailable, writing the target data into a preset dual-activity process, and when the high-availability storage cluster is monitored to be available, asynchronously writing the target data in the preset dual-activity process into the high-availability storage cluster. It can be understood that, because the current high-availability storage cluster is not available, the target data can wait in the preset double-active process of mc, and when the high-availability storage cluster is detected to be normal, namely available, the data is asynchronously written into the high-availability storage cluster storage of the high-availability mirror image warehouse cluster service, so that the data consistency is ensured.
For more specific processing in step S21, reference may be made to the corresponding content disclosed in the foregoing embodiment, and no further description is given here.
Therefore, the embodiment of the application monitors the storage used by the mirror image warehouse in the current environment in real time through the custom monitoring service, automatically switches between the high-availability storage cluster and the local disk storage, effectively reduces the abnormality, avoids the risk, ensures the stability of the environment basic service, reduces the risk of abnormality or failure in the environment operation process, and improves the speed and stability of the environment upgrading. The method also provides the capabilities of data backup and multiple copies, ensures that available data still exists after one end of data is lost, and greatly improves the use efficiency and the reliability of the data. The scheme ensures the stability, availability and disaster recovery capability of the mirror image warehouse in the current environment, and can effectively prevent the influence of specificity and sudden problems in the environment on the mirror image warehouse. In addition, the bidirectional mapping of the high-availability storage clusters and the local disk ensures the consistency and instantaneity of the data of the local disk and the data stored in the high-availability storage clusters through the dual-activity function of mc. When the mirror warehouse is in high availability and single-point switching, the complete matching of mirror data can be ensured, and external non-aware mirror service can be continuously provided when the environment is in disaster. By the technical scheme, the system operation state is more stable, the service output is more durable, the defect that the environment cannot normally operate due to the abnormality of the mirror image service in the past is overcome, and a strategy which meets the environment operation requirement better is created. The mirror image service involved in the version running, updating and upgrading processes is more efficient and stable.
Referring to fig. 5, an embodiment of the present application discloses a device for improving stability of a mirror warehouse, where the device includes:
The service type determining module 11 is configured to monitor, after the custom monitoring service is started, an operation state of a local single-point mirror image warehouse service through the custom monitoring service to determine a mirror image warehouse service type used in a current environment;
The first monitoring module 12 is configured to, if the mirror image warehouse service type is a single-point mirror image warehouse service, start a first monitoring process through the custom monitoring service to monitor whether a high-availability storage cluster is continuously in an available state, and if yes, switch the single-point mirror image warehouse service to a high-availability mirror image warehouse cluster service;
And the second monitoring module 13 is configured to, if the mirror image warehouse service type is a high-availability mirror image warehouse cluster service, start a second monitoring process through the custom monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state, and if so, switch the high-availability mirror image warehouse cluster service to the single-point mirror image warehouse service.
After the custom monitoring service is started, the running state of the local single-point mirror image warehouse service is monitored through the custom monitoring service to determine the type of the mirror image warehouse service used in the current environment; if the mirror image warehouse service type is single-point mirror image warehouse service, a first monitoring process is started through the custom monitoring service to monitor whether a high-availability storage cluster is continuously in an available state, and if yes, the single-point mirror image warehouse service is switched to the high-availability mirror image warehouse cluster service; and if the image warehouse service type is the high-availability image warehouse cluster service, starting a second monitoring process through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state, and if so, switching the high-availability image warehouse cluster service into the single-point image warehouse service. Therefore, the application determines the mirror image warehouse service type used by the current environment through the self-defined monitoring service, starts the monitoring process corresponding to the mirror image warehouse service type to monitor whether the high-availability storage cluster is continuously in the available state or is continuously in the unavailable state, and then determines whether to switch the current mirror image warehouse service type according to the monitoring result. The service type of the mirror image warehouse can be automatically switched by monitoring whether the high-availability storage cluster is available or not in real time through the self-defined monitoring service, so that the stability of the mirror image warehouse service is improved. In addition, through the continuously available or continuously unavailable judging conditions, temporary service abnormal scenes caused by network fluctuation and server blocking can be avoided, and stable operation and scene judgment of a service system are ensured.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Specifically, the method comprises the following steps: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is configured to store a computer program that is loaded and executed by the processor 21 to implement relevant steps in the method for improving the stability of a mirrored warehouse performed by an electronic device as disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
Processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL Processing), FPGA (Field-Programmable gate array), PLA (Programmable Logic Array ). The processor 21 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 21 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon include an operating system 221, a computer program 222, and data 223, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the processor 21 on the mass data 223 in the memory 22, which may be Windows, unix, linux. The computer program 222 may further comprise a computer program capable of performing other specific tasks in addition to the computer program capable of performing the method of improving the stability of a mirrored warehouse performed by the electronic device 20 as disclosed in any of the embodiments described above. The data 223 may include, in addition to data received by the electronic device and transmitted by the external device, data collected by the input/output interface 25 itself, and so on.
Further, the embodiment of the application also discloses a computer readable storage medium, wherein the storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the method steps executed in the process of improving the stability of the mirror warehouse disclosed in any embodiment are realized.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description of the method, the device, the equipment and the storage medium for improving the stability of the mirror warehouse provided by the invention applies specific examples to illustrate the principle and the implementation of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.
Claims (8)
1.A method for improving the stability of a mirrored warehouse, comprising:
After the custom monitoring service is started, monitoring the running state of the local single-point mirror image warehouse service through the custom monitoring service to determine the type of the mirror image warehouse service used in the current environment;
If the mirror image warehouse service type is single-point mirror image warehouse service, a first monitoring process is started through the custom monitoring service to monitor whether a high-availability storage cluster is continuously in an available state, and if yes, the single-point mirror image warehouse service is switched to the high-availability mirror image warehouse cluster service;
If the image warehouse service type is the high-availability image warehouse cluster service, a second monitoring process is started through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state, and if so, the high-availability image warehouse cluster service is switched to the single-point image warehouse service;
after the single-point mirror image warehouse service is switched to the high-availability mirror image warehouse cluster service, the method further comprises the following steps:
Writing target data into a mirror warehouse of the current environment; wherein the storage used by the mirror repository is the high availability storage cluster; triggering a writing operation of a local disk through the dual-activity characteristic of mc so as to synchronously write the target data written in the mirror warehouse into the local disk;
after the switching the high-availability mirror image warehouse cluster service to the single-point mirror image warehouse service, the method further comprises:
Writing target data into a mirror warehouse of the current environment; the storage used by the mirror image warehouse is a local disk; triggering a write operation of the high-availability storage cluster through the dual-activity characteristic of mc so as to synchronously write the target data written in the mirror warehouse into the high-availability storage cluster;
the mc is the client component of minio, minio-client.
2. The method for improving the stability of the mirror warehouse according to claim 1, wherein the monitoring the running state of the local single-point mirror warehouse service by the custom monitoring service to determine the type of the mirror warehouse service used by the current environment comprises:
Monitoring the running state of the local single-point mirror image warehouse service through the custom monitoring service;
If the running state is in running, judging that the type of the mirror image warehouse service used in the current environment is single-point mirror image warehouse service;
And if the running state is not running, judging that the type of the mirror image warehouse service used by the current environment is high-availability mirror image warehouse cluster service.
3. The method for improving the stability of a mirrored warehouse according to claim 1, wherein said starting a first monitoring process by said custom monitoring service to determine whether a high availability storage cluster is continuously in an available state comprises:
Continuously uploading the detection file to a high-availability storage cluster through the custom monitoring service, and starting a first monitoring process to monitor whether the number of times of continuous uploading success of the detection file meets a first preset condition;
if so, determining that the high-availability storage cluster is continuously in an available state.
4. The method for improving the stability of a mirrored warehouse according to claim 1, wherein said initiating a second monitoring process by said custom monitoring service monitors whether said high availability storage cluster is continuously in an unavailable state, comprising:
continuously uploading the detection file to a high-availability storage cluster through the self-defined monitoring service, and starting a second monitoring process to monitor whether the number of times of continuous uploading failure of the detection file meets a second preset condition;
If yes, the high-availability storage cluster is judged to be in an unavailable state continuously.
5. The method for improving stability of a mirror warehouse according to claim 1, wherein the process of synchronously writing the target data written in the mirror warehouse to the high-availability storage cluster further comprises:
And if the high-availability storage cluster is monitored to be unavailable, writing the target data into a preset dual-activity process, and when the high-availability storage cluster is monitored to be available, asynchronously writing the target data in the preset dual-activity process into the high-availability storage cluster.
6. An apparatus for improving the stability of a mirrored warehouse, comprising:
The service type determining module is used for monitoring the running state of the local single-point mirror image warehouse service through the custom monitoring service after the custom monitoring service is started so as to determine the mirror image warehouse service type used in the current environment;
the first monitoring module is used for starting a first monitoring process through the self-defined monitoring service if the mirror image warehouse service type is single-point mirror image warehouse service, and if the first monitoring process is in a continuously available state, switching the single-point mirror image warehouse service into the high-availability mirror image warehouse cluster service;
the second monitoring module is used for starting a second monitoring process through the self-defined monitoring service to monitor whether the high-availability storage cluster is continuously in an unavailable state or not if the mirror image warehouse service type is the high-availability mirror image warehouse cluster service, and if so, switching the high-availability mirror image warehouse cluster service into the single-point mirror image warehouse service;
After the single-point mirror image warehouse service is switched to the high-availability mirror image warehouse cluster service, the device is further used for writing target data into a mirror image warehouse of the current environment; wherein the storage used by the mirror repository is the high availability storage cluster; triggering a writing operation of a local disk through the dual-activity characteristic of mc so as to synchronously write the target data written in the mirror warehouse into the local disk;
After the high-availability mirror image warehouse cluster service is switched to the single-point mirror image warehouse service, the device is further used for writing target data into a mirror image warehouse of the current environment; the storage used by the mirror image warehouse is a local disk; triggering a write operation of the high-availability storage cluster through the dual-activity characteristic of mc so as to synchronously write the target data written in the mirror warehouse into the high-availability storage cluster;
the mc is the client component of minio, minio-client.
7. An electronic device, comprising:
A memory for storing a computer program;
a processor for executing the computer program to carry out the steps of the method of improving the stability of a mirrored warehouse as claimed in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program; wherein the computer program when executed by a processor implements the steps of the method of improving the stability of a mirrored warehouse as claimed in any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211347594.4A CN115695453B (en) | 2022-10-31 | 2022-10-31 | Method, device, equipment and medium for improving stability of mirror image warehouse |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211347594.4A CN115695453B (en) | 2022-10-31 | 2022-10-31 | Method, device, equipment and medium for improving stability of mirror image warehouse |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115695453A CN115695453A (en) | 2023-02-03 |
CN115695453B true CN115695453B (en) | 2024-08-13 |
Family
ID=85046864
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211347594.4A Active CN115695453B (en) | 2022-10-31 | 2022-10-31 | Method, device, equipment and medium for improving stability of mirror image warehouse |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115695453B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115220737A (en) * | 2021-04-19 | 2022-10-21 | 顺丰科技有限公司 | Image deployment method, apparatus, computer equipment and storage medium |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7680982B2 (en) * | 2007-02-20 | 2010-03-16 | International Business Machines Corporation | Preservation of cache data following failover |
CN103116661B (en) * | 2013-03-20 | 2016-01-27 | 广东宜通世纪科技股份有限公司 | A kind of data processing method of database |
US9507678B2 (en) * | 2014-11-13 | 2016-11-29 | Netapp, Inc. | Non-disruptive controller replacement in a cross-cluster redundancy configuration |
CN108241558A (en) * | 2016-12-27 | 2018-07-03 | 中移(苏州)软件技术有限公司 | A mirror warehouse backup device and method |
CN107229539A (en) * | 2017-05-31 | 2017-10-03 | 郑州云海信息技术有限公司 | A kind of processing method and system for disk mirroring high-availability cluster diskless |
CN111176664A (en) * | 2019-12-26 | 2020-05-19 | 中国电子科技网络信息安全有限公司 | Storage cluster setting method, device, medium and equipment |
CN111209011A (en) * | 2019-12-31 | 2020-05-29 | 烽火通信科技股份有限公司 | Cross-platform container cloud automatic deployment system |
CN114661519B (en) * | 2020-12-22 | 2025-03-25 | 国信君和(北京)科技有限公司 | Data backup method and device |
CN113157392B (en) * | 2021-04-09 | 2022-10-04 | 上海云轴信息科技有限公司 | High-availability method and equipment for mirror image warehouse |
CN113760453B (en) * | 2021-08-04 | 2024-05-28 | 南方电网科学研究院有限责任公司 | Container mirror image distribution system and container mirror image pushing, pulling and deleting method |
CN113900676B (en) * | 2021-09-24 | 2025-01-28 | 浪潮云信息技术股份公司 | A method for automatically upgrading a containerized cloud platform |
CN113886021A (en) * | 2021-10-21 | 2022-01-04 | 郑州云海信息技术有限公司 | Mirror image backup method and device, electronic equipment and readable storage medium |
-
2022
- 2022-10-31 CN CN202211347594.4A patent/CN115695453B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115220737A (en) * | 2021-04-19 | 2022-10-21 | 顺丰科技有限公司 | Image deployment method, apparatus, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115695453A (en) | 2023-02-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111459749B (en) | Prometheus-based private cloud monitoring method and device, computer equipment and storage medium | |
CN108696581B (en) | Distributed information caching method and device, computer equipment and storage medium | |
CN111917846A (en) | Kafka cluster switching method, device and system, electronic equipment and readable storage medium | |
US20170220430A1 (en) | Failover of a database in a high-availability cluster | |
US20020152423A1 (en) | Persistent session and data in transparently distributed objects | |
CN105338078A (en) | Data storage method and device used for storing system | |
US10476988B2 (en) | Automated configuration support system | |
CN112836152B (en) | Page rendering method, system, computer device and computer readable storage medium | |
CN114189429A (en) | System, method, device and medium for monitoring server cluster faults | |
CN110633046A (en) | Storage method and device of distributed system, storage equipment and storage medium | |
CN109474694A (en) | A management and control method and device for a NAS cluster based on a SAN storage array | |
US8621260B1 (en) | Site-level sub-cluster dependencies | |
CN115695453B (en) | Method, device, equipment and medium for improving stability of mirror image warehouse | |
CN113791798B (en) | Model updating method and device, computer storage medium and electronic equipment | |
CN116932505A (en) | Data query method, data writing method, related device and system | |
CN110457392B (en) | Copy reading and writing method and device | |
CN108200151A (en) | ISCSI Target load-balancing methods and device in a kind of distributed memory system | |
CN112199176A (en) | Service processing method, device and related equipment | |
US9880855B2 (en) | Start-up control program, device, and method | |
CN117435569A (en) | Dynamic capacity expansion method, device, equipment, medium and program product for cache system | |
US12141461B2 (en) | Integrating mirrored storage to remote replication site | |
KR20210091075A (en) | Traffic adjustment method and apparatus | |
CN111435320B (en) | Data processing method and device | |
CN112882771A (en) | Server switching method and device of application system, storage medium and electronic equipment | |
KR20210112930A (en) | Apparatus for managing virtual network function and method for the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |