CN112306744B - Log storage backup method, device, server and medium - Google Patents

Log storage backup method, device, server and medium Download PDF

Info

Publication number
CN112306744B
CN112306744B CN201910683252.1A CN201910683252A CN112306744B CN 112306744 B CN112306744 B CN 112306744B CN 201910683252 A CN201910683252 A CN 201910683252A CN 112306744 B CN112306744 B CN 112306744B
Authority
CN
China
Prior art keywords
log
nodes
level
node
grade
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
Application number
CN201910683252.1A
Other languages
Chinese (zh)
Other versions
CN112306744A (en
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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201910683252.1A priority Critical patent/CN112306744B/en
Publication of CN112306744A publication Critical patent/CN112306744A/en
Application granted granted Critical
Publication of CN112306744B publication Critical patent/CN112306744B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • 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)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a log storage backup method, a device, a server and a medium. Wherein the method comprises the following steps: if the log generating event is detected, determining a target log grade and a target function type of the new log; determining a target node associated with the new log according to the target log grade and the target function type of the new log and the log grade and the function type associated with the nodes in the cluster; the log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes; the new log is stored in the target node to which the new log is associated. According to the technical scheme, the newly generated log files are stored in the cluster nodes in a scattered mode according to the log grade and the function types, so that the space of the system disk occupied by the log is saved.

Description

