Audit log management method and device, equipment and storage medium

By managing audit logs according to client instructions and storage scenarios in the distributed storage system, the problem of poor usability of audit log management in the existing technology is solved, multi-scenario log management and efficient log collection are realized, and the reliability of the system is improved. performance and ease of use.

CN118672986APending Publication Date: 2024-09-20JINAN INSPUR DATA TECH CO LTD

Patent Information

Application Number
CN202410693058.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Each audit log management scenario of the existing storage system is independent, and mode switching requires manual execution of scripts. The usability is poor and it is difficult to meet the needs of flexible and efficient log management.

Method used

In the distributed storage system cluster, the function activation status is determined through the audit log instructions sent by the client, the access protocol type is determined based on the pre-deployed scenario, the preset dynamic library interface is called to load the corresponding scenario template file, and log information is collected and stored. , and dynamically adjust the collection cycle through parallel methods to achieve multi-scenario log management.

Benefits of technology

It realizes multi-scenario log management of distributed storage systems, improves the flexibility and timeliness of audit logs, simplifies the log management process, and enhances the reliability and ease of use of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118672986A
    Figure CN118672986A
Patent Text Reader

Abstract

The embodiment of the invention provides an audit log management method, device and equipment and a storage medium, which are applied to a main management node in a distributed storage system cluster and comprise the following steps: determining whether an audit log function is started or not according to an audit log instruction sent by a client; if yes, determining an access protocol type according to a pre-deployed scene in the audit log instruction; calling a preset dynamic library interface based on the access protocol type to load a scene template file corresponding to the access protocol type; and collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scene template file, recording the log information in a local log file, and storing the log information in a preset database. In the embodiment of the invention, through a distributed storage multi-scene log management scheme, whether an audit log function is started or not is determined according to requirements of clients on audit logs, and according to deployed storage scenes, corresponding audit log template files are managed through the scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of storage systems, and in particular to an audit log management method, device, equipment and storage medium. Background Art

[0002] Audit logs include protocol audit logs and service audit logs. Protocol audit logs mainly record the operation words of each protocol, and service audit logs mainly record the status changes of basic services when the cluster is running. Users can query audit logs to obtain audit and fault information, so as to handle faults in a timely manner to ensure the security and reliability of the storage system.

[0003] The current storage system's audit log management is independent of each other in various scenarios, and audit log mode switching requires manual script execution, which is difficult to use. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide an audit log management method, device, equipment and storage medium. The specific technical solution is as follows:

[0005] In a first aspect of the implementation of the present invention, an audit log management method is first provided, which is applied to a main management node in a distributed storage system cluster, and the method includes:

[0006] Determining whether the audit log function is enabled according to the audit log instruction sent by the client;

[0007] If so, determining the access protocol type based on the pre-deployed scenario in the audit log instruction;

[0008] Based on the access protocol type, a preset dynamic library interface is called to load a scene template file corresponding to the access protocol type;

[0009] The log information corresponding to each slave management node of the distributed storage system cluster is collected according to the scenario template file, the log information is recorded in a local log file, and the log information is stored in a preset database.

[0010] Optionally, calling a preset dynamic library interface based on the access protocol type to load a scene template file corresponding to the access protocol type includes:

[0011] Calling a public initialization interface to initialize logging based on the access protocol type;

[0012] The calling of the public initialization interface based on the access protocol type to initialize the log record includes: calling the public initialization interface based on the access protocol type to start the background thread, and, for the service process of the access protocol type, creating a log directory corresponding to the service process;

[0013] Generate an initial log file according to the initialized log prefix and time information, and store the initial log file in a log directory in the local log file;

[0014] Constructing a scenario template file according to the initial log file and the access protocol type;

[0015] The collecting of log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file includes:

[0016] Collecting log information corresponding to each slave management node of the distributed storage system cluster based on the scenario template file;

[0017] When the scenario template file is a file scenario template file, log information corresponding to each slave management node of the distributed storage system cluster is collected based on the file scenario template file;

[0018] When the scenario template file is an object scenario template file, collecting log information corresponding to each slave management node of the distributed storage system cluster based on the object scenario template file;

[0019] When the scenario template file is a fusion scenario template file, log information corresponding to each slave management node of the distributed storage system cluster is collected based on the fusion scenario template file.

[0020] Optionally, collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database includes:

[0021] Collect log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file;

[0022] Record the log information in a local log file;

[0023] When it is detected that each slave management node in the distributed storage system cluster starts the log management service, a preset database is created according to a preset time period;

[0024] When it is detected that the statistical analysis interface value is not a target value, collecting local log files corresponding to each of the slave management nodes from each of the slave management nodes in a parallel manner according to a first preset collection period;

[0025] When the statistical analysis interface value is detected to be a target value, dynamically adjusting the preset acquisition period to obtain a second preset acquisition period;

[0026] Collecting local log files corresponding to each slave management node from each slave management node according to the second preset collection period;

[0027] Parsing the local log file and storing it in the preset database, and updating the time information corresponding to each of the slave management nodes and access protocols in the preset database;

