CN113849135A - Log access method and device and server - Google Patents

Log access method and device and server Download PDF

Info

Publication number
CN113849135A
CN113849135A CN202111161921.2A CN202111161921A CN113849135A CN 113849135 A CN113849135 A CN 113849135A CN 202111161921 A CN202111161921 A CN 202111161921A CN 113849135 A CN113849135 A CN 113849135A
Authority
CN
China
Prior art keywords
server
usb storage
log data
storage device
log
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111161921.2A
Other languages
Chinese (zh)
Inventor
么爱利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202111161921.2A priority Critical patent/CN113849135A/en
Publication of CN113849135A publication Critical patent/CN113849135A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/0629Configuration or reconfiguration of storage systems
    • G06F3/0635Configuration or reconfiguration of storage systems by changing the path, e.g. traffic rerouting, path reconfiguration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

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)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a log access method, a log access device and a server, and relates to the technical field of server management, wherein the method comprises the following steps: if a starting instruction of the server is monitored, scanning whether the current server is hung with a USB storage device; if so, identifying the identifier of the USB storage equipment and configuring corresponding path information for the USB storage equipment; storing the corresponding relation between the identification of the USB storage device and the path information; acquiring log data generated in the running process of a server; storing the log data to a USB storage device; the log data stored in the USB storage device is pushed to the remote server according to the preset period, so that the remote server can access the log data, the log data can be synchronized to the USB storage device connected with the server, the out-of-band server can directly access the in-band log data through the USB storage device, the efficiency of accessing and collecting logs of the out-of-band server is improved, and the management overhead of the server is reduced.

Description