Log storage backup method, device, server and medium
Technical Field
The embodiment of the invention relates to the technical field of log processing of cloud storage systems, in particular to a log storage backup method, a device, a server and a medium.
Background
The current universal cloud storage system is composed of several, even tens or hundreds of node devices, when the number of nodes of the cloud storage system is increased, the logs are multiplied, the current common implementation is that each node is managed by each node, each node only records the log of the node, the situation of repeated printing and repeated coverage exists, when the number of nodes of the system is increased, the logs are increased, the workload of log analysis is multiplied, and the system maintainer for log analysis is a catastrophic difficulty.
In order to facilitate searching, the prior art stores logs with different characteristics or logs of different objects in different files respectively. However, since each storage node in the prior art stores logs of all characteristics or objects, a large number of repeated logs are generated, a large amount of system space is occupied, and the phenomenon that the useful logs are flushed by other logs can occur.
Disclosure of Invention
The embodiment of the invention provides a log storage backup method, a device, a server and a medium, which are used for saving the storage space of a system and storing more useful log information.
In a first aspect, an embodiment of the present invention provides a log storage backup method, where the method includes:
if the log generating event is detected, determining a target log grade and a target function type of the new log;
determining a target node associated with the new log according to the target log grade and the target function type of the new log and the log grade and the function type associated with the nodes in the cluster; the log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes;
the new log is stored in the target node to which the new log is associated.
In a second aspect, an embodiment of the present invention provides a log storage backup apparatus, including:
the attribute determining module is used for determining the target log grade and the target function type of the new log if the log generating event is detected;
the target node determining module is used for determining a target node associated with the new log according to the target log grade and the target function type of the new log and the log grade and the function type associated with the nodes in the cluster; the log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes;
and the storage module is used for storing the new log in the target node associated with the new log.
In a third aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the log storage backup method of any of the first aspects.
In a fourth aspect, an embodiment of the present invention further provides a medium, on which a computer program is stored, where the program when executed by a processor implements the log storage backup method according to any of the first aspects.
The log storage backup method, the device, the server and the medium provided by the embodiment of the invention determine the target log grade and the target function type of the new log by detecting the log generation time, determine the target node associated with the new log by the log grade and the function type associated with the cluster nodes, and store the new log in the target node associated with the new log. According to the technical scheme, the newly generated log files are stored in the cluster nodes in a scattered mode according to the log grade and the function types, so that the fact that all nodes repeatedly store the same log is avoided, the space of a system disk occupied by the log is saved, and more useful log information can be stored.
Drawings
FIG. 1 is a flowchart of a log storage backup method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of node log level initialization according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a target log generating process according to an embodiment of the present invention;
FIG. 4 is a flowchart of another log storage backup method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a history log deletion provided in an embodiment of the present invention;
FIG. 6 is a flowchart of another log storage backup method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of log backup according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of backup node searching according to an embodiment of the present invention;
FIG. 9 is a block diagram illustrating a log storage backup device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the embodiments of the invention and are not limiting of the invention. It should be further noted that, for convenience of description, only some, but not all of the structures related to the embodiments of the present invention are shown in the drawings.
Fig. 1 is a flowchart of a log storage backup method according to an embodiment of the present invention, where the present embodiment is applicable to a case of performing storage backup on a log. Typically, the method is applicable to log storage backups in cloud storage systems, performed by management nodes in a cluster. The method can be executed by the log storage backup device provided by the embodiment of the invention, and the device can be realized by adopting a hardware and/or software mode. Referring to fig. 1, the method may specifically include:
step 110, if a log generation event is detected, determining a target log level and a target function type of the new log.
The log is key information for recording hardware, software and system problems in the system, and can monitor events occurring in the system. Users and maintenance personnel can check the cause of errors of the system through the log, or find traces left by an attacker when the system is attacked.
Log ratings typically include info, warning, error, critical aliquoting methods. Regardless of Linux, windows or all other systems, the system logs are classified and hierarchically recorded, different levels represent different problems, and a system administrator confirms the running condition and problem reasons of the system by looking at and analyzing the logs of each level.
Specifically, each node in the cluster includes a plurality of functional classes including, but not limited to, disks, arrays, logical resources, OSDs, MON, alarms, etc. Each generated log corresponds to a respective log class and function category, and when a log file generation event is detected, a target class and a target function category of the new log are first determined.
Step 120, determining the target node associated with the new log according to the target log level and the target function type of the new log and the log level and the function type associated with the nodes in the cluster.
The log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes.
Specifically, determining the log class and the function class associated with the node according to the number of cluster nodes, the number of log file classes and the number of function classes of the node includes: determining the log grade associated with the node according to the number of the cluster nodes and the number of the log file grades; and determining the function types associated with the nodes according to the function type number of the nodes and the log levels associated with the nodes.
The method for determining the log grade associated with the node according to the number of the cluster nodes and the number of the log file grades comprises the following steps: uniformly dividing a cluster node set with the number being the largest integer times of the number of the log file grades into each log file grade so as to obtain the log grade associated with the node; and distributing other nodes except the cluster node set to the log file level according to the importance degree of the log file level so as to obtain the log level associated with the other nodes.
In particular, the log levels may include a first level, a second level, a third level, and a fourth level from low to high in importance.
In this embodiment, all nodes have at least one role in four levels, and if the number of nodes is N, and if N is an integer multiple of the number of log levels, the four log levels are respectively and uniformly distributed to each node, that is, each node is associated with a level role correspondingly.
For example, if the number of the nodes is 8, and the number of the nodes is 2 times that of the log levels, the first level, the second level, the third level and the fourth level are respectively and evenly distributed to each node, at this time, each node is correspondingly associated with one log level, and each log level is respectively corresponding to two log nodes.
And if N is not the largest integer multiple of the number of the log levels, uniformly dividing the cluster nodes with the number being the largest integer multiple of the number of the log file levels into each log file level to obtain the log level associated with the node. And distributing other nodes except the cluster node set to the log file level according to the importance degree of the log file level so as to obtain the log level associated with the other nodes.
For example, if the number of the nodes is 9, 8 cluster nodes with the number being the largest integer multiple of the number of the log file grades are allocated to the log grades according to the above average division principle, and all the log grades are allocated to the remaining 1 node.
For example, when the number of log levels is four, if the number N of nodes is not an integer multiple of 4, the number of other nodes may be one, two or three. If the number of the other nodes is one, distributing all log levels to the other nodes; if the number of the other nodes is two, assigning the first grade and the second grade to one node, and assigning the third grade and the fourth grade to the other node; if the number of the other nodes is three, the first level and the second level are allocated to one node, the third level is allocated to one node, and the fourth level is allocated to the other node.
Initializing cluster nodes according to the obtained log levels associated with the nodes, specifically referring to fig. 2, judging whether the current node is endowed with the level for the first time, and endowing the current node with the log level according to the log level associated with the current node if the current node is not endowed with the level; if the log grade of the current node is already distributed, judging whether all the log grades have the nodes, if so, finishing the grade initialization of the nodes, if not, further checking which grade has no node at present, and giving the log grade to the corresponding node according to the log file grade associated with the node.
After determining the log file grade associated with the node, determining the function type associated with the node according to the function type number of the node and the log grade associated with the node so as to obtain a storage node of the new log.
Specifically, determining the function type associated with the node according to the function type number of the node and the log level associated with the node includes: generating log files of different function types of each log file level according to the function type number and the log file level number of the nodes; and allocating the log files of different function types of the log file level to the nodes associated with the log level to obtain the function types associated with the nodes.
Assigning log files of different functional categories of the log file hierarchy to nodes associated with the log hierarchy, comprising: and uniformly distributing the log files of different functional types of the log file grades to the nodes associated with the log file grades.
For example, assuming that the number of nodes of the log is 4, the number of functional categories of each node is 8, and the number of log classes is 4, each node corresponds to a different log class, and each log file class generates 8 log files of different functional categories. When the log files are distributed, the principle of level priority is adopted, the log files of different function types of the same level are distributed to the nodes associated with the log level, namely, the 8 log files of different function types generated by the first level are distributed to the nodes with the level role of the first level.
If the number of the nodes associated with the same log level is multiple, log files of different functional types generated by the same level are equally distributed to all the associated nodes, so that the scattered storage of the log files is realized, the log files of the same level are ensured to be stored on the nodes associated with the log file level, and the operation and maintenance personnel can conveniently search.
Referring to fig. 3, when it is detected that a log file of a certain function type is generated, it is first required to determine whether all log files of each level of the function have been generated, and if all log files have been generated, no log file of the function type is generated, and a log backup flow is entered; if not, continuously checking which level of the log of the function type is not generated, searching the node of the corresponding level, further judging whether the node of the corresponding level generates the log of the same level of the function, if not, generating the log file of the function, and if so, entering a log backup flow.
And 130, storing the new log in a target node associated with the new log.
Correspondingly, the generated new log is stored in the target node associated with the new log.
According to the technical scheme provided by the embodiment of the invention, the target log grade and the target function type of the new log are determined by detecting the log generation event, the target node associated with the new log is determined by the log grade and the function type associated with the nodes in the cluster, and the new log is stored in the target node associated with the new log. According to the technical scheme, the newly generated log files are stored in the cluster nodes in a scattered mode according to the log grade and the function types, so that the fact that all nodes repeatedly store the same log is avoided, the space of a system disk occupied by the log is saved, and more useful log information can be stored. And moreover, by means of carrying out scattered storage on the log files, the log writing flow impact of the system disk with all nodes under high pressure for a long time is avoided, the service life of the system disk is prolonged, and by carrying out classified storage on all the logs of each node, operation and maintenance personnel can find effective information in time, and the efficiency of positioning the problem is improved.
Fig. 4 is a flowchart of another log storage backup method according to an embodiment of the present invention, where based on the above embodiment, after step 120, the method further includes: determining whether to delete the log files stored on the target node according to the residual storage space of the target node associated with the new log; if the remaining storage space on the target node is smaller than the preset threshold value, determining the log file to be deleted in the target node and deleting the log file according to the grade of the log file stored on the target node and the storage time length of the log file. Referring to fig. 4, the method may specifically include:
step 210, if a log generation event is detected, determining a target log level and a target function type of the new log.
Step 220, determining a target node associated with the new log according to the target log level and the target function type of the new log and the log level and the function type associated with the nodes in the cluster;
the log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes.
Step 230, determining whether to delete the log file stored on the target node according to the remaining storage space of the target node associated with the new log.
In this embodiment, the storage space of the cluster node is limited, and when the remaining storage space of the node is insufficient, the log file stored on the node needs to be deleted, so as to provide the storage space for the newly generated log file.
Step 250, if the remaining storage space on the target node is smaller than the preset threshold, determining the log file to be deleted in the target node and deleting the log file according to the level of the log file stored on the target node and the storage duration of the log file.
Specifically, when the number of nodes is small, some nodes will store logs of multiple functional types or multiple levels, and when the log space utilization rate reaches or exceeds a certain proportion, the history logs of the lower level will be deleted from old to new, so as to make room for the logs of the higher level.
Referring to fig. 5, a specific history log deleting process firstly determines whether to delete a history log according to the remaining storage space of a target node, if the storage space of the target node does not exceed a storage threshold, a new log is generated, a log backup process is entered, and whether to generate a backup log is checked. If the storage space of the target node exceeds the storage threshold, checking whether other levels of logs exist on the target node, and if not, deleting the same level of logs with the longest storage duration; if so, judging whether the logs of other levels stored on the target node are lower than the current log level, if so, deleting a log file compression packet of the low level with the longest storage time; if not, continuously checking whether the same-level backup logs exist on the current node, and if so, deleting the same-level backup logs with the longest storage duration; if not, deleting the same-level log file compression package or the high-level backup log with the longest storage duration.
According to the grade and the storage time length of the log files stored on the target node, the log files with low grade and long storage time length of the log files are selected for deletion, so that the storage period of important log files with high grade can be ensured.
Step 250, storing the new log in the target node associated with the new log.
According to the technical scheme of the embodiment of the invention, the log files to be deleted in the target node are determined according to the residual space of the target adding point associated with the new log, the log file grade stored in the target node and the storage time of the log files, and the low-grade and long-storage-time history log is deleted, so that the storage period of the important log is ensured, the risk that the important log is covered by the non-important log is avoided, and the maintainer is ensured to be capable of acquiring effective information more quickly.
FIG. 6 is a flow chart of another log store backup provided by an embodiment of the present invention. The present embodiment further includes, based on the above embodiment, after step 250: and if the number of the backup logs of the target log file level is smaller than a backup log threshold value, generating a backup log of the new log. Referring to fig. 6, the method may specifically include the steps of:
step 310, if a log generation event is detected, determining a target log level and a target function type of the new log.
Step 320, determining a target node associated with the new log according to the target log level and the target function type of the new log and the log level and the function type associated with the nodes in the cluster.
Step 330, determining whether to delete the log file stored on the target node according to the remaining storage space of the target node associated with the new log.
And 340, if the remaining storage space on the target node is smaller than the preset threshold, determining the log file to be deleted in the target node and deleting the log file according to the level of the log file stored on the target node and the storage time of the log file.
Step 350, storing the new log in the target node associated with the new log.
And 360, if the number of backup logs of the target log file level is smaller than a backup log threshold value, generating a backup log of the new log.
The backup log threshold value is determined according to the number of cluster nodes, the number of log file grades and the number of functional types of the nodes.
The backup log threshold values of the logs of different levels are different according to the number of cluster nodes, the number of log files and the number of functional types of the nodes.
Specifically, determining the backup log threshold according to the number of cluster nodes, the number of log file grades and the number of functional types of the nodes includes:
if the number of the cluster nodes is smaller than the number of the log file grades, the log files of the first grade are not backed up, and the log files of the other grades are backed up one by one;
if the number of the cluster nodes is more than or equal to the number of the log file grades and less than or equal to the number of the function types of the nodes, backing up the log files of the fourth grade for two times, and backing up the log files of the other grades for one time;
and if the number of the cluster nodes is greater than or equal to the number of the functional types of the nodes, backing up one log file of the first level and one log file of the second level, and backing up two log files of the third level and one log file of the fourth level.
According to the number of backup copies of each level log file, a log backup process is started, and referring to fig. 7, after a new log is generated, whether to generate a backup file is firstly determined according to the level and the node number of the new log. If the number of the cluster nodes is smaller than the number of the log file grades, and the grade of the newly generated log is the first grade, no backup file is generated; if not, further judging whether the backup files need to be generated according to the number of backup logs which need to be generated according to the corresponding level logs, entering a backup node searching flow after the backup files are generated, and storing the generated backup files by using the searched backup nodes.
Specifically, a backup log node of the new log is selected from the nodes associated with the other log levels except the target log level.
With continued reference to fig. 8, fig. 8 is a flowchart of backup node searching according to an embodiment of the present invention. As shown in fig. 8, the backup node is preferentially stored in the node whose log space is empty, and if there is no node whose log space is empty, the backup file is stored in the node associated with another log level different from the target log level. More specifically, the node associated with the other log level with the largest remaining storage space can be selected to store the backup log, and if the storage space of the other log level is the same, the backup node is continuously selected according to the storage condition of the backup log on the other level. By storing the backup logs in other logs with different grades from the target log, when some nodes in the cluster nodes have problems, the log backup files on the deleted nodes can be found out on other nodes, so that the safety of the log files is ensured.
According to the technical scheme provided by the embodiment of the invention, the backup logs of the new logs are generated by judging the number of the backup logs of the target log file level and the size of the backup log threshold. And determining a backup log threshold according to the number of cluster nodes, the number of log file grades and the number of functional types of the nodes, and carrying out backup on a plurality of nodes on the important logs to ensure the safety of important log information and avoid losing the important information caused by downtime of a certain node.
Fig. 9 is a block diagram of a log storage backup device according to an embodiment of the present invention. As shown in fig. 9, the apparatus may include:
an attribute determining module 410, configured to determine a target log level and a target function type of the new log if the log generating event is detected;
the target node determining module 420 is configured to determine a target node associated with the new log according to a target log level and a target function type of the new log, and a log level and a function type associated with a node in the cluster; the log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes;
the storage module 430 is configured to store the new log in the target node associated with the new log.
According to the technical scheme provided by the embodiment of the invention, the target log grade and the target function type of the new log are determined by detecting the log generation time, the target node associated with the new log is determined by the log grade and the function type associated with the cluster nodes, and the new log is stored in the target node associated with the new log. According to the technical scheme, the newly generated log files are stored in the cluster nodes in a scattered mode according to the log grade and the function types, so that the fact that all nodes repeatedly store the same log is avoided, the space of a system disk occupied by the log is saved, and more useful log information can be stored.
On the basis of the above-described embodiment, the target node determining module 420 includes a log rank determining unit and a function category determining unit.
Wherein the log rank determining unit is used for: and determining the log grade associated with the node according to the number of the cluster nodes and the number of the log file grades.
The function type determining unit is used for: and determining the function types associated with the nodes according to the function type number of the nodes and the log levels associated with the nodes.
On the basis of the above embodiment, the log rank determination unit is specifically configured to: uniformly dividing a cluster node set with the number being the largest integer times of the number of the log file grades into each log file grade so as to obtain the log grade associated with the node;
and distributing other nodes except the cluster node set to the log file level according to the importance degree of the log file level so as to obtain the log level associated with the other nodes.
Wherein the log levels include a first level, a second level, a third level, and a fourth level from low to high in importance;
correspondingly, other nodes except the cluster node set are distributed to the log file level according to the importance degree of the log file level, and the method comprises the following steps:
if the number of the other nodes is one, distributing all log levels to the other nodes;
if the number of the other nodes is two, assigning the first grade and the second grade to one node, and assigning the third grade and the fourth grade to the other node;
if the number of the other nodes is three, the first level and the second level are allocated to one node, the third level is allocated to one node, and the fourth level is allocated to the other node.
The function type determining unit is specifically configured to: generating log files of different function types of each log file level according to the function type number and the log file level number of the nodes;
and allocating the log files of different function types of the log file level to the nodes associated with the log level to obtain the function types associated with the nodes.
On the basis of the above embodiment, the log storage backup apparatus further includes: and the log deletion judging module and the log deletion module are used for judging the log deletion.
The log deletion judging module is used for determining whether to delete the log files stored on the target node according to the residual storage space of the target node associated with the new log.
The log deleting module is used for: if the remaining storage space on the target node is smaller than the preset threshold value, determining the log file to be deleted in the target node and deleting the log file according to the grade of the log file stored on the target node and the storage time length of the log file.
On the basis of the above embodiment, the log storage backup device further includes a backup log generating module, configured to generate a backup log of the new log if the number of backup logs of the target log file level is smaller than a backup log threshold; the backup log threshold value is determined according to the number of cluster nodes, the number of log file grades and the number of functional types of the nodes.
The backup log generation module is also specifically configured to: if the number of the cluster nodes is smaller than the number of the log file grades, the log files of the first grade are not backed up, and the log files of the other grades are backed up one by one;
if the number of the cluster nodes is more than or equal to the number of the log file grades and less than or equal to the number of the function types of the nodes, backing up the log files of the fourth grade for two times, and backing up the log files of the other grades for one time;
and if the number of the cluster nodes is greater than or equal to the number of the functional types of the nodes, backing up one log file of the first level and one log file of the second level, and backing up two log files of the third level and one log file of the fourth level.
On the basis of the above embodiment, the log storage backup apparatus further includes a backup node selection module for selecting a backup log node of the new log from nodes associated with other log levels than the target log level.
The log storage backup device provided by the embodiment of the invention can execute the log storage backup method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 10 is a schematic structural diagram of a seed server provided by an embodiment of the present invention, and fig. 10 shows a block diagram of an exemplary server suitable for implementing an embodiment of the present invention. The server shown in fig. 10 is only an example, and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
As shown in FIG. 10, the server 12 is in the form of a general purpose computing device. The components of server 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Server 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by server 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The server 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 10, commonly referred to as a "hard disk drive"). Although not shown in fig. 10, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The server 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the server 12, and/or any devices (e.g., network card, modem, etc.) that enable the server 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the server 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, via a network adapter 20. As shown in fig. 10, the network adapter 20 communicates with the other modules of the server 12 via the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with server 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing a log storage backup method provided by an embodiment of the present invention.
Embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program (or computer-executable instructions) which, when executed by a processor, is configured to perform a log storage backup method comprising:
if the log generating event is detected, determining a target log grade and a target function type of the new log;
determining a target node associated with the new log according to the target log grade and the target function type of the new log and the log grade and the function type associated with the nodes in the cluster; the log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes;
the new log is stored in the target node to which the new log is associated.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the embodiments of the present invention have been described in connection with the above embodiments, the embodiments of the present invention are not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (11)