[0028] At the same time, a preset monitoring schedule process is started to monitor the time information corresponding to the slave management node and the access protocol.

[0029] Optionally, the determining the access protocol type according to the pre-deployed scenario in the audit log instruction includes:

[0030] The pre-deployed scene includes any one of a file scene, an object scene and a fusion scene;

[0031] When the pre-deployed scenario in the audit log instruction is a file scenario, the access protocol type is a file storage protocol and a public service;

[0032] When the pre-deployed scenario in the audit log instruction is an object scenario, the access protocol type is an object file storage protocol and a public service;

[0033] When the pre-deployed scenario in the audit log instruction is a fusion scenario, the access protocol type is a file storage protocol, object file storage, and public service.

[0034] Optionally, after the steps of collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database, the method includes:

[0035] The log information is remotely sent to the log server corresponding to the client through a remote interface.

[0036] Optionally, after the step of determining the access protocol type according to the pre-deployed scenario in the audit log instruction, the method includes:

[0037] Log parameter configuration is performed according to the pre-deployed scenarios in the audit log instruction so that the log information is displayed on a preset audit log configuration interface according to the log parameters. The audit log configuration interface includes a fusion scenario configuration interface, a file scenario configuration interface, and an object scenario configuration interface.

[0038] Optionally, after the step of determining the access protocol type according to the pre-deployed scenario in the audit log instruction, the method includes:

[0039] An audit log list is created according to the audit log instruction, wherein the audit log list includes a basic information field and an extended field, and the basic information field is maintained by a tag library field.

[0040] In a second aspect of the present invention, there is also provided an audit log management device, the device comprising:

[0041] A monitoring module, used to determine whether the audit log function is enabled according to the audit log instruction sent by the client;

[0042] a determination module, configured to, if yes, determine the access protocol type according to the pre-deployed scenario in the audit log instruction;

[0043] A loading module, used to call a preset dynamic library interface based on the access protocol type to load a scene template file corresponding to the access protocol type;

[0044] The storage module is used to collect the log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, record the log information in a local log file, and store the log information in a preset database.

[0045] Optionally, the loading module includes:

[0046] A first loading submodule, configured to call a common initialization interface to initialize logging based on the access protocol type;

[0047] Wherein, the first loading submodule includes:

[0048] A first recording unit is used to call a public initialization interface based on the access protocol type to start a background thread, and, for a service process of the access protocol type, create a log directory corresponding to the service process;

[0049] A second loading submodule is used to generate an initial log file according to the initialized log prefix and time information, and store the initial log file in a log directory in the local log file;

[0050] A third loading submodule is used to construct a scenario template file according to the initial log file and the access protocol type;

[0051] The storage module comprises:

[0052] A first storage submodule, configured to collect log information corresponding to each slave management node of a distributed storage system cluster based on the file scene template file when the scene template file is a file scene template file;

[0053] A second storage submodule, configured to collect log information corresponding to each slave management node of a distributed storage system cluster based on the object scene template file when the scene template file is an object scene template file;

[0054] The third storage submodule is used to collect log information corresponding to each slave management node of the distributed storage system cluster based on the fusion scene template file when the scene template file is a fusion scene template file.

[0055] Optionally, the storage module includes:

[0056] A fourth storage submodule, used to collect log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file;

[0057] A fifth storage submodule, used to record the log information in a local log file;

[0058] A sixth storage submodule, configured to create a preset database according to a preset time period when detecting that each slave management node in the distributed storage system cluster starts a log management service;

[0059] A seventh storage submodule is used for collecting local log files corresponding to each of the slave management nodes from each of the slave management nodes in a parallel manner according to a first preset collection period when it is detected that the statistical analysis interface value is a non-target value;

[0060] An eighth storage submodule is used to dynamically adjust the preset collection period to obtain a second preset collection period when it is detected that the statistical analysis interface value is the target value;

[0061] a ninth storage submodule, configured to collect local log files corresponding to each of the slave management nodes from each of the slave management nodes according to the second preset collection period;

[0062] a tenth storage submodule, configured to parse the local log file and store it in the preset database, and update the time information corresponding to each of the slave management nodes and access protocols in the preset database;

[0063] The eleventh storage submodule is used to simultaneously start a preset monitoring schedule process to monitor the time information corresponding to the slave management node and the access protocol.

[0064] Optionally, the determining module includes:

[0065] A first determination submodule, used for the pre-deployed scenario including any one of a file scenario, an object scenario and a fusion scenario;

[0066] A second determination submodule is used for, when the pre-deployed scenario in the audit log instruction is a file scenario, the access protocol type is a file storage protocol and a public service;

[0067] A third determination submodule is used for, when the pre-deployed scenario in the audit log instruction is an object scenario, the access protocol type is an object file storage protocol and a public service;

[0068] The fourth determination submodule is used to determine that when the pre-deployed scenario in the audit log instruction is a fusion scenario, the access protocol type is a file storage protocol, object file storage and public service.