Log access method and device and server
Technical Field
The invention relates to the technical field of server management, in particular to a log access method, a log access device and a server.
Background
With the continuous increase of the demand of users for computer computing, the types of devices are more and more developed, and the function of the out-of-band BMC (Baseboard Management Controller) is more and more complex. The BMC is a special service processor, and is mainly intended to monitor normal operation of a server, manage the server, generate an out-of-band log, and the like, and the entire server log monitored by the BMC is very important information, and events of accessing the server log by the BMC are frequently generated.
Disclosure of Invention
In view of the above, the present invention provides a log access method, a log access device and a log access server, so as to alleviate the above technical problems.
In a first aspect, an embodiment of the present invention provides a log access method, which is applied to a server, where the server is connected with a USB storage device in a hanging manner, and the method includes: if a starting instruction of the server is monitored, scanning whether the USB storage equipment is hung on the server currently; if so, identifying the identifier of the USB storage equipment and configuring corresponding path information for the USB storage equipment; storing the corresponding relation between the identification of the USB storage equipment and the path information; acquiring log data generated in the running process of the server; storing the log data to the USB storage device; and pushing the log data stored in the USB storage equipment to a remote server according to a preset period so that the remote server accesses the log data.
Preferably, in a possible implementation, the USB storage device is connected to a baseboard management controller BMC of the server.
Preferably, in a possible implementation, the server is configured with at least one service; the method further comprises the following steps: configuring a log data storage path of the service as path information of the USB storage device, so that the log data generated by the service is stored to the USB storage device.
Preferably, in a possible implementation manner, the step of storing the log data to the USB storage device includes: acquiring a log data storage path configured by a service generating the log data; and if the log data storage path is a storage path pointing to the USB storage equipment, storing the log data to the USB storage equipment.
Preferably, in a possible implementation manner, the step of pushing the log data stored in the USB storage device to a remote server according to a preset period includes: scanning the USB storage device according to a preset period through the BMC to acquire the log data stored by the USB storage device; and pushing the log data scanned by the BMC to a remote server.
Preferably, in a possible embodiment, the method further comprises: after the log data stored in the USB storage device is pushed to a remote server according to a preset period, the pushed log data is deleted from the USB storage device, so that the memory occupied by the log data in the USB storage device is emptied.
In a second aspect, an embodiment of the present invention further provides a log access method, which is applied to a USB storage device, where the USB storage device is mounted on a server, and the method includes: receiving log data stored by the server, wherein the log data is generated by the server in the running process; and storing the log data into a disk of the USB storage device, so that the BMC of the server can conveniently push the log data stored in the disk of the USB storage device to a remote server according to a preset period, and the remote server can access the log data.
In a third aspect, an embodiment of the present invention further provides an apparatus for accessing a log, where the apparatus is applied to a server, and the server is connected to a USB storage device in a hanging manner, and the apparatus includes: the scanning module is used for scanning whether the USB storage equipment is hung on the current server or not if a starting instruction of the server is monitored; the configuration module is used for identifying the identifier of the USB storage equipment and configuring corresponding path information for the USB storage equipment if the identifier of the USB storage equipment is the identifier of the USB storage equipment; the storage module is used for storing the corresponding relation between the identifier of the USB storage device and the path information; the acquisition module is used for acquiring log data generated in the running process of the server; the storage module is used for storing the log data to the USB storage equipment; and the pushing module is used for pushing the log data stored in the USB storage equipment to a remote server according to a preset period so that the remote server can access the log data.
In a fourth aspect, an embodiment of the present invention further provides an apparatus for accessing a log, where the apparatus is applied to a USB storage device, and the USB storage device is mounted on a server, and the apparatus includes: the receiving module is used for receiving the log data stored by the server, wherein the log data is generated in the running process of the server; the storage module is configured to store the log data in a disk of the USB storage device, so that the BMC of the server pushes the log data stored in the disk of the USB storage device to a remote server according to a preset period, so that the remote server accesses the log data.
In a fifth aspect, an embodiment of the present invention further provides a server, where a baseboard management controller BMC of the server is connected to a USB storage device; wherein the server is configured to execute the method of the first aspect, and the USB storage device is configured to execute the method of the second aspect.
In a sixth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of the first and second aspects.
The embodiment of the invention has the following beneficial effects:
according to the log access method, the log access device and the log access server provided by the embodiment of the invention, whether the current server is provided with the USB storage equipment can be scanned when the starting instruction of the server is monitored, the identification of the USB storage equipment is identified when the USB storage equipment is provided, the corresponding path information is configured for the USB storage equipment, and then the corresponding relation between the identification of the USB storage equipment and the path information can be stored; acquiring log data generated in the running process of a server; the log data are stored in the USB storage device connected with the server in an articulated mode, and then the log data stored in the USB storage device are pushed to the remote server according to the preset period, so that the remote server can access the log data, the remote server is usually an out-of-band server, and the mode of synchronizing the log data to the USB storage device connected with the server can realize that the out-of-band server directly accesses the in-band log data through the USB storage device, so that the efficiency of accessing and collecting logs by the out-of-band server is improved, the management overhead of the server is reduced, and the method and the device are convenient to popularize and use.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a log access method according to an embodiment of the present invention;
fig. 2 is a schematic view of an application scenario of a USB storage device according to an embodiment of the present invention;
fig. 3 is a flowchart of another log access method according to an embodiment of the present invention;
FIG. 4 is a flowchart of another log accessing method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for accessing a log according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another log accessing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, direct access to the in-band log by the out-of-band BMC is difficult to implement, and therefore, transmission of log data is often implemented by means of a removable storage medium, which not only causes waste of labor cost, but also lowers log collection efficiency.
Based on this, the log access method, the log access device and the log access server provided by the embodiment of the invention can effectively alleviate the above problems and improve the log collection efficiency.
For the convenience of understanding the embodiment, a detailed description will be first given of an access method for a log disclosed in the embodiment of the present invention.
In a possible implementation manner, an embodiment of the present invention provides a log access method, and in particular, the method is applied to a server, where the server is attached with a USB storage device, and as shown in fig. 1, a flowchart of the log access method includes the following steps:
step S102, if a starting instruction of the server is monitored, whether the current server is hung with a USB storage device is scanned; if yes, executing step S104;
in this step, when the server is started, it can immediately scan whether the server is loaded with the USB storage device.
Step S104, identifying the identification of the USB storage device and configuring corresponding path information for the USB storage device;
the identifier of the USB storage device and the path information corresponding to the identifier can be used to implement a loading process of the USB storage device.
Step S106, storing the corresponding relation between the identification of the USB storage device and the path information;
for the server hung with the USB storage device, the USB storage device can be loaded and completed when the server is started, so that log data can be stored to the USB storage device in real time in the subsequent operation process of the server, and the log data stored in the USB storage device can be pushed to a remote server regularly.
Step S108, acquiring log data generated in the running process of the server;
in actual use, there are various services in the server, and when the server runs, these services will all generate corresponding log data, these log data are usually one or more log files automatically created and maintained by the server, including the list of the executed activities, etc., and these log data are usually generated by HOST board of the server, and can be placed in a preset memory, for example, in Linux server, these services can include various services, these services will store the logs generated by different applications in the disk of the server, etc., in the embodiment of the present invention, because the server is attached with USB (Universal Serial Bus) storage device, when accessing the log data, the logs generated by various services during the running process of the server can be obtained through the process of step S102, and then the process of steps S104 and S106 below is continued, and storing the log data into the USB storage device, thereby facilitating the remote server to access the log data.
Step S110, storing the log data into a USB storage device;
step S112, pushing the log data stored in the USB storage device to a remote server according to a preset period, so that the remote server accesses the log data.
In a specific implementation, the USB storage device generally has a certain storage space, and is used as a HOST motherboard provided to the server as a storage device, so that log data generated on the HOST motherboard in the server can be stored in the USB storage device, so as to facilitate access by a remote server.
According to the log access method provided by the embodiment of the invention, whether the current server is hung with the USB storage device or not can be scanned when the starting instruction of the server is monitored, the identification of the USB storage device is identified when the USB storage device is hung, the corresponding path information is configured for the USB storage device, and the corresponding relation between the identification of the USB storage device and the path information can be further stored; acquiring log data generated in the running process of a server; the log data are stored in the USB storage device connected with the server in an articulated mode, and then the log data stored in the USB storage device are pushed to the remote server according to the preset period, so that the remote server can access the log data, the remote server is usually an out-of-band server, and the mode of synchronizing the log data to the USB storage device connected with the server can realize that the out-of-band server directly accesses the in-band log data through the USB storage device, so that the efficiency of accessing and collecting logs by the out-of-band server is improved, the management overhead of the server is reduced, and the method and the device are convenient to popularize and use.
In practical use, the USB storage device is usually provided by a baseboard management controller BMC of a server, specifically, the USB storage device may be a storage device that is external to the BMC, or may be a storage device that is simulated only by a memory of the server, that is, the storage device is composed of a RAM, and the storage device may be specifically set according to an actual use situation, which is not limited in this embodiment of the present invention.
Further, the USB storage device usually has a certain storage space to store the log data; for ease of understanding, fig. 2 shows a schematic application scenario of a USB storage device, which includes a server and a remote server, where the remote server is usually referred to as an out-of-band log server, the remote server is connected to a network adapter of the server through a data center link to implement network connection with the server, and the server is also usually connected to a network through an ethernet technology to implement network communication.
As shown in fig. 2, two HOST _ CPUs on the HOST motherboard of the server are taken as an example for explanation, two HOST _ CPU chips are directly interconnected through an upi (ultra Path Interface) bus, one of the HOST _ CPU chips is connected to a PCH (Direct Media Interface) chip through a DMI (Direct Media Interface) Interface, the BMC of the server is connected to the PCH chip, the USB storage device in the embodiment of the present invention is connected to the BMC, specifically, the USB storage device may be directly connected to a USB Interface of the BMC through a USB bus or other matching interfaces, and the BMC is required to convert and map the USB storage device into a USB storage medium provided by the BMC, and then mount the USB storage medium on the HOST motherboard of the server.
In actual use, the BMC is also provided with a network adapter NIC, and the NIC can be connected to the Ethernet so as to realize communication between the server and an external remote controller.
Based on the application scenario shown in fig. 2, the server configured with the USB storage device in the embodiment of the present invention generally includes the following functional modules, so as to implement access to log data:
(1) a USB storage device: the USB storage device has a certain storage space, and is used as a storage device and provided for a host mainboard of a server;
(2) the server Host main board side is configured with a USB driver matched with the USB storage device and related log backup software: the USB driver identifies the USB storage equipment and maps the identified USB storage equipment into the server; the log backup software is used for storing the log data into the USB storage equipment;
(3) BMC of the server: the BMC accesses the log data in the USB storage device in the band and pushes the log data to the remote server.
In specific implementation, based on the application scenario shown in fig. 2, for the server to which the USB storage device is attached, the USB storage device may be loaded and completed when the server is started, so that log data may be stored in the USB storage device in real time during the operation process, and the log data stored in the USB storage device may be periodically pushed to a remote server.
Furthermore, for the USB storage device identified by the server, corresponding services may be further configured, generally, the services are application services in the server, and in the running process of the server, the services may generate log data, and after configuring the path of the USB storage device and the USB storage device for each service, when the service generates the log data, the log data may be stored in the USB storage device according to the corresponding path information, thereby implementing synchronization of the log data.
In actual use, at least one service is generally configured in the server; therefore, the log access method further includes: and configuring a log data storage path of the service as path information of the USB storage device so that the log data generated by the service is stored to the USB storage device.
In a specific implementation, the process of scanning whether the USB storage device is mounted in the server starting process is executed on the HOST board side of the server, after the server is started, the corresponding USB device is scanned and identified as the USB storage device, the corresponding USB storage device can be hung on a certain path in the server, and then the path information is generated, and different services in the server can select to store the generated log in the USB storage device.
Based on this, on the basis of fig. 1, fig. 3 also shows a flowchart of another log access method, which explains the process of synchronously storing and pushing log data, and specifically, as shown in fig. 3, includes the following steps:
step S302, acquiring log data generated in the running process of the server;
step S304, acquiring a log data storage path configured by the service generating the log data;
step S306, if the log data storage path is a storage path pointing to the USB storage device, storing the log data to the USB storage device;
in specific implementation, after the server is started and when the USB storage device is scanned, the identifier of the USB storage device may be identified and stored, and corresponding path information is configured for the USB storage device, so that after a log data storage path of a service is configured as the path information of the USB storage device, the server may perform associated storage on the identifier of the USB storage device, the path information, and the log data storage path of the service, so that after a certain service in the server generates log data, the log data storage path configured by the service that generates the log data may be acquired, and when the log data storage path is a storage path pointing to the USB storage device mounted by the server, the log data may be stored in the USB storage device.
Further, the log data is typically generated on the HOST board of the server, and may be stored in RAM, such as dmesg; the log data can also be stored in a disk of the host, such as a message of a Linux system, and in a Linux server, for various services, logs generated by different applications can be stored in the disk of the server first, and simultaneously, the log data is stored in the USB storage device, so that the BMC of the server can further access and push the logs stored in the USB storage device according to the following procedures.
Step S308, scanning the USB storage device according to a preset period through the BMC to acquire log data stored in the USB storage device;
step S310, the log data scanned by the BMC is pushed to a remote server.
Specifically, in step S310, when the log data is pushed, a polling type pushing method, an interrupt type pushing method, or pushing directly according to a certain period may be adopted, and the setting may be specifically performed according to an actual use situation, which is not limited in the embodiment of the present invention.
Further, for the log data stored in the USB storage device, after the BMC pushes the log data stored in the USB storage device to the remote server according to the preset period, the pushed log data may be deleted from the USB storage device to empty the memory occupied by the log data in the USB storage device, so that the USB storage device may continue to store the date-to-date data generated behind the server, thereby avoiding the log data that has been pushed and accessed earlier from continuing to occupy the storage space of the USB storage device, which is not only beneficial to reducing the storage cost of the log data, but also can save a certain management overhead.
Further, on the basis of the foregoing embodiment, an embodiment of the present invention further provides a log access method, where the method is applied to a USB storage device, specifically, the USB storage device is mounted on a server, and as shown in fig. 4, the method includes the following steps:
step S402, receiving log data stored by a server, wherein the log data is generated in the running process of the server;
step S404, storing the log data into the disk of the USB storage device, so that the BMC of the server pushes the log data stored in the disk of the USB storage device to the remote server according to a preset period, so that the remote server accesses the log data.
Specifically, the USB storage device is provided for a baseboard management controller BMC of the server, and the USB storage device is connected to a USB bus interface of a PCH of the server and has a certain storage space, for example, in an application scenario of the USB storage device shown in fig. 2, the USB storage device provided for the BMC is directly connected to the PCH through a USB bus, so that log data generated by a HOST board of the server can be stored in the USB storage device provided for the BMC. The BMC can also scan the USB storage device periodically and push log data to a remote server through the NIC, so that the remote server can access the log data.
Further, corresponding to the log access method shown in fig. 1 or fig. 3, an embodiment of the present invention further provides a log access apparatus, which is applied to a server, where the server is connected to a USB storage device, and specifically, as shown in fig. 5, the apparatus includes:
the scanning module 50 is used for scanning whether the current server is hung with the USB storage device or not if the starting instruction of the server is monitored;
a configuration module 51, configured to identify an identifier of the USB storage device and configure corresponding path information for the USB storage device if the identifier of the USB storage device is positive;
a saving module 52, configured to save a correspondence between an identifier of the USB storage device and the path information;
an obtaining module 53, configured to obtain log data generated in the server operation process;
a storage module 54, configured to store log data to a USB storage device;
the pushing module 55 is configured to push the log data stored in the USB storage device to the remote server according to a preset period, so that the remote server accesses the log data.
Further, the USB storage device is connected to a baseboard management controller BMC of the server.
Further, at least one service is configured in the server;
the configuration module is further used for configuring the log data storage path of the service into the path information of the USB storage device, so that the log data generated by the service is stored in the USB storage device.
Further, the storage module is specifically configured to:
acquiring a log data storage path configured by a service for generating log data;
and if the log data storage path is a storage path pointing to the USB storage device, storing the log data to the USB storage device.
Further, the pushing module is specifically configured to:
scanning the USB storage device according to a preset period through the BMC to acquire log data stored by the USB storage device;
and pushing the log data scanned by the BMC to a remote server.
Further, the apparatus further comprises:
and the deleting module is used for deleting the pushed log data from the USB storage equipment after the log data stored in the USB storage equipment is pushed to the remote server according to a preset period so as to empty the memory occupied by the log data in the USB storage equipment.
The log access device provided by the embodiment of the invention has the same technical characteristics as the log access method provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
Corresponding to the log access method shown in fig. 4, an embodiment of the present invention further provides another log access apparatus, which is applied to a USB storage device, where the USB storage device is mounted on a server, and as shown in fig. 6, the apparatus includes:
a receiving module 60, configured to receive log data stored by the server, where the log data is generated by the server in an operation process;
the saving module 62 is configured to store the log data in a disk of the USB storage device, so that the BMC of the server pushes the log data saved in the disk of the USB storage device to a remote server according to a preset period, so that the remote server accesses the log data.
The log access device provided by the embodiment of the invention has the same technical characteristics as the log access method and device provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
Further, the embodiment of the invention also provides a server, wherein a baseboard management controller BMC of the server is connected with a USB storage device; the server is used for executing the method shown in fig. 1 or fig. 3, and the USB storage device is used for executing the method shown in fig. 4, so as to enable the remote server to access the log data.
Further, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the log access method.
Further, an embodiment of the present invention further provides a schematic structural diagram of a server, as shown in fig. 7, which is the schematic structural diagram of the server, where the server includes a processor 71 and a memory 70, the memory 70 stores computer-executable instructions that can be executed by the processor 71, and the processor 71 executes the computer-executable instructions to implement the log access method.
In the embodiment shown in fig. 7, the server further comprises a bus 72 and a communication interface 73, wherein the processor 71, the communication interface 73 and the memory 70 are connected by the bus 72.
The Memory 70 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 73 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 72 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 72 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one type of bus.
The processor 71 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 71. The Processor 71 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and the processor 71 reads information in the memory and completes the log access method of the foregoing embodiment in combination with hardware thereof.
The log access method, apparatus and computer program product of the server provided in the embodiments of the present invention include a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the server and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood in specific cases for those skilled in the art.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that the following embodiments are merely illustrative of the present invention, and not restrictive, and the scope of the present invention is not limited thereto: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (11)