1. A log storage backup method performed by a management node in a cluster, the method comprising:
if the log generating event is detected, determining a target log grade and a target function type of the new log;
determining a target node associated with the new log according to the target log grade and the target function type of the new log and the log grade and the function type associated with the nodes in the cluster; the log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes;
storing the new log in a target node associated with the new log;
the determining the log grade and the function type associated with the node according to the number of the cluster nodes, the number of log file grades and the number of the function types of the node comprises the following steps:
determining the log grade associated with the node according to the number of the cluster nodes and the number of the log file grades;
and determining the function types associated with the nodes according to the function type number of the nodes and the log levels associated with the nodes.
2. The method of claim 1, wherein determining the log level with which the node is associated based on the number of cluster nodes and the number of log file levels comprises:
uniformly dividing a cluster node set with the number being the largest integer times of the number of the log file grades into each log file grade so as to obtain the log grade associated with the node;
and distributing other nodes except the cluster node set to the log file level according to the importance degree of the log file level so as to obtain the log level associated with the other nodes.
3. The method of claim 2, wherein the log levels include a first level, a second level, a third level, and a fourth level from low to high in importance;
correspondingly, other nodes except the cluster node set are distributed to the log file level according to the importance degree of the log file level, and the method comprises the following steps:
if the number of the other nodes is one, distributing all log levels to the other nodes;
if the number of the other nodes is two, assigning the first grade and the second grade to one node, and assigning the third grade and the fourth grade to the other node;
if the number of the other nodes is three, the first level and the second level are allocated to one node, the third level is allocated to one node, and the fourth level is allocated to the other node.
4. The method of claim 1, wherein determining the class of function associated with the node based on the number of classes of function of the node and the log level associated with the node comprises:
generating log files of different function types of each log file level according to the function type number and the log file level number of the nodes;
and allocating the log files of different function types of the log file level to the nodes associated with the log level to obtain the function types associated with the nodes.
5. The method according to any one of claims 1-4, wherein after determining the target node associated with the new log based on the target log level and the target function class of the new log and the log level and the function class associated with the nodes in the cluster, further comprising:
determining whether to delete the log files stored on the target node according to the residual storage space of the target node associated with the new log;
if the remaining storage space on the target node is smaller than the preset threshold value, determining the log file to be deleted in the target node and deleting the log file according to the grade of the log file stored on the target node and the storage time length of the log file.
6. The method of claim 1, further comprising, after storing the new log in the target node to which the new log is associated:
if the number of the backup logs of the target log level is smaller than a backup log threshold value, generating a backup log of a new log; the backup log threshold value is determined according to the number of cluster nodes, the number of log file grades and the number of functional types of the nodes.
7. The method of claim 6, wherein the log levels include a first level, a second level, a third level, and a fourth level from low to high in importance;
correspondingly, determining the backup log threshold according to the number of cluster nodes, the number of log file grades and the number of functional categories of the nodes comprises the following steps:
if the number of the cluster nodes is smaller than the number of the log file grades, the log files of the first grade are not backed up, and the log files of the other grades are backed up one by one; if the number of the cluster nodes is more than or equal to the number of the log file grades and less than or equal to the number of the function types of the nodes, backing up the log files of the fourth grade for two times, and backing up the log files of the other grades for one time;
and if the number of the cluster nodes is greater than or equal to the number of the functional types of the nodes, backing up one log file of the first level and one log file of the second level, and backing up two log files of the third level and one log file of the fourth level.
8. The method of claim 1, further comprising, after storing the new log in the target node to which the new log is associated:
from the nodes associated with the other log levels than the target log level, a backup log node of the new log is selected.
9. A log storage backup apparatus, the apparatus comprising:
the attribute determining module is used for determining the target log grade and the target function type of the new log if the log generating event is detected;
the target node determining module is used for determining a target node associated with the new log according to the target log grade and the target function type of the new log and the log grade and the function type associated with the nodes in the cluster; the log grade and the function type associated with the nodes are determined according to the number of cluster nodes, the number of log file grades and the number of the function types of the nodes;
the storage module is used for storing the new log in the target node associated with the new log;
the target node determining module comprises a log grade determining unit and a function type determining unit;
the log rank determining unit is used for: determining the log grade associated with the node according to the number of the cluster nodes and the number of the log file grades;
the function type determining unit is used for: and determining the function types associated with the nodes according to the function type number of the nodes and the log levels associated with the nodes.
10. A server, comprising:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the log storage backup method of any of claims 1-8.
11. A computer readable storage medium having stored thereon a computer program, wherein the program when executed by a processor implements a log storage backup method as claimed in any one of claims 1-8.
CN201910683252.1A 2019-07-26 2019-07-26 Log storage backup method, device, server and medium Active CN112306744B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910683252.1A CN112306744B (en) 2019-07-26 2019-07-26 Log storage backup method, device, server and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910683252.1A CN112306744B (en) 2019-07-26 2019-07-26 Log storage backup method, device, server and medium

