CN116069737A - Automatic log space recovery method, system, device and medium - Google Patents

Automatic log space recovery method, system, device and medium Download PDF

Info

Publication number
CN116069737A
CN116069737A CN202310136063.9A CN202310136063A CN116069737A CN 116069737 A CN116069737 A CN 116069737A CN 202310136063 A CN202310136063 A CN 202310136063A CN 116069737 A CN116069737 A CN 116069737A
Authority
CN
China
Prior art keywords
log
host
alarm
space
log partition
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.)
Pending
Application number
CN202310136063.9A
Other languages
Chinese (zh)
Inventor
潘景基
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202310136063.9A priority Critical patent/CN116069737A/en
Publication of CN116069737A publication Critical patent/CN116069737A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method, a system, a device and a medium for automatically recovering log space, which are applied to the field of log recovery. The method comprises the steps of obtaining the utilization rate of log partition space of each host and judging whether the utilization rate of the log partition space of each host reaches an alarm threshold; if the alarm threshold is reached, determining that the host generates a log partition space alarm, clearing log files under the log partition file directory of the host generating the alarm at present and reserving the log partition file directory. By the method, the alarm is generated when the space is used excessively, the log partition space can be automatically recovered when the log partition space of the host is used excessively, the problem that the normal operation of the host is affected when the log partition space of the host is used excessively is effectively solved, the overall stability of the system is greatly ensured, the system is not limited by a certain mechanism, the log file catalogue is not directly deleted, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.

Description