1. The log access method is applied to a server, the server is connected with a USB storage device in a hanging mode, and the method comprises the following steps:
if a starting instruction of the server is monitored, scanning whether the USB storage equipment is hung on the server currently;
if so, identifying the identifier of the USB storage equipment and configuring corresponding path information for the USB storage equipment;
storing the corresponding relation between the identification of the USB storage equipment and the path information;
acquiring log data generated in the running process of the server;
storing the log data to the USB storage device;
and pushing the log data stored in the USB storage equipment to a remote server according to a preset period so that the remote server accesses the log data.
2. The method of claim 1, wherein the USB storage device is connected to a Baseboard Management Controller (BMC) of the server.
3. The method of claim 1, wherein at least one service is configured in the server;
the method further comprises the following steps:
configuring a log data storage path of the service as path information of the USB storage device, so that the log data generated by the service is stored to the USB storage device.
4. The method of claim 3, wherein the step of storing the log data to the USB storage device comprises:
acquiring a log data storage path configured by a service generating the log data;
and if the log data storage path is a storage path pointing to the USB storage equipment, storing the log data to the USB storage equipment.
5. The method according to claim 2, wherein the step of pushing the log data stored in the USB storage device to a remote server according to a preset period comprises:
scanning the USB storage device according to a preset period through the BMC to acquire the log data stored by the USB storage device;
and pushing the log data scanned by the BMC to a remote server.
6. The method of claim 5, further comprising:
after the log data stored in the USB storage device is pushed to a remote server according to a preset period, the pushed log data is deleted from the USB storage device, so that the memory occupied by the log data in the USB storage device is emptied.
7. The log access method is applied to a USB storage device, wherein the USB storage device is mounted on a server, and the method comprises the following steps:
receiving log data stored by the server, wherein the log data is generated by the server in the running process;
and storing the log data into a disk of the USB storage device, so that the BMC of the server can conveniently push the log data stored in the disk of the USB storage device to a remote server according to a preset period, and the remote server can access the log data.
8. An apparatus for accessing a log, applied to a server, the server being attached with a USB storage device, the apparatus comprising:
the scanning module is used for scanning whether the USB storage equipment is hung on the current server or not if a starting instruction of the server is monitored;
the configuration module is used for identifying the identifier of the USB storage equipment and configuring corresponding path information for the USB storage equipment if the identifier of the USB storage equipment is the identifier of the USB storage equipment;
the storage module is used for storing the corresponding relation between the identifier of the USB storage device and the path information;
the acquisition module is used for acquiring log data generated in the running process of the server;
the storage module is used for storing the log data to the USB storage equipment;
and the pushing module is used for pushing the log data stored in the USB storage equipment to a remote server according to a preset period so that the remote server can access the log data.
9. An apparatus for accessing a log, the apparatus being applied to a USB storage device, the USB storage device being mounted on a server, the apparatus comprising:
the receiving module is used for receiving the log data stored by the server, wherein the log data is generated in the running process of the server;
the storage module is configured to store the log data in a disk of the USB storage device, so that the BMC of the server pushes the log data stored in the disk of the USB storage device to a remote server according to a preset period, so that the remote server accesses the log data.
10. A server is characterized in that a Baseboard Management Controller (BMC) of the server is connected with a USB storage device;
the server is used for executing the method of any one of claims 1 to 6, and the USB storage device is used for executing the method of claim 7.
11. A computer-readable storage medium having computer-executable instructions stored thereon which, when invoked and executed by a processor, cause the processor to implement the method of any of claims 1 to 7.
CN202111161921.2A 2021-09-30 2021-09-30 Log access method and device and server Pending CN113849135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111161921.2A CN113849135A (en) 2021-09-30 2021-09-30 Log access method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111161921.2A CN113849135A (en) 2021-09-30 2021-09-30 Log access method and device and server