[0069] Optionally, the device comprises:

[0070] The remote sending module is used to remotely send the log information to the log server corresponding to the client through a remote interface.

[0071] Optionally, the device comprises:

[0072] A configuration module is used to configure log parameters according to the pre-deployed scenarios in the audit log instructions, so that the log information is displayed on a preset audit log configuration interface according to the log parameters. The audit log configuration interface includes a fusion scenario configuration interface, a file scenario configuration interface, and an object scenario configuration interface.

[0073] Optionally, the device comprises:

[0074] The audit list module is used to create an audit log list according to the audit log instruction. The audit log list includes a basic information field and an extended field. The basic information field is maintained by a tag library field.

[0075] In a third aspect of the implementation of the present invention, there is also provided a communication device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor;

[0076] The processor is used to read the program in the memory to implement the audit log management method as described in any one of the first aspects.

[0077] In a fourth aspect of the implementation of the present invention, a computer-readable storage medium is further provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer implements the audit log management method as described in any one of the first aspects.

[0078] In a fourth aspect of the implementation of the present invention, a computer program product is also provided, including a computer program / instruction, which, when executed by a processor, implements the audit log management method as described in any one of the first aspects.

[0079] The audit log management method provided by the embodiment of the present invention is applied to the main management node in the distributed storage system cluster, and the method includes: determining whether the audit log function is enabled according to the audit log instruction sent by the client; if so, determining the access protocol type according to the pre-deployed scenario in the audit log instruction; calling the preset dynamic library interface based on the access protocol type to load the scenario template file corresponding to the access protocol type; collecting the log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, and recording the log information in the local log file, and storing the log information in the preset database. In the embodiment of the present invention, through a distributed storage multi-scenario log management solution, it is determined whether to enable the audit log function according to the customer's demand for the audit log, and according to the deployed storage scenario, the corresponding audit log template file is managed with the scenario. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0081] Figure 1 The steps of the audit log management method provided by the embodiment of the present invention are as follows: Figure 1 ;

[0082] Figure 2 The following is the process flow of the audit log management method provided by the embodiment of the present invention: Figure 2 ;

[0083] Figure 3 The following is the process flow of the audit log management method provided by the embodiment of the present invention: Figure 3 ;

[0084] Figure 4 The following is the process flow of the audit log management method provided by the embodiment of the present invention: Figure 4 ;

[0085] Figure 5 is a device block diagram of an audit log management device provided by an embodiment of the present invention;

[0086] Figure 6 is a schematic diagram of a communication device provided by an embodiment of the present invention;

[0087] Figure 7 is a schematic diagram of an exemplary audit log management system architecture provided by an embodiment of the present invention;

[0088] Figure 8 This is an exemplary audit log management method process provided by an embodiment of the present invention Figure 1 ;

[0089] Fig. 9 This is an exemplary audit log management method process provided by an embodiment of the present invention Figure 2 ;

[0090] Fig.10 is a schematic diagram of an exemplary audit log management interface provided by an embodiment of the present invention;

[0091] Fig.11 This is an exemplary audit log management method process provided by an embodiment of the present invention Figure 3 . DETAILED DESCRIPTION

[0092] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0093] It should be noted that in an embodiment of the present application, it may be a distributed storage multi-scenario audit log management system, which may be installed in a cluster, for example, a main management node in a distributed storage system cluster.

[0094] The distributed storage multi-scenario audit log management system includes the following four modules: protocol access module, log management module, log processing center module and statistical analysis module. The overall framework is as follows Figure 7 As shown,

[0095] The protocol access module is mainly responsible for completing the registration and access of the protocol; the log processing center module is mainly responsible for collecting and transferring the accessed protocols, including log recording, log storage and exporting to the customer's log server through the syslog interface; the log management module mainly includes log configuration, list display and download; the statistical analysis module is mainly responsible for performing statistics and analysis on the logs to ensure the reliable operation of the storage cluster.

[0096] Reference Figure 1 , showing the steps of the audit log management method provided by the embodiment of the present invention Figure 1, applied to a main management node in a distributed storage system cluster, the method may include:

[0097] Step 101, determining whether the audit log function is enabled according to the audit log instruction sent by the client;

[0098] It should be noted that in the embodiment of the present application, the audit log includes a protocol audit log and a service audit log. The protocol audit log mainly records the operation words of each protocol, and the service audit log mainly records the status changes of the basic services when the cluster is running. Users can query the audit log to achieve the purpose of obtaining audit and fault information, so as to handle faults in a timely manner to ensure the security and reliability of the storage system.

[0099] Therefore, after receiving the audit log instruction from the client, it is determined whether to enable the audit log function.

[0100] Step 102, if yes, determine the access protocol type according to the pre-deployed scenario in the audit log instruction;

[0101] If so, the access protocol type is determined based on the pre-deployed scenario in the audit log instruction.

[0102] Further, the determining the access protocol type according to the pre-deployed scenario in the audit log instruction includes:

[0103] The pre-deployed scene includes any one of a file scene, an object scene and a fusion scene;