Publications (2)

Publication Number Publication Date
CN112306744A CN112306744A (en) 2021-02-02
CN112306744B true CN112306744B (en) 2024-02-06

Family

ID=74329857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910683252.1A Active CN112306744B (en) 2019-07-26 2019-07-26 Log storage backup method, device, server and medium

Country Status (1)

Country Link
CN (1) CN112306744B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114579368B (en) * 2022-05-07 2022-08-02 武汉四通信息服务有限公司 Backup management method for continuous data protection, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743030B1 (en) * 2006-09-29 2010-06-22 Emc Corporation Methods and apparatus for declarative log collection
CN103645984A (en) * 2013-12-24 2014-03-19 山东中创软件工程股份有限公司 Method and device for optimizing logs
CN108846070A (en) * 2018-06-07 2018-11-20 北京京东尚科信息技术有限公司 Log processing method, system, electronic equipment and the storage medium of distributed system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2516872A (en) * 2013-08-02 2015-02-11 Ibm A method for a logging process in a data storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743030B1 (en) * 2006-09-29 2010-06-22 Emc Corporation Methods and apparatus for declarative log collection
CN103645984A (en) * 2013-12-24 2014-03-19 山东中创软件工程股份有限公司 Method and device for optimizing logs
CN108846070A (en) * 2018-06-07 2018-11-20 北京京东尚科信息技术有限公司 Log processing method, system, electronic equipment and the storage medium of distributed system