Publications (1)

Publication Number Publication Date
CN113849135A true CN113849135A (en) 2021-12-28

Family

ID=78977509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111161921.2A Pending CN113849135A (en) 2021-09-30 2021-09-30 Log access method and device and server

Country Status (1)

Country Link
CN (1) CN113849135A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114598694A (en) * 2022-02-10 2022-06-07 宝德计算机***股份有限公司 File transmission method and BMC log collection system

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7203730B1 (en) * 2001-02-13 2007-04-10 Network Appliance, Inc. Method and apparatus for identifying storage devices
KR100766863B1 (en) * 2006-12-07 2007-11-15 주식회사 스펙트라 Software-installation system using movable data storage and method thereof
CN103955442A (en) * 2014-05-04 2014-07-30 飞天诚信科技股份有限公司 Working method of USB (Universal Serial Bus) equipment producing device
CN104536961A (en) * 2014-11-04 2015-04-22 深圳创维数字技术有限公司 Scanning method and scanning system for local media files
CN105100901A (en) * 2014-05-08 2015-11-25 Tcl集团股份有限公司 Virtual storage card configuration method and system
CN106873921A (en) * 2017-03-24 2017-06-20 努比亚技术有限公司 A kind of hanging method and device of multi partition external storage
CN107547943A (en) * 2016-06-23 2018-01-05 中兴通讯股份有限公司 A kind of journal file is derived automatically from method and set top box
CN108509317A (en) * 2018-03-29 2018-09-07 广州视源电子科技股份有限公司 Log file storing method, device, electronic device and storage medium
CN110008104A (en) * 2019-04-10 2019-07-12 苏州浪潮智能科技有限公司 A kind of management method of log information, system, equipment and storage medium
CN111176967A (en) * 2019-12-28 2020-05-19 北京浪潮数据技术有限公司 Query method and device for remote out-of-band SSD log information and BMC
CN111198830A (en) * 2019-11-22 2020-05-26 广州视源电子科技股份有限公司 Identification method and device of mobile storage equipment, electronic equipment and storage medium
CN112463516A (en) * 2020-10-23 2021-03-09 苏州浪潮智能科技有限公司 Method and system for collecting and verifying integrity of BMC log

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7203730B1 (en) * 2001-02-13 2007-04-10 Network Appliance, Inc. Method and apparatus for identifying storage devices
KR100766863B1 (en) * 2006-12-07 2007-11-15 주식회사 스펙트라 Software-installation system using movable data storage and method thereof
CN103955442A (en) * 2014-05-04 2014-07-30 飞天诚信科技股份有限公司 Working method of USB (Universal Serial Bus) equipment producing device
CN105100901A (en) * 2014-05-08 2015-11-25 Tcl集团股份有限公司 Virtual storage card configuration method and system
CN104536961A (en) * 2014-11-04 2015-04-22 深圳创维数字技术有限公司 Scanning method and scanning system for local media files
CN107547943A (en) * 2016-06-23 2018-01-05 中兴通讯股份有限公司 A kind of journal file is derived automatically from method and set top box
CN106873921A (en) * 2017-03-24 2017-06-20 努比亚技术有限公司 A kind of hanging method and device of multi partition external storage
CN108509317A (en) * 2018-03-29 2018-09-07 广州视源电子科技股份有限公司 Log file storing method, device, electronic device and storage medium
CN110008104A (en) * 2019-04-10 2019-07-12 苏州浪潮智能科技有限公司 A kind of management method of log information, system, equipment and storage medium
CN111198830A (en) * 2019-11-22 2020-05-26 广州视源电子科技股份有限公司 Identification method and device of mobile storage equipment, electronic equipment and storage medium
CN111176967A (en) * 2019-12-28 2020-05-19 北京浪潮数据技术有限公司 Query method and device for remote out-of-band SSD log information and BMC
CN112463516A (en) * 2020-10-23 2021-03-09 苏州浪潮智能科技有限公司 Method and system for collecting and verifying integrity of BMC log

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114598694A (en) * 2022-02-10 2022-06-07 宝德计算机***股份有限公司 File transmission method and BMC log collection system