Automatic log space recovery method, system, device and medium
Technical Field
The present disclosure relates to the field of log recovery, and in particular, to a method, system, device, and medium for automatically recovering log space.
Background
With the sustainable development of virtualization technology products, the requirement on the log recovery function of the host computer of the virtualization system is gradually increased, and when the use of the partition space of the host computer log is overfull, the performance problems of normal operation of the host computer and the like are affected, so that the overall stability of the system is reduced.
At present, the realization of the log space recovery function of the host computer of the virtualized system is limited to a log file management tool (log rotation) mechanism of the system, is limited to a log rotation self mechanism, or can directly delete an old log file directory in some scenes, and cannot recycle the log file directory.
In view of the above problems, a solution to the above technical problems is sought for by those skilled in the art.
Disclosure of Invention
The application aims to provide a log space automatic recovery method, a system, a device and a medium.
According to the log space automatic recovery method, the utilization rate of the log partition space of each host is obtained, and whether the utilization rate of the log partition space of each host reaches an alarm threshold is judged; if the alarm threshold is reached, determining that the host generates a log partition space alarm, clearing log files under the log partition file directory of the host generating the alarm at present and reserving the log partition file directory. By the method, the alarm is generated when the space is used excessively, the log partition space can be automatically recovered when the log partition space of the host is used excessively, the problem that the normal operation of the host is affected when the log partition space of the host is used excessively is effectively solved, the overall stability of the system is greatly ensured, the system is not only limited by a certain mechanism, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.
In order to solve the above technical problems, the present application provides a log space automatic recovery method, including:
acquiring the utilization rate of log partition space of each host;
judging whether the utilization rate of the log partition space of each host reaches an alarm threshold value or not;
if the alarm threshold is reached, determining that the host generates log partition space alarm;
and (3) clearing the log files under the log partition file directory of the host computer generating the current alarm and reserving the log partition file directory.
Preferably, the clearing the log file under the log partition file directory of the host generating the alarm and reserving the log partition file directory includes:
emptying the log file of the log rotation dump according to the size of the log file;
after the log file of log rotation dump is emptied, judging whether the space alarm of the log partition of the host computer is eliminated;
and if the host log partition space alarm is not eliminated, clearing other log files according to the size of the log files until the host log partition space alarm is eliminated.
Preferably, the clearing the log file under the log partition file directory of the host generating the alarm and reserving the log partition file directory includes:
clearing the log file with the log file generation time longer than the first preset time;
judging whether the partition space alarm of the host log is eliminated;
and if the host log partition space alarm is not eliminated, clearing other log files with the log file generation time not longer than the first preset time according to the size of the log file until the host log partition space alarm is eliminated.
Preferably, after the host computer generates the log partition space alarm, the method further comprises the steps of:
judging whether the alarm duration of the host generating the alarm reaches a second preset time;
if yes, entering a step of clearing the log files under the log partition file directory of the host computer generating the alarm and reserving the log partition file directory.
Preferably, the alarm threshold comprises: a first alarm threshold and a second alarm threshold;
if the utilization rate of the log partition space of the other hosts reaches the second alarm threshold value but does not reach the first alarm threshold value when the log files under the log partition file directory of the host which generates the alarm at present are emptied, continuing to execute the step of emptying the log files under the log partition file directory of the host which generates the alarm at present;
and if the utilization rate of the log partition space of the other hosts reaches a first alarm threshold, executing the clearing of the log files under the log partition file directory of the other hosts.
Preferably, after the log files under the log partition file directory of the host computer generating the alarm are emptied and the log partition file directory is reserved, the method further comprises:
and saving operation record information of the emptying log file.
Preferably, before obtaining the usage rate of the log partition space of each host, further includes:
acquiring and managing the resources of each host;
and providing a unified IP address to the outside, wherein the IP address is a login address of the virtualized management platform.
For solving the above technical problem, the present application further provides an automatic log space recovery system, including:
the acquisition module is used for acquiring the utilization rate of the log partition space of each host;
the judging module is used for judging whether the utilization rate of the log partition space of each host reaches an alarm threshold value;
the determining module is used for determining that the host generates log partition space alarm if the alarm threshold is reached;
and the clearing module is used for clearing the log files under the log partition file directory of the host computer generating the alarm at present and reserving the log partition file directory.
In order to solve the technical problem, the application also provides an automatic log space recycling device, which comprises a memory for storing a computer program;
and the processor is used for realizing the steps of the automatic log space recovery method when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer readable storage medium, on which a computer program is stored, where the computer program when executed by a processor implements the steps of the log space automatic recovery method described above.
According to the log space automatic recovery method, the utilization rate of the log partition space of each host is obtained, and whether the utilization rate of the log partition space of each host reaches an alarm threshold is judged; if the alarm threshold is reached, determining that the host generates a log partition space alarm, clearing log files under the log partition file directory of the host generating the alarm at present and reserving the log partition file directory. By the method, the alarm is generated when the space is used excessively, the log partition space can be automatically recovered when the log partition space of the host is used excessively, the problem that the normal operation of the host is affected when the log partition space of the host is used excessively is effectively solved, the overall stability of the system is greatly ensured, the system is not only limited by a certain mechanism, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.
The application also provides an automatic log space recovery system, an automatic log space recovery device and a computer readable storage medium, which correspond to the method, and have the same beneficial effects as the method.
Drawings
For a clearer description of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an automatic log space recycling method provided by the present application;
FIG. 2 is a block diagram of an automatic log space recovery system provided herein;
fig. 3 is a block diagram of an automatic log space recycling device according to another embodiment of the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments herein without making any inventive effort are intended to fall within the scope of the present application.
The core of the application is to provide a method, a system, a device and a medium for automatically recovering log space.
According to the log space automatic recovery method, system, device and medium, the utilization rate of the log partition space of each host is obtained, and whether the utilization rate of the log partition space of each host reaches an alarm threshold is judged; if the alarm threshold is reached, determining that the host generates a log partition space alarm, clearing log files under the log partition file directory of the host generating the alarm at present and reserving the log partition file directory. By the method, the alarm is generated when the space is used excessively, the log partition space can be automatically recovered when the log partition space of the host is used excessively, the problem that the normal operation of the host is affected when the log partition space of the host is used excessively is effectively solved, the overall stability of the system is greatly ensured, the system is not only limited by a certain mechanism, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.
In order to provide a better understanding of the present application, those skilled in the art will now make further details of the present application with reference to the drawings and detailed description.
Fig. 1 is a flowchart of a log space automatic recovery method provided in the present application, as shown in fig. 1, the method includes:
s10: acquiring the utilization rate of log partition space of each host;
the plurality of hosts managed by the virtualization management platform are used for managing log partition spaces of the plurality of hosts, and the use rates of the log partition spaces of the plurality of hosts are acquired.
S11: judging whether the utilization rate of the log partition space of each host reaches an alarm threshold value or not;
when the virtualized system management platform is deployed, the alarm threshold value of the log partition space utilization rate of each host is configured, namely, a threshold value which can be reached by the log partition space utilization rate of each host is correspondingly limited, the size of the alarm threshold value is not limited in the embodiment of the application, the number of the configured alarm threshold values is not limited in the embodiment of the application, and when the log partition space utilization rate of each host is obtained by the virtualized system management platform, whether the log partition space utilization rate of each host reaches the alarm threshold value is judged.
S12: if the alarm threshold is reached, determining that the host generates log partition space alarm;
it should be noted that, when the virtualized system management platform obtains the alarm threshold value that the usage rate of the log partition space of a certain host has reached, it is determined that the current host generates the log partition space alarm, and the embodiment of the present application does not limit the manner of recovering the space in the next step after obtaining the log partition space alarm generated by the host, and may send alarm information all the time for the main sentence in a continuous time, and then perform the operation of log partition space recovery processing on the host. The method may also determine that the host needs to be subjected to space purging as long as the alarm information sent by the host is acquired, or may be other cases, and the embodiment of the present application is not limited to the form only including the above, and may be changed according to specific cases.
S13: and (3) clearing the log files under the log partition file directory of the host computer generating the current alarm and reserving the log partition file directory.
It should be noted that, when it is determined that the usage rate of the log partition space of the current host reaches the alarm threshold and has reached the condition that the log partition space can be emptied, the alarm threshold is subjected to an emptying operation, and the log file of the current host that is generating high precision is subjected to an emptying operation to recover the log partition space and reserve the log partition file directory. The embodiment of the application does not limit the mode and the sequence of clearing log files, and the embodiment of the application does not specifically limit the host of log files when clearing log files.
Therefore, by the method provided by the embodiment, the utilization rate of the log partition space of each host is obtained and whether the utilization rate of the log partition space of each host reaches the alarm threshold is judged; if the alarm threshold is reached, determining that the host generates a log partition space alarm, clearing log files under the log partition file directory of the host generating the alarm at present and reserving the log partition file directory. By the method, the alarm is generated when the space is used excessively, the log partition space can be automatically recovered when the log partition space of the host is used excessively, the problem that the normal operation of the host is affected when the log partition space of the host is used excessively is effectively solved, the overall stability of the system is greatly ensured, the system is not only limited by a certain mechanism, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.
Based on the foregoing embodiments, the present application provides a preferred embodiment, where the clearing the log file under the log partition file directory of the host generating the alarm and reserving the log partition file directory includes:
emptying the log file of the log rotation dump according to the size of the log file;
after the log file of log rotation dump is emptied, judging whether the space alarm of the log partition of the host computer is eliminated;
and if the host log partition space alarm is not eliminated, clearing other log files according to the size of the log files until the host log partition space alarm is eliminated.
When the utilization rate of the log partition space of the current host reaches the alarm threshold and the log partition space is determined to be recovered, the log file can be cleaned according to the size of the log file, firstly, the log file dumped by the log rotation is cleaned according to the file size of the log file, and after the log file is cleaned, whether the utilization rate of the log partition space reaches the alarm threshold is judged again, if the utilization rate of the log partition space is still in an alarm state, other log files are cleaned according to the log file size until no alarm is performed. The application provides an embodiment of an application scenario, for example, when the usage rate of a log partition space of a certain host reaches an alarm threshold value and reaches a trigger condition of automatic recovery, the log partition/var/log directory of the host contains File1, file2 and File3 log files, and/var/log/backup contains log rotation dump log File6, file7 and File8 log files, wherein the size of File1 is 200M, the size of File2 is 350M, the size of File3 is 600M, the size of File6 is 500M, the size of File7 is 100M and the size of File8 is 300M. At this time, according to the configured host log partition space recovery strategy, the method is executed according to the size, the log File contents under File6, file7 and File8 under/var/log/backup are preferentially emptied, the order of the host log File is File6, file8 and File7 in sequence, if the host log partition space utilization rate alarm elimination condition is met at this time, the host log partition space recovery is stopped, and the non-dump log File is not continuously emptied; if the throwing of the host log partition utilization rate alarm elimination condition is not met at this time, the recovery of the host log partition space is continuously executed, file1, file2 and File3 File spaces under recovery/var/log are recovered, the order of clearing host log files is sequentially File3, file2 and File1, until the host log partition space utilization rate alarm elimination condition is met, and the recovery of the clearing files is stopped continuously. The embodiment of the application only provides an embodiment of an application scene, and the embodiment of the application is not limited to the embodiment only including the log file clearing mode.
Therefore, according to the method provided by the embodiment of the application, the utilization rate of the log partition space of each host is obtained, and whether the utilization rate of the log partition space of each host reaches the alarm threshold is judged; if the alarm threshold is reached, determining that the host generates a log partition space alarm, clearing the log files under the log partition file directory of the host generating the alarm currently according to the size of the log files, and reserving the log partition file directory. By the method, the alarm is generated when the space is used excessively, the log partition space can be automatically recovered when the log partition space of the host is used excessively, the problem that the normal operation of the host is affected when the log partition space of the host is used excessively is effectively solved, the overall stability of the system is greatly ensured, the system is not only limited by a certain mechanism, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.
Based on the foregoing embodiments, the present application provides a preferred embodiment, where clearing the log file under the log partition file directory of the host generating the alarm and reserving the log partition file directory includes:
clearing the log file with the log file generation time longer than the first preset time;
judging whether the partition space alarm of the host log is eliminated;
and if the host log partition space alarm is not eliminated, clearing other log files with the log file generation time not longer than the first preset time according to the size of the log file until the host log partition space alarm is eliminated.
When the utilization rate of the log partition space of the current host reaches the alarm threshold and the log partition space is determined to be recovered, the log file can be cleaned according to the generation time of the log file, the file size of the log file is cleaned when the generation time exceeds the preset time, whether the utilization rate of the log partition space reaches the alarm threshold is judged again after the cleaning, and if the utilization rate of the log partition space is still in an alarm state, other log files which do not exceed the preset time are cleaned according to the log file size until the alarm is not performed. The application provides an embodiment of an application scenario, for example, when the usage rate of a log partition space of a certain host reaches an alarm threshold value and reaches a trigger condition of automatic recovery, the log partition/var/log directory of the host contains File1, file2, file3, file4, file5 and File6 log files, wherein the File of File4, file5 and File6 is a File which has exceeded seven days, the size of File1 is 200M, file2 is 350M, file3 is 600M, file4 is 500M, file5 is 100M and File6 is 300M. At this time, according to the configured host log partition space recovery strategy, executing according to the generation time, preferentially emptying the log File contents under File4, file5 and File6 under the directory, wherein the order of emptying the host log files is sequentially File4, file6 and File5, and if the host log partition space utilization rate alarm elimination condition is met at this time, stopping host log partition space recovery, and not continuing to execute emptying the non-dump log files; if the throwing of the host log partition utilization rate alarm elimination condition is not met at this time, the recovery of the host log partition space is continuously executed, file1, file2 and File3 File spaces under recovery/var/log are recovered, the order of clearing host log files is sequentially File3, file2 and File1, until the host log partition space utilization rate alarm elimination condition is met, and the recovery of the clearing files is stopped continuously. The embodiment of the application only provides an embodiment of an application scene, but the embodiment of the application is not limited to the emptying mode only including the log file, and can be selected according to other conditions.
Therefore, according to the method provided by the embodiment of the application, the utilization rate of the log partition space of each host is obtained, and whether the utilization rate of the log partition space of each host reaches the alarm threshold is judged; if the alarm threshold is reached, determining that the host generates the log partition space alarm, clearing the log files under the log partition file directory of the host generating the alarm at present according to the generation time of the log files, and reserving the log partition file directory. By the method, the alarm is generated when the space is used excessively, the log partition space can be automatically recovered when the log partition space of the host is used excessively, the problem that the normal operation of the host is affected when the log partition space of the host is used excessively is effectively solved, the overall stability of the system is greatly ensured, the system is not only limited by a certain mechanism, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.
Based on the foregoing embodiments, the present application provides a preferred embodiment, after determining that the host generates the log partition space alarm, before clearing the log file under the log partition file directory of the host generating the alarm and reserving the log partition file directory, further includes:
judging whether the alarm duration of the host generating the alarm reaches a second preset time;
if yes, entering a step of clearing the log files under the log partition file directory of the host computer generating the alarm and reserving the log partition file directory.
When the host triggers the alarm threshold, in order to ensure that the alarm threshold is accurate, whether the alarm time reaches the preset time is judged, and when the alarm duration reaches the preset time, the operation step of emptying the log file and recovering the log partition space is performed for a second time.
Therefore, according to the method provided by the embodiment of the application, the utilization rate of the log partition space of each host is obtained, and whether the utilization rate of the log partition space of each host reaches the alarm threshold is judged; if the alarm threshold is reached, determining that the host generates the log partition space alarm, judging whether the alarm time reaches the preset time length, and if the alarm time reaches the preset time length, clearing the log files under the log partition file directory of the host generating the alarm currently and reserving the log partition file directory. By the method, the alarm is generated when the space is used excessively, the log partition space can be automatically recovered when the log partition space of the host is used excessively, the problem that the normal operation of the host is affected when the log partition space of the host is used excessively is effectively solved, the overall stability of the system is greatly ensured, the system is not only limited by a certain mechanism, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.
Based on the foregoing embodiments, the present application provides a preferred embodiment, where the alarm threshold includes: a first alarm threshold and a second alarm threshold;
if the utilization rate of the log partition space of the other hosts reaches the second alarm threshold value but does not reach the first alarm threshold value when the log files under the log partition file directory of the host which generates the alarm at present are emptied, continuing to execute the step of emptying the log files under the log partition file directory of the host which generates the alarm at present;
and if the utilization rate of the log partition space of the other hosts reaches a first alarm threshold, executing the clearing of the log files under the log partition file directory of the other hosts.
It should be noted that, the embodiment of the application is not limited to only setting two alarm thresholds, and may set multiple alarm thresholds according to actual situations.
Therefore, according to the method provided by the embodiment of the application, the utilization rate of the log partition space of each host is obtained, and whether the utilization rate of the log partition space of each host reaches the alarm threshold is judged; if the alarm threshold is reached, determining that the host generates a log partition space alarm, clearing the log files under the log partition file directory of the host generating the alarm currently according to the size of the log files, and reserving the log partition file directory. By the method, the space usage is overfilled to generate the alarm, a plurality of alarm thresholds are set, when the log partition of the host is overfilled, the log partition space can be automatically recovered, if other hosts trigger the alarm in the space recovery process of a certain host, a better emptying mode is carried out, the problem that the normal operation of the host is affected when the log partition space of the host is overfilled is effectively solved, the overall stability of the system is greatly ensured, the system is not only limited by a certain mechanism, the log file catalogue is recycled, the sustainable updating of the system is ensured, and the overall normal operation efficiency of the system is improved.
Based on the foregoing embodiments, the present application provides a preferred embodiment, where after clearing the log file under the log partition file directory of the current host generating the alarm and maintaining the log partition file directory, the method further includes:
and saving operation record information of the emptying log file.
It should be noted that, when the log file is emptied, the operation information of the log file is recorded so as to facilitate the subsequent inquiry of the emptied file.
Therefore, the method provided by the embodiment records the operation information of the mahjong tile emptying after the log partition space is emptied, provides convenience when the information of the emptied file is queried later, prevents errors from being clear, ensures sustainable updating of the system, and improves the overall normal operation efficiency of the system.
Based on the foregoing embodiments, the present application provides a preferred embodiment, and before obtaining the usage rate of the log partition space of each host, the method further includes:
acquiring and managing the resources of each host;
and providing a unified IP address to the outside, wherein the IP address is a login address of the virtualized management platform.
It should be noted that, the virtualized system management platform includes a management node and a computing node, where the management node is a management control center of the virtualized platform system software, and can manage multiple hosts, add resources of the multiple hosts into a pool and manage the resources, and a user can perform centralized management on virtualized resources such as computing, storage, and network. The computing node is the host computer and is the computing service for installing the virtualized platform system software. The unified IP address is provided to ensure that a user can manage each host through the same address, and the overall normal operation efficiency of the system is improved.
Based on the angle of the functional module, fig. 2 is a block diagram of an automatic log space recovery system provided in an embodiment of the present application, as shown in fig. 2, the system includes:
an obtaining module 20, configured to obtain a usage rate of a log partition space of each host;
a judging module 21, configured to judge whether the usage rate of the log partition space of each host reaches an alarm threshold;
a determining module 22, configured to determine that the host generates a log partition space alarm if the alarm threshold is reached;
the clearing module 23 is configured to clear the log file under the log partition file directory of the host that generates the alarm currently and keep the log partition file directory.
Since the embodiments of the system portion and the embodiments of the method portion correspond to each other, the embodiments of the system portion refer to the description of the embodiments of the method portion, which is not repeated herein.
The log space automatic recovery system provided by the embodiment corresponds to the log space automatic recovery method, so that the log space automatic recovery system has the same beneficial effects as the method.
Fig. 3 is a block diagram of an automatic log space recycling device according to another embodiment of the present application, and as shown in fig. 3, the automatic log space recycling device includes: a memory 20 for storing a computer program;
a processor 21 for implementing the steps of the method of automatic log space reclamation as mentioned in the above embodiments when executing a computer program.
The log space automatic recycling device provided by the embodiment can include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer or the like.
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 hardware in at least one of a digital signal processor (Digital Signal Processor, DSP), a Field programmable gate array (Field-Programmable Gate Array, FPGA), a programmable logic array (Programmable Logic Array, PLA). The processor 21 may also comprise a main processor, which is a processor for processing data in an awake state, also called central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with an image processor (Graphics Processing Unit, GPU) for taking care of rendering and rendering of the content that the display screen is required to display. In some embodiments, the processor 21 may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
Memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing a computer program 201, where the computer program, when loaded and executed by the processor 21, can implement the relevant steps of the log space automatic reclaiming method disclosed in any one of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202, data 203, and the like, where the storage manner may be transient storage or permanent storage. The operating system 202 may include Windows, unix, linux, among others. The data 203 may include, but is not limited to, data provided by a log space automatic reclamation method, and the like.
In some embodiments, the log space automatic reclaiming device may further comprise a display 22, an input/output interface 23, a communication interface 24, a power supply 25 and a communication bus 26.
Those skilled in the art will appreciate that the configuration shown in fig. 3 is not limiting of the log space automatic reclamation apparatus and may include more or fewer components than shown.
The log space automatic recovery device provided by the embodiment of the application comprises a memory and a processor, wherein when the processor executes a program stored in the memory, the processor can realize the following method: an automatic log space recovery method.
Finally, the present application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps as described in the method embodiments above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution contributing to the prior art, or in a software product stored in a storage medium, performing all or part of the steps of the methods of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The method, the system, the device and the medium for automatically recovering the log space are provided in the application. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. 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. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this specification, 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 an element.