[0104] When the pre-deployed scenario in the audit log instruction is a file scenario, the access protocol type is a file storage protocol and a public service;

[0105] When the pre-deployed scenario in the audit log instruction is an object scenario, the access protocol type is an object file storage protocol and a public service;

[0106] When the pre-deployed scenario in the audit log instruction is a fusion scenario, the access protocol type is a file storage protocol, object file storage, and public service.

[0107] It should be noted that in an embodiment of the present application, a distributed storage multi-scenario audit log management solution, wherein multiple scenarios are pre-deployed scenarios, including file scenarios, object scenarios, and fusion scenarios. In an embodiment of the present application, file storage (File Storage), object storage (Object Storage) and the fusion of the two (Hybrid Storage) can be supported simultaneously, which can meet the needs of different types of data storage and provide flexibility and scalability.

[0108] Step 103, calling a preset dynamic library interface based on the access protocol type to load a scene template file corresponding to the access protocol type;

[0109] Further, calling a preset dynamic library interface based on the access protocol type to load a scene template file corresponding to the access protocol type includes:

[0110] Calling a public initialization interface to initialize logging based on the access protocol type;

[0111] The calling of the public initialization interface based on the access protocol type to initialize the log record includes: calling the public initialization interface based on the access protocol type to start the background thread, and, for the service process of the access protocol type, creating a log directory corresponding to the service process;

[0112] Generate an initial log file according to the initialized log prefix and time information, and store the initial log file in a log directory in the local log file;

[0113] Constructing a scenario template file according to the initial log file and the access protocol type;

[0114] It should be noted that in the embodiment of the present application, a public initialization interface auditlog_init is provided for the protocol layer service to initialize log records; the initialization includes starting the background thread and creating corresponding log directories for service processes of different protocols, and the directories are named with the names of the protocols as identifiers.

[0115] Generates the initial log file based on the passed-in log prefix and time information, namely the log prefix and current time (whole hour). The format is "log type_time.log" and is stored in the local / var / log / icfs-audit / log type / directory, such as rgw_2024031611.log.

[0116] It should be noted that the present application may provide a log record template file for each scenario. For example, an exemplary format of an object scenario template file is: event_id:val|event_time:val|operation_type:val|operation_result:val|……

[0117] Step 104 , collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database.

[0118] For details, please refer to Figure 8 As shown, each protocol service starts the service process, obtains the configuration items set in the interface, and after receiving the client's operation request, determines whether the audit log is enabled. If enabled, loads the template file of the corresponding scenario, fills in each val value, assembles the relevant input parameters, and calls auditlog_write(char*op_info,bool is_syslog) to pass the operation information to the log recording module for local caching. The format of op_info is "key:val|key:val|key:val|...".

[0119] The collecting of log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file includes:

[0120] When the scenario template file is a file scenario template file, log information corresponding to each slave management node of the distributed storage system cluster is collected based on the file scenario template file;

[0121] When the scenario template file is an object scenario template file, collecting log information corresponding to each slave management node of the distributed storage system cluster based on the object scenario template file;

[0122] When the scenario template file is a fusion scenario template file, log information corresponding to each slave management node of the distributed storage system cluster is collected based on the fusion scenario template file.

[0123] It should be noted that, in the embodiment of the present application, after the scenario template file is determined, the log information corresponding to each slave management node of the distributed storage system cluster can be collected according to the format of the scenario template file.

[0124] The collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database includes:

[0125] Collect log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file;

[0126] Record the log information in a local log file;

[0127] When it is detected that each slave management node in the distributed storage system cluster starts the log management service, a preset database is created according to a preset time period;

[0128] When it is detected that the statistical analysis interface value is not a target value, collecting local log files corresponding to each of the slave management nodes from each of the slave management nodes in a parallel manner according to a first preset collection period;

[0129] When the statistical analysis interface value is detected to be a target value, dynamically adjusting the preset acquisition period to obtain a second preset acquisition period;

[0130] Collecting local log files corresponding to each slave management node from each slave management node according to the second preset collection period;

[0131] Parsing the local log file and storing it in the preset database, and updating the time information corresponding to each of the slave management nodes and access protocols in the preset database;

[0132] At the same time, a preset monitoring schedule process is started to monitor the time information corresponding to the slave management node and the access protocol.

[0133] It should be noted that, in the embodiment of the present application, each management node in the cluster starts a log management service, wherein the management node includes a master management node and a slave management node.

[0134] The log management service corresponding to the master management node is the master management service. The master management service creates a database on a daily basis and collects local logs from each node in the cluster in parallel. For example, the collection can be done every 10 minutes by default. For details, please refer to Fig. 9 shown.

[0135] At this time, if the statistical analysis interface is monitored to have a value, the data is parsed. The data format is (protocol name: weight; node: the name of the node reporting the protocol, and 1 / 3 of the number of nodes in the cluster size is taken). The collection period is dynamically adjusted according to 10*protocol weight*(1 / 3). The process collects the returned protocol logs of each node, parses them into the database first, and updates the time of the stored nodes and protocols. At the same time, the monitoring schedule process is started. When the time of other protocols and nodes in the same period is not updated, the corresponding protocol logs of these nodes are collected, parsed and stored.