Similar Documents

Publication Publication Date Title
CN110489391B (en) Data processing method and related equipment
CN108427705B (en) Electronic device, distributed system log query method and storage medium
CN104536875A (en) Automatic server restart testing method based on IPMI
CN213069791U (en) Fault detection system of vehicle-mounted information entertainment system
CN113115351A (en) Network exception processing method and device, terminal equipment and medium
CN115858221A (en) Management method and device of storage equipment, storage medium and electronic equipment
CN113849135A (en) Log access method and device and server
CN114528350A (en) Cluster split brain processing method, device and equipment and readable storage medium
CN112306871A (en) Data processing method, device, equipment and storage medium
CN113010122A (en) Image forming apparatus monitoring apparatus, method, system, and storage medium
CN115599311B (en) Polarity inversion method and apparatus, storage medium, and electronic apparatus
CN112732475A (en) Log collection method and device, electronic equipment and storage medium
CN115098342A (en) System log collection method, system, terminal and storage medium
CN107179911B (en) Method and equipment for restarting management engine
CN114860271A (en) PXE starting method, system and device and readable storage medium
CN115454896A (en) SMBUS-based SSD MCTP control message verification method and device, computer equipment and storage medium
CN113849440B (en) Log access method and device and server
CN111324374B (en) Application program registration method and device based on application performance management system
CN113297149A (en) Method and device for monitoring data processing request
CN111984473A (en) Memory snapshot data acquisition method and related device
CN114116544A (en) Method, device and equipment for acquiring slot information and storage medium
CN111949216A (en) Method, system, terminal and storage medium for automatically expanding storage volume of cloud platform
CN113645056B (en) Method and system for positioning fault of intelligent network card
CN116484373B (en) Abnormal process checking and killing method, system, device, computer equipment and storage medium
CN111327722B (en) Conflict detection method, system, terminal and storage medium for static IP and dynamic IP

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