1. Technical Field
Embodiments of the present disclosure relate to cloud computing technology, and more particularly to a log server and a log file storage method.
2. Description of related art
Input/output operations per second (IOPS) is a common performance measurement used to benchmark computer storage devices, such as hard disk drives (HDDs), solid state drives (SSDs), and storage area networks (SANs). In cloud computing (often simply referred to as a “cloud”), to ensure reliability of the “cloud,” IOPS tests are frequently performed on storage nodes (e.g., HDD, SSD, SAN) in the cloud. There may be a huge amount of storage nodes distributed in a dispersed manner in the cloud, so that a huge number of log files are generated from the IOPS tests. How to efficiently obtain and store the huge amount of log files is desired.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language. One or more software instructions in the modules may be embedded in firmware, such as in an erasable programmable read only memory (EPROM). The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
In one embodiment, the log server 10 includes a configuration file, which records configuration information of the hosts 20 and the storage nodes 30. The configuration information of each host 20 includes an identifier, an IP address, hardware resource configuration (e.g., CPU resource, memory resource, network bandwidth) of the host 20, and configuration information in relation to one or more storage nodes 30 which are connected to the host 20. The configuration information in relation to each storage nodes 30 includes an identifier, a location, a type, and a storage capacity of the storage node 30.
As shown in
When the system 100 sends a scan command of scanning the storage node 30 to the host 20, the log file probe of the host 20 retrieves the log file from the storage node 30, the host 20 transmits the identifier of the storage node 30 and the log file of the storage node 30 to the system 100. The system 100 receives the identifier and the log file, and checks if the storage device 200 has already stored a log file of the storage node 30 by searching the storage device according to the identifier. The system 100 then determines if the received log file is the same as the stored log file. If the received log file is identical to the stored log file, the system 100 abandons the received log file, so as to avoid the duplication of any storing operations. If the received log file is different from the stored log file, the system 100 determines that the received log file is an updated log file, and stores the received log file in the storage device 200.
As shown in
In step S10, the information reading module 110 reads configuration information of one or more hosts 20 from the configuration file stored in the storage device 200. As mentioned above, the configuration information of the one or more hosts 20 includes an identifier, an IP address, and hardware resource configuration (e.g., CPU resource, memory resource, network bandwidth) of each host 20.
In step S20, the command sending module 120 generates a scan command to scan the storage nodes 30, and sends the scan command to the one or more hosts 20. In this embodiment, the scan command includes an IP address of each of the one or more hosts 20, and the scan command is sent to each host 20 according to the IP address of the host 20. After receiving the scan command, the host 20 scans all storage nodes 30 of the host 20, obtains a log file from each storage node 30 of the host 20 using a log file probe installed in the host 20, and transmits an identifier of the storage node 30 and the log file to the log server 10.
In step S30, the data receiving module 130 receives the identifier and the log file of the storage node 30 sent by the host 20.
In step S40, the check module 140 searches one or more previously stored log files in relation to the storage node 30 according to the identifier of the storage node 30, and determines if the received log file is an updated log file of the storage node 30 based on the search result. As mentioned above, each log file stored in the storage device 200 has an association with an identifier of a storage node 30 in which the log file is generated, so that the check module 140 can search all log files in relation to the storage node 30 in the storage device 200 according to the identifier of the storage node 30.
In this embodiment, if the check module 140 determines no log file in relation to the storage node 30 has been previously stored in the storage device 200, the check module 140 determines that the received log file is an updated log file of the storage node 30. If one or more previously stored log files in relation to the storage node 30 have been searched in the storage device 200, the check module 140 compares the received log file with each searched log file, and determines if the content of the received log file is the same as content of any searched log file. If the content of the received log file is the same as the content of any searched log file, the check module 140 determines that the received log file is not an updated log file, and the storing module 150 abandons the receive log file, the procedure ends. Otherwise, if the content of the received log file is different from the content of any searched log file, the check module 140 determines that the received log file is an updated log file, and the procedure goes to step S50.
In step S50, the storing module 150 stores the received log file into the storage device 200.
Although certain disclosed embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2012103788703 | Oct 2012 | CN | national |