[0136] If no value is detected in the statistical analysis interface, the local log files corresponding to the respective slave management nodes are directly collected from the respective slave management nodes in a parallel manner according to the first preset collection period.

[0137] In addition, it should be noted that the above statistical analysis interface is for the statistical analysis module. For the cluster, a separate statistical analysis process is started in the background.

[0138] Specifically, count the number of protocols and nodes every day, calculate the proportion of protocols, and take out the protocol with the highest proportion and weight as well as the nodes reported by the protocol. Take out 1 / 3 of the nodes in the cluster and encapsulate them into a specific format for log collection by the public module (mainly based on the audit log of the previous day to determine the main business type of the system, for example, the actual user business type, give priority to collecting the protocol log and improve the timeliness of log collection).

[0139] Count the number of operations and error code information of failed operations, classify them by error code, and query the error code maintenance module to obtain information such as the cause of the error code and handling suggestions, so as to provide an information basis for cluster maintenance and ensure the reliable operation of the cluster.

[0140] The audit log management method provided by the embodiment of the present invention is applied to the main management node in the distributed storage system cluster, and the method includes: determining whether the audit log function is enabled according to the audit log instruction sent by the client; if so, determining the access protocol type according to the pre-deployed scenario in the audit log instruction; calling the preset dynamic library interface based on the access protocol type to load the scenario template file corresponding to the access protocol type; collecting the log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, and recording the log information in the local log file, and storing the log information in the preset database. In the embodiment of the present invention, through a distributed storage multi-scenario log management solution, it is determined whether to enable the audit log function according to the customer's demand for the audit log, and according to the deployed storage scenario, the corresponding audit log template file is managed with the scenario.

[0141] In addition, in an embodiment of the present application, the log recording module of the log processing center adopts a statistical log recording template. When each protocol monitors the OP operation of the client, the template file is dynamically loaded and filled in to facilitate the expansion of the protocol; the log collection module dynamically adjusts the collection time according to the business situation to enhance the timeliness of the audit log.

[0142] Reference Figure 2 , showing the steps of the audit log management method provided by the embodiment of the present invention Figure 2 , applied to a main management node in a distributed storage system cluster, the method may include:

[0143] Step 201, determining whether the audit log function is enabled according to the audit log instruction sent by the client;

[0144] Step 202, if yes, determine the access protocol type according to the pre-deployed scenario in the audit log instruction;

[0145] Step 203: Based on the access protocol type, a preset dynamic library interface is called to load a scene template file corresponding to the access protocol type;

[0146] Step 204 , collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database.

[0147] Step 205: remotely send the log information to a log server corresponding to the client through a remote interface.

[0148] It should be noted that in the embodiment of the present application, the log processing center can export log information to the customer's log server through the remote syslog interface.

[0149] In an embodiment of the present invention, a distributed storage multi-scenario log management solution is used to determine whether to enable the audit log function based on the customer's demand for the audit log, and according to the deployed storage scenario, the corresponding audit log template file is managed based on the scenario.

[0150] Reference Figure 3 , showing the steps of the audit log management method provided by the embodiment of the present invention Figure 3 , applied to a main management node in a distributed storage system cluster, the method may include:

[0151] Step 301, determining whether the audit log function is enabled according to the audit log instruction sent by the client;

[0152] Step 302, if yes, determine the access protocol type according to the pre-deployed scenario in the audit log instruction;

[0153] Step 303, configuring log parameters according to the pre-deployed scenarios in the audit log instruction, so that the log information is displayed on a preset audit log configuration interface according to the log parameters, and the audit log configuration interface includes a fusion scenario configuration interface, a file scenario configuration interface, and an object scenario configuration interface;

[0154] It should be noted that, refer to Fig.10 It can be seen that the management interface of the interface management module includes audit log configuration function as well as log display and download.

[0155] The audit log function can be set dynamically. The audit log can be turned on and off in the cluster settings. When clicked on, it is divided into two modes: viewing mode and export mode, corresponding to the on, export and off parameters respectively. The Python script receives the parameter, sets the configuration file, writes the parameter to the switch_audit_log_check_model field of the config file, and synchronizes the configuration file to all nodes in the cluster. Then refresh the interface and load the header file. During the header file loading process, the switch_audit_log_check_model field value of the interface is obtained, and the auditFlag field is assigned a value, which is stored in the browser's localstorage. The audit log file set of each scene is mapped to the auditFlag to control the display of the relevant interface. The mapping relationship is to dynamically load the scene variable when the interface is displayed, and map the corresponding secondary subdirectory specific interface.

[0156] The file set is a directory named audit_file, including sub-directory files for each scenario. The second-level sub-directory is a specific interface. The second-level sub-directory includes audit log configuration, audit log list, and audit log syslog export configuration:

[0157] The audit log configuration can be configured according to the storage type deployed, and can include audit log configuration interfaces for three scenarios.

[0158] Specifically, the first type, the fusion scenario configuration interface includes the audit function switch, protocol type (CIFS protocol, NFS protocol, FTP protocol, kernel client, HDFS protocol, S3 protocol), operation type (create, delete, rename), maximum log record duration, and service status record switch;

[0159] The second type, the file scenario configuration interface includes the audit function switch, protocol type (CIFS protocol, NFS protocol, FTP protocol, kernel client), operation type (create, delete, rename), maximum log record duration, and service status record switch;

[0160] The third type, the object scenario configuration interface includes the audit function master switch, the maximum log record duration, and the bucket audit log configuration interface, including the bucket audit log switch and operation type (PUT, POST, DELETE).

[0161] In addition, the configuration of the audit log also includes the setting of the global configuration. During the audit log configuration process, a dynamic command setting interface is used in combination with a configuration file rollback mechanism. When a dynamic command fails to execute on all nodes, it can automatically roll back to the previous configuration state to ensure that the system will not be affected by incorrect configuration. In addition, by calculating the MD5 value of the configuration file and comparing it with the MD5 value of the backup file, it can ensure that the rollback operation is accurate and restored to a completely consistent configuration state.

[0162] Specifically, first back up the current configuration file, and then set the interface parameters to the global field of the configuration file, such as audit_op is set to the operation type, separated by |; audit_protocol is set to the configured protocol type, separated by |; audit_delete_delay_day is set to the maximum log record duration. Each protocol provides a corresponding dynamic command setting interface. After setting the configuration file, call the set protocol dynamic setting command to complete the configuration of the audit log. When the dynamic command fails to execute on all nodes, the configuration file settings are rolled back to restore the original configuration, and its MD5 value is calculated to see if it is the same as the MD5 value of the backup file to ensure the correctness of the rollback.

[0163] Step 304: Based on the access protocol type, a preset dynamic library interface is called to load a scene template file corresponding to the access protocol type;

[0164] Step 305 , collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database.

[0165] In an embodiment of the present invention, a distributed storage multi-scenario log management solution is used to determine whether to enable the audit log function based on the customer's demand for the audit log, and according to the deployed storage scenario, the corresponding audit log template file is managed based on the scenario.

[0166] In addition, in the embodiment of the present application, the audit log function can be dynamically set, and the audit log can be turned on and off in the cluster settings. The audit log configuration is configured according to the deployed storage type, and includes audit log configuration interfaces for four scenarios.

[0167] Reference Figure 4 , showing the steps of the audit log management method provided by the embodiment of the present invention Figure 3 , applied to a main management node in a distributed storage system cluster, the method may include:

[0168] Step 301, determining whether the audit log function is enabled according to the audit log instruction sent by the client;

[0169] Step 302, if yes, determine the access protocol type according to the pre-deployed scenario in the audit log instruction;

[0170] Step 303: Create an audit log list according to the audit log instruction, wherein the audit log list includes a basic information field and an extended field, and the basic information field is maintained by a tag library field;

[0171] It should be noted that the audit log list is created according to the audit log instruction, and the audit log list includes basic information fields and extended fields.

[0172] Among them, the extended fields are maintained by the tag library fields. This module provides a visual form to expand the fields. Enter the field name and field type to save. The background completes the dynamic loading of the extended fields of the audit log list entity class. Refer to Fig.11 As shown, it is mapped to the corresponding fields of the data table. At the same time, the corresponding field name is appended to the log record template of the public module, that is, (|field name: val) is appended after the log record template of the corresponding storage scenario. When the audit log list is queried, the column attribute of the table grid is bound to the background List list data. With the increase of background extension fields, the front-end list data dynamically loads the full field information of the audit log.

[0173] Step 304: Based on the access protocol type, a preset dynamic library interface is called to load a scene template file corresponding to the access protocol type;

[0174] Step 305 , collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database.

[0175] In an embodiment of the present invention, a distributed storage multi-scenario log management solution is used to determine whether to enable the audit log function based on the customer's demand for the audit log, and according to the deployed storage scenario, the corresponding audit log template file is managed based on the scenario.

[0176] In addition, in the embodiment of the present application, by initializing the basic attribute information of the audit log list and adding an attribute maintenance module, the field attributes of the audit log list are conveniently expanded.

[0177] Reference Figure 5 , shows a schematic diagram of the structure of an audit log management device provided by an embodiment of the present invention, which is applied to a storage control chip in an audit log management system, and the storage control chip is equipped with an on-chip cache pool. The device includes:

[0178] Monitoring module 501, used to determine whether the audit log function is enabled according to the audit log instruction sent by the client;

[0179] A determination module 502, for determining, if yes, the access protocol type according to the pre-deployed scenario in the audit log instruction;

[0180] A loading module 503, configured to call a preset dynamic library interface based on the access protocol type to load a scene template file corresponding to the access protocol type;