Claims (10)

1. An automatic log space recycling method is characterized by comprising the following steps:
acquiring the utilization rate of log partition space of each host;
judging whether the utilization rate of the log partition space of each host reaches an alarm threshold value;
if the alarm threshold is reached, determining that the host generates log partition space alarm;
and clearing the log files under the log partition file directory of the host computer which generates the current alarm and reserving the log partition file directory.
2. The method of automatic log space reclamation according to claim 1, wherein the flushing the log files under the log partition file directory of the host generating the alert and reserving the log partition file directory comprises:
emptying the log file of log rotation dump according to the size of the log file;
after the log file of the log rotation dump is emptied, judging whether the host log partition space alarm is eliminated;
and if the host log partition space alarm is not eliminated, clearing other log files according to the size of the log files until the host log partition space alarm is eliminated.
3. The method of automatic log space reclamation according to claim 1, wherein the flushing the log files under the log partition file directory of the host generating the alert and reserving the log partition file directory comprises:
clearing the log file with the log file generation time longer than a first preset time;
judging whether the host log partition space alarm is eliminated;
and if the host log partition space alarm is not eliminated, clearing other log files with the log file generation time not longer than the first preset time according to the size of the log file until the host log partition space alarm is eliminated.
4. The method according to claim 1, wherein after the determining that the host generates the log partition space alarm, the step of emptying the log file under the log partition file directory of the host generating the alarm and retaining the log partition file directory further comprises:
judging whether the alarm duration of the host generating the alarm reaches a second preset time or not;
if yes, entering a step of clearing the log files under the log partition file directory of the host computer generating the alarm and reserving the log partition file directory.
5. The automatic log space recovery method according to any one of claims 1 to 4, wherein the alarm threshold value includes: a first alarm threshold and a second alarm threshold;
if the usage rate of the log partition space of the other hosts reaches the second alarm threshold value but does not reach the first alarm threshold value when the log files under the log partition file directory of the host which generates the alarm at present are emptied, continuing to execute the step of emptying the log files under the log partition file directory of the host which generates the alarm at present;
and if the utilization rate of the log partition spaces of the other hosts reaches the first alarm threshold, executing the clearing of the log files under the log partition file directory of the other hosts.
6. The method according to claim 5, wherein the steps of flushing the log file under the log partition file directory of the host computer that is currently generating the alarm and reserving the log partition file directory further comprise:
and saving operation record information for clearing the log file.
7. The method for automatically reclaiming log space according to claim 6, wherein the step of obtaining the usage rate of the log partition space of each host further comprises:
acquiring the resources of each host and managing the resources;
and providing a unified IP address to the outside, wherein the IP address is a login address of the virtualized management platform.
8. An automatic log space recovery system, comprising:
the acquisition module is used for acquiring the utilization rate of the log partition space of each host;
the judging module is used for judging whether the utilization rate of the log partition space of each host reaches an alarm threshold value;
the determining module is used for determining that the host generates log partition space alarm if the alarm threshold is reached;
and the clearing module is used for clearing the log files under the log partition file directory of the host computer which generates the current alarm and reserving the log partition file directory.
9. An automatic log space recycling device is characterized by comprising a memory for storing a computer program;
a processor for implementing the steps of the log space automatic reclaiming method according to any one of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the log space automatic reclaiming method according to any one of claims 1 to 7.
CN202310136063.9A 2023-02-16 2023-02-16 Automatic log space recovery method, system, device and medium Pending CN116069737A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310136063.9A CN116069737A (en) 2023-02-16 2023-02-16 Automatic log space recovery method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310136063.9A CN116069737A (en) 2023-02-16 2023-02-16 Automatic log space recovery method, system, device and medium