Also Published As

Publication number Publication date
CN112306744A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
US9274714B2 (en) Method and system for managing storage capacity in a storage network
US8676568B2 (en) Information processing apparatus and message extraction method
US8595564B2 (en) Artifact-based software failure detection
US11520649B2 (en) Storage mounting event failure prediction
US20160371021A1 (en) Secured Multi-Tenancy Data in Cloud-Based Storage Environments
US9514039B2 (en) Determining a metric considering unallocated virtual storage space and remaining physical storage space to use to determine whether to generate a low space alert
CN109039787B (en) Log processing method and device and big data cluster
US11372841B2 (en) Anomaly identification in log files
CN106777394B (en) Cluster file system
US10209905B2 (en) Reusing storage blocks of a file system
CN113126887A (en) Method, electronic device and computer program product for reconstructing a disk array
US20230123303A1 (en) Adjusting resources within a hyperconverged infrastructure system based on environmental information
CN112306744B (en) Log storage backup method, device, server and medium
US9213618B2 (en) Storage management systems and methods in hierarchical storage systems
US8195876B2 (en) Adaptation of contentious storage virtualization configurations
US9870400B2 (en) Managed runtime cache analysis
US10642903B2 (en) Tagging and querying system objects
US11635948B2 (en) Systems and methods for mapping software applications interdependencies
US10303401B2 (en) Data caching for block storage systems
CN110837428A (en) Storage device management method and device
US11262932B2 (en) Host-aware discovery and backup configuration for storage assets within a data protection environment
US9678854B2 (en) Application-centric analysis of leak suspect operations
CN114579357A (en) Servicing data storage devices in a data storage array
US11882004B1 (en) Method and system for adaptive health driven network slicing based data migration
US20240028237A1 (en) Method and system for health driven network slicing based data migration

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