[0181] The storage module 504 is used to collect the log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, record the log information in a local log file, and store the log information in a preset database.

[0182] Optionally, the loading module includes:

[0183] A first loading submodule, configured to call a common initialization interface to initialize logging based on the access protocol type;

[0184] Wherein, the first loading submodule includes:

[0185] A first recording unit is used to call a public initialization interface based on the access protocol type to start a background thread, and, for a service process of the access protocol type, create a log directory corresponding to the service process;

[0186] A second loading submodule is used to generate an initial log file according to the initialized log prefix and time information, and store the initial log file in a log directory in the local log file;

[0187] A third loading submodule is used to construct a scenario template file according to the initial log file and the access protocol type;

[0188] The storage module comprises:

[0189] A first storage submodule, configured to collect log information corresponding to each slave management node of a distributed storage system cluster based on the file scene template file when the scene template file is a file scene template file;

[0190] A second storage submodule, configured to collect log information corresponding to each slave management node of a distributed storage system cluster based on the object scene template file when the scene template file is an object scene template file;

[0191] The third storage submodule is used to collect log information corresponding to each slave management node of the distributed storage system cluster based on the fusion scene template file when the scene template file is a fusion scene template file.

[0192] Optionally, the storage module includes:

[0193] A fourth storage submodule, used to collect log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file;

[0194] A fifth storage submodule, used to record the log information in a local log file;

[0195] A sixth storage submodule, configured to create a preset database according to a preset time period when detecting that each slave management node in the distributed storage system cluster starts a log management service;

[0196] A seventh storage submodule is used for collecting local log files corresponding to each of the slave management nodes from each of the slave management nodes in a parallel manner according to a first preset collection period when it is detected that the statistical analysis interface value is a non-target value;

[0197] An eighth storage submodule is used to dynamically adjust the preset collection period to obtain a second preset collection period when it is detected that the statistical analysis interface value is the target value;

[0198] a ninth storage submodule, configured to collect local log files corresponding to each of the slave management nodes from each of the slave management nodes according to the second preset collection period;

[0199] a tenth storage submodule, configured to parse the local log file and store it in the preset database, and update the time information corresponding to each of the slave management nodes and access protocols in the preset database;

[0200] The eleventh storage submodule is used to simultaneously start a preset monitoring schedule process to monitor the time information corresponding to the slave management node and the access protocol.

[0201] Optionally, the determining module includes:

[0202] A first determination submodule, used for the pre-deployed scenario including any one of a file scenario, an object scenario and a fusion scenario;

[0203] A second determination submodule is used for, when the pre-deployed scenario in the audit log instruction is a file scenario, the access protocol type is a file storage protocol and a public service;

[0204] A third determination submodule is used for, when the pre-deployed scenario in the audit log instruction is an object scenario, the access protocol type is an object file storage protocol and a public service;

[0205] The fourth determination submodule is used to determine that when the pre-deployed scenario in the audit log instruction is a fusion scenario, the access protocol type is a file storage protocol, object file storage and public service.

[0206] Optionally, the device comprises:

[0207] The remote sending module is used to remotely send the log information to the log server corresponding to the client through a remote interface.

[0208] Optionally, the device comprises:

[0209] A configuration module is used to configure log parameters according to the pre-deployed scenarios in the audit log instructions so that the log information is displayed on a preset audit log configuration interface according to the log parameters. The audit log configuration interface includes a fusion scenario configuration interface, a file scenario configuration interface, and an object scenario configuration interface.

[0210] Optionally, the device comprises:

[0211] The audit list module is used to create an audit log list according to the audit log instruction. The audit log list includes a basic information field and an extended field. The basic information field is maintained by a tag library field.

[0212] In an embodiment of the present invention, a distributed storage multi-scenario log management solution is used to determine whether to enable the audit log function based on the customer's demand for the audit log, and according to the deployed storage scenario, the corresponding audit log template file is managed based on the scenario.

[0213] The embodiment of the present invention also provides a communication device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0214] Memory 603, used for storing computer programs;

[0215] The processor 601, when used to execute the program stored in the memory 603, can implement the following steps:

[0216] Monitoring the target device according to a preset period according to a predefined device information table to obtain target monitoring data corresponding to the target device, wherein the predefined device information table is determined based on a device data acquisition channel and a device type;

[0217] The target monitoring data is stored in a preset database, and the target monitoring data corresponds to a target uniform resource locator path, so that the user terminal accesses the preset database through the target uniform resource locator path.

[0218] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits together, which are all well known in the art, so this article will not further describe them. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor can be transmitted on a wired medium or on a wireless medium through an antenna. Further, the antenna also receives data and transmits the data to the processor. The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory can be used to store data used by the processor when performing operations.

[0219] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0220] The communication interface is used for communication between the above terminal and other devices.

[0221] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0222] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0223] In another embodiment provided by the present invention, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the audit log management method described in any one of the above embodiments.

[0224] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the audit log management method described in any one of the above embodiments.