Publications (1)

Publication Number Publication Date
CN116069737A true CN116069737A (en) 2023-05-05

Family

ID=86172986

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310136063.9A Pending CN116069737A (en) 2023-02-16 2023-02-16 Automatic log space recovery method, system, device and medium

Country Status (1)

Country Link
CN (1) CN116069737A (en)

Similar Documents

Publication Publication Date Title
WO2020140634A1 (en) Storage space optimization method and device, computer apparatus, and storage medium
US20110093437A1 (en) Method and system for generating a space-efficient snapshot or snapclone of logical disks
CN114637475A (en) Distributed storage system control method and device and readable storage medium
CN110018989A (en) A kind of method and apparatus that snapshot compares
CN104408201A (en) Junk file cleaning method and device
CN111666266A (en) Data migration method and related equipment
CN115827162A (en) Method, device, medium and equipment for intelligently processing mirror image warehouse data
CN113805816A (en) Disk space management method, device, equipment and storage medium
CN105740098A (en) Determination method and system for stale data among backup data
CN116069737A (en) Automatic log space recovery method, system, device and medium
CN110543357B (en) Method, related device and system for managing application program object
CN114518848B (en) Method, device, equipment and medium for processing stored data
CN114995756A (en) Virtual disk space recovery method, device and medium
CN112269531B (en) Source roll capacity reduction method, device, equipment and medium
CN110941597A (en) Method and device for cleaning decompressed file, computing equipment and computer storage medium
CN114721876A (en) Data backup method, device and medium
CN112905541B (en) Mirror image warehouse garbage cleaning method and device
CN111597066A (en) SSD (solid State disk) repairing method and device, computer equipment and storage medium
CN108376104B (en) Node scheduling method and device and computer readable storage medium
CN111176571A (en) Method, device, equipment and medium for managing local object
CN114301927B (en) Main node selection method, device and medium in distributed system
CN113297003A (en) Method, electronic device and computer program product for managing backup data
CN110941591A (en) File deletion method, device and equipment and readable storage medium
CN115904264B (en) Garbage data recovery method, device and medium for blocks in storage system
JPH1165895A (en) System and method for managing logging file

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