[0225] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0226] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0227] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0228] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. An audit log management method, characterized in that: Applied to a main management node in a distributed storage system cluster, the method comprises: Determining whether the audit log function is enabled according to the audit log instruction sent by the client; If so, determining the access protocol type based on the pre-deployed scenario in the audit log instruction; Based on the access protocol type, a preset dynamic library interface is called to load a scene template file corresponding to the access protocol type; The log information corresponding to each slave management node of the distributed storage system cluster is collected according to the scenario template file, the log information is recorded in a local log file, and the log information is stored in a preset database.

2. The method according to claim 1, characterized in that The calling of a preset dynamic library interface based on the access protocol type to load a scene template file corresponding to the access protocol type includes: Calling a public initialization interface to initialize logging based on the access protocol type; The calling of the public initialization interface based on the access protocol type to initialize the log record includes: calling the public initialization interface based on the access protocol type to start the background thread, and, for the service process of the access protocol type, creating a log directory corresponding to the service process; Generate an initial log file according to the initialized log prefix and time information, and store the initial log file in a log directory in the local log file; Constructing a scenario template file according to the initial log file and the access protocol type; The collecting of log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file includes: When the scenario template file is a file scenario template file, log information corresponding to each slave management node of the distributed storage system cluster is collected based on the file scenario template file; When the scenario template file is an object scenario template file, collecting log information corresponding to each slave management node of the distributed storage system cluster based on the object scenario template file; When the scenario template file is a fusion scenario template file, log information corresponding to each slave management node of the distributed storage system cluster is collected based on the fusion scenario template file.

3. The method according to claim 1, characterized in that The collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database includes: Collect log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file; Record the log information in a local log file; When it is detected that each slave management node in the distributed storage system cluster starts the log management service, a preset database is created according to a preset time period; When it is detected that the statistical analysis interface value is not a target value, collecting local log files corresponding to each of the slave management nodes from each of the slave management nodes in a parallel manner according to a first preset collection period; When the statistical analysis interface value is detected to be a target value, dynamically adjusting the preset acquisition period to obtain a second preset acquisition period; Collecting local log files corresponding to each slave management node from each slave management node according to the second preset collection period; Parsing the local log file and storing it in the preset database, and updating the time information corresponding to each of the slave management nodes and access protocols in the preset database; At the same time, a preset monitoring schedule process is started to monitor the time information corresponding to the slave management node and the access protocol.

4. The method according to claim 1, characterized in that: The determining the access protocol type according to the pre-deployed scenario in the audit log instruction includes: The pre-deployed scene includes any one of a file scene, an object scene and a fusion scene; When the pre-deployed scenario in the audit log instruction is a file scenario, the access protocol type is a file storage protocol and a public service; When the pre-deployed scenario in the audit log instruction is an object scenario, the access protocol type is an object file storage protocol and a public service; When the pre-deployed scenario in the audit log instruction is a fusion scenario, the access protocol type is a file storage protocol, object file storage, and public service.

5. The method according to claim 1, characterized in that After the steps of collecting log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, recording the log information in a local log file, and storing the log information in a preset database, the method includes: The log information is remotely sent to the log server corresponding to the client through a remote interface.

6. The method according to claim 1, characterized in that After the step of determining the access protocol type according to the pre-deployed scenario in the audit log instruction, the method includes: Log parameter configuration is performed according to the pre-deployed scenarios in the audit log instruction so that the log information is displayed on a preset audit log configuration interface according to the log parameters. The audit log configuration interface includes a fusion scenario configuration interface, a file scenario configuration interface, and an object scenario configuration interface.

7. The method according to claim 1, characterized in that After the step of determining the access protocol type according to the pre-deployed scenario in the audit log instruction, the method includes: An audit log list is created according to the audit log instruction, wherein the audit log list includes a basic information field and an extended field, and the basic information field is maintained by a tag library field.

8. An audit log management device, characterized in that: The device comprises: A monitoring module, used to determine whether the audit log function is enabled according to the audit log instruction sent by the client; a determination module, configured to, if yes, determine the access protocol type according to the pre-deployed scenario in the audit log instruction; A loading module, used to call a preset dynamic library interface based on the access protocol type to load a scene template file corresponding to the access protocol type; The storage module is used to collect the log information corresponding to each slave management node of the distributed storage system cluster according to the scenario template file, record the log information in a local log file, and store the log information in a preset database.

9. A communication device, characterized in that: include: A transceiver, a memory, a processor, and a program stored on the memory and executable on the processor; The processor is used to read the program in the memory to implement the audit log management method as described in any one of claims 1-7.

10. A readable storage medium for storing a program, characterized in that: When the program is executed by the processor, the audit log management method as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and system for log damp and audit

    CN101453378A

  • An audit log processing method of a database and a related device

    CN109325044A

  • Information auditing method, system and device and computer readable storage medium

    CN111026609A

  • Log collection system deployment method, device and equipment and storage medium

    CN111475390A

  • Auditing log obtaining method and device, computer equipment and storage medium

    CN112395157A

Cited By

  • Audit log control system and method of real-time operating system

    CN122247843A