Method and device for unloading core dump file
By obtaining and utilizing the IP address and rsync tool in the storage configuration file, the problem of cumbersome transmission of core dump files by low-level network servers in multi-level sub-intranets is solved, and file transfer and network expansion without user interaction are realized.
Patent Information
- Application Number
- CN202411141089.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-19
AI Technical Summary
In a multi-level subnet, the process of transmitting core dump files by low-level network servers is cumbersome and not easy to expand. Especially when the low-level network servers cannot access the external network, cumbersome network configuration and transfer server IP address settings are required.
By obtaining the destination IP address of the target server from the storage configuration file, it is determined whether network communication with the target server can be carried out. If not, a request message is broadcast to the upper layer of the network to obtain the IP address of the next hop server, and the core is transferred to the server through the rsync tool. The dump file and storage configuration file are forwarded to the next hop server for external transmission.
No user interaction is required, the maintenance process is simplified, it adapts to changing network hierarchies, and is easy to expand and maintain. The low-level network server can realize external transmission of core dump files without external network access capabilities.
Smart Images

Figure CN118869682A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to a method and device for transferring a core dump file. Background Art
[0002] When a core dump file is generated due to an abnormality in a program run by a baseboard management controller (BMC) of a sub-intranet, since the core dump file is large and the storage space of the BMC is limited, an external device is generally used to hang on the operating system run by the BMC, and then the generated core dump file is stored on the storage device. At present, there are many methods for collecting and analyzing core dump files when a core dump file appears on a server without the need for personnel to go to the site, such as remote access, core dump file configuration, automatic upload, etc. However, the above method is only applicable to the server where the core dump file currently appears, which has the ability to access the external network. When there are multiple layers of networks in the sub-intranet, the server in the low-level network needs to set the Internet Protocol (IP) address of the transit server adjacent to its network structure in advance, and the number of layers of networks requires the transmission configuration file of the server of each layer of the network to be set separately, and the IP address of the transit server of the next layer is specified. This configuration process is relatively cumbersome and not easy to expand. Summary of the invention
[0003] The present application provides a core dump file transfer method and device, which are used to solve the problem of complicated file transmission process of low-level network servers in multi-level sub-intranets in the prior art.
[0004] In a first aspect, an embodiment of the present application provides a method for transferring a core dump file, which is applied to a server, wherein the server is located in a multi-level sub-intranet, and the method includes:
[0005] When a core dump file exists, obtaining a destination IP address of a target server for storing the core dump file from a storage configuration file;
[0006] If it is determined based on the destination IP address that the server cannot communicate with the target server over the network, broadcast a request message to a server in an upper network layer, and determine the IP address of a next-hop server from a response message corresponding to the request message received; send the core dump file and the storage configuration file to the next-hop server based on the IP address of the next-hop server;
[0007] If it is determined based on the destination IP address that the server can perform network communication with the target server, the core dump file is sent to the target server based on the destination IP address.
[0008] Based on the above scheme, when a core dump file is generated, different transfer modes are selected according to whether it is possible to communicate with the target server to realize the external transmission of the core dump file. This method does not require user confirmation interaction, which is convenient for daily maintenance by maintenance personnel. In addition, when the network composed of the server group has a multi-layer structure and the low-level network server does not have the ability to access the external network, the low-level network server can obtain the IP address of the upper-level server device by means of a request message and forward the core dump file, thereby realizing the external transmission of the core dump file. This method does not need to configure the IP address of the upper-level network server for each server, can adapt to the changing network hierarchy, and is easy to expand and maintain.
[0009] In a possible implementation, whether the server can perform network communication with the target server is determined in the following manner:
[0010] Based on the destination IP address, sending a first message to the target server;
[0011] When receiving a second message returned by the target server based on the first message, determining that the server can perform network communication with the target server;
[0012] When the second message is not received within the set time period, it is determined that the server cannot perform network communication with the target server.
[0013] Based on the above scheme, the present application can determine whether it can communicate with the target server through the IP address in the configuration file, so as to determine whether the server transmits the core dump file to the target server or sends the core dump file to the next transit server by broadcasting a message.
[0014] In a possible implementation, the storage configuration file further includes a storage path of the core dump file in the server, and sending the core dump file includes:
[0015] Set the IP address of the specified server as the target transmission address of the remote synchronization rsync tool;
[0016] Sending the core dump file and the storage configuration file to the designated server through the rsync tool, so that the designated server saves the core dump file in the storage path;
[0017] The designated server is the next-hop server or the target server.
[0018] Based on the above solution, by configuring the storage path in the storage configuration file, multiple servers can use the same configuration file without having to configure the storage configuration file separately for each server, which is conducive to network expansion. In addition, low-level network servers can use the rsync tool to transfer files when they do not have access to the external network.
[0019] In a possible implementation manner, before sending the core dump file to the next-hop server, the method further includes:
[0020] Sending first verification information to the next-hop server through the rsync tool; the first verification information includes the identity information and password file of the rsync tool;
[0021] Receive a verification result corresponding to the first verification information, and determine that the verification result is identity authentication passed; wherein the verification result is sent by the rsync tool of the next-hop server after the rsync tool authenticates the rsync tool based on the first verification information.
[0022] Based on the above scheme, identity authentication is required before data transmission to ensure the security of transmission.
[0023] In a possible implementation, the existence of a core dump file is determined in the following manner:
[0024] Determine that a core dump file generated by a baseboard management controller exists in a specified path of the server; or,
[0025] The server receives the core dump file sent by the previous-hop server through the operating system of the baseboard management controller.
[0026] Based on the above scheme, the core dump file can be either a core dump file generated by the server itself or a core dump file received and sent by the previous hop server. By detecting whether there is a file under the specified path by the operating system, it can be determined whether the baseboard management controller of the server generates a core dump file. In this case, the server is the server that generates the core dump file. When the core dump file is sent by the previous hop server received by the server, the server is a transit server.
[0027] In a possible implementation, determining that a core dump file generated by a baseboard management controller exists in a specified path of the server includes:
[0028] The server monitors the file status under the specified path at a set time interval through the operating system of the baseboard management controller;
[0029] When it is determined that the file state is the target state, it is determined that the baseboard management controller stores the generated core dump file in the designated path.
[0030] Based on the above scheme, since the generation of core dump files is not controlled by the operating system, the operating system of the baseboard management controller is required to monitor the file status under the specified path so as to determine that the baseboard management controller has generated a core dump file when the file status changes due to changes in the file content.
[0031] In a second aspect, an embodiment of the present application provides a core dump file transfer device, comprising:
[0032] A first determining module, configured to obtain, when a core dump file exists, a destination IP address of a target server for storing the core dump file from a storage configuration file;
[0033] A second determination module is used for broadcasting a request message to a server of an upper layer network if it is determined based on the destination IP address that the server cannot perform network communication with the target server, and determining the IP address of a next-hop server from a response message corresponding to the request message received; and sending the core dump file and the storage configuration file to the next-hop server based on the IP address of the next-hop server;
[0034] If it is determined based on the destination IP address that the server can perform network communication with the target server, the core dump file is sent to the target server based on the destination IP address.
[0035] In a possible implementation manner, the second determining module is specifically configured to:
[0036] Determine whether the server can communicate with the target server through the following methods:
[0037] Based on the destination IP address, sending a first message to the target server;
[0038] When receiving a second message returned by the target server based on the first message, determining that the server can perform network communication with the target server;
[0039] When the second message is not received within the set time period, it is determined that the server cannot perform network communication with the target server.
[0040] In a third aspect, an embodiment of the present application provides an execution device, including:
[0041] A memory for storing program instructions;
[0042] The processor is used to obtain the program instructions in the memory and execute the method described in the first aspect and different implementation methods of the first aspect according to the obtained program instructions.
[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes computer instructions. When the computer instructions are executed by a computer, the method described in the first aspect and different implementation methods of the first aspect are implemented.
[0044] In addition, the technical effects brought about by any implementation method of the second to fourth aspects can refer to the technical effects brought about by the first aspect and different implementation methods of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0046] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0047] Figure 2 A schematic diagram of another application scenario provided for an embodiment of the present application;
[0048] Figure 3 A schematic diagram of a process for transferring a core dump file is provided for an embodiment of the present application;
[0049] Figure 4 A schematic diagram of a core dump transmission process provided in an embodiment of the present application;
[0050] Figure 5 A schematic diagram of the forwarding timing of a core dump file provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of a framework for transmission via rsync provided in an embodiment of the present application;
[0052] Figure 7 A schematic diagram of obtaining an IP address provided in an embodiment of the present application;
[0053] Figure 8 A schematic diagram of transmitting a core dump file through the rsync tool provided in an embodiment of the present application;
[0054] Fig. 9A schematic diagram of transferring core dump files in a multi-level sub-intranet provided in an embodiment of the present application;
[0055] Fig.10 A schematic diagram of a core dump file transfer device provided in an embodiment of the present application;
[0056] Fig.11 A schematic diagram of an execution device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0058] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0059] It should be noted that relational terms such as "first" and "second" are used only 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 "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0060] The Baseboard Management Controller (BMC) is a management controller located on the server motherboard. It is responsible for monitoring and managing the server's hardware and operating system. BMC provides a range of remote management functions, which can remotely access and control the server through the network without physical contact. BMC can perform core operations such as remote power control, remote console, hardware monitoring, remote diagnosis, and remote firmware update.
[0061] When a program running in the BMC of the sub-intranet generates a core dump file due to an abnormality, since the storage space of the BMC itself is very limited and the core dump file is large, an external storage device is generally used to mount it on the operating system running on the BMC to store the generated core dump file on the storage device. However, when a core dump is generated, the management and maintenance personnel need to enter the computer room where the server is located to manually extract the core dump file stored on the storage device. If several machines generate core dumps and the locations are too far apart, the additional workload of the management and maintenance personnel will increase significantly, which is not conducive to the management of large-scale servers. In addition, in the scenario of an overall computing resource composed of multiple servers, there is usually one server (data processing server) responsible for exchanging data with the outside world, and the remaining servers (data computing servers) form a sub-intranet with the data processing server and calculate the data. Therefore, the communication range of the data computing server is limited to the sub-intranet, and the core dump file generated by the abnormality of the BMC running program in the sub-intranet data computing server cannot be directly transmitted to the external terminal device. In addition, in a scenario of a multi-layer network structure consisting of a server cluster, servers in the lower-layer network cannot access the external network, and the number of transit servers in the middle-layer network is unknown. Therefore, the process of storing the core dump generated during the BMC operation of the server in the lower-layer network to the outside is relatively cumbersome.
[0062] There are currently many methods for collecting and analyzing core dump files without the need for on-site personnel when a core dump occurs on a server, such as remote access, core dump file configuration, and automatic upload. These methods all have the same problem, that is, they are only applicable to servers that currently have core dumps and have the ability to access the external network. When the network level is expanded, the above method in the two-level intranet scenario will have limitations. Servers in the lower-level network need to set the IP address of the transit server adjacent to their network structure in advance. In addition, the transmission configuration file of the server in each layer of the network needs to be set separately according to the number of layers of the network, and the IP address of the transit server in the next layer needs to be specified. This configuration process is relatively cumbersome and not easy to expand.
[0063] In view of the above problems, the embodiment of the present application provides a method for transferring a core dump file, which is applicable to a multi-level sub-intranet. When a core dump file exists, the destination IP address of the target server for storing the core dump file is obtained from the storage configuration file. Further, it is determined whether the server can perform network communication with the target server based on the destination IP address. When communication is not possible, a request message is broadcast to the server of the upper network, and the IP address of the next-hop server is determined from the received response message, and the core dump file and the storage configuration file are sent to the next-hop server based on the IP address of the next-hop server. When communication is possible, the core dump file is sent to the target server based on the destination IP address. In the present application, the external transmission of data in the sub-intranet does not require user intervention, which saves human resources. In addition, the present application obtains the IP address of the upper-layer server device by broadcasting a request message. The server only needs to give the IP address and storage path of the storage end and the storage path of the transfer end to complete the transmission of the core dump file, which is conducive to the maintenance and expansion of the network.
[0064] The following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0065] like Figure 1 As shown, Figure 1 The application scenario of the core dump file transfer method provided by the present application is exemplarily shown, including a server 100 and a target server 200. The server 100 is located in a multi-level sub-intranet, and the target server 200 is an external network server for storing core dump files.
[0066] In some scenarios, the server 100 may be a server in a multi-level sub-intranet that can exchange data with an external network, that is, a data processing server, such as Figure 1 shown.
[0067] When the server 100 determines that there is a core dump file, the target IP address of the target server 200 for storing the core dump file is obtained from the storage configuration file. Since the server 100 is a data processing server and can exchange data with the external network, when it is determined based on the target IP address that the server 100 can communicate with the target server 200, the core dump file can be directly sent to the target server 200 based on the target IP address.
[0068] In other scenarios, the server 100 may also be a data computing server whose communication range is limited to a sub-intranet and which does not have the ability to exchange data with the external network, such as Figure 2As shown. When the server 100 determines that there is a core dump file, the destination IP address of the target server 200 for storing the core dump file is obtained from the storage configuration file. Since the server 100 does not have the ability to access the external network, it is determined based on the destination IP address that the server 100 cannot communicate with the target server 200. The server then sends a broadcast request message to the upper-layer server adjacent to its network structure, and determines the IP address of the next-hop server based on the received response message, and then sends the core dump file and the storage configuration file to the next-hop server based on the IP address of the next-hop server, until the data processing server receives the core dump file and the storage configuration file, and sends the core dump file to the target server 200.
[0069] See also Figure 3 As shown, a method for transferring a core dump file provided by an embodiment of the present application can be performed by Figure 1 or Figure 2 The server 100 in the embodiment is executed, and the specific process is as follows:
[0070] Step S301, when a core dump file exists, obtaining a destination IP address of a target server for storing the core dump file from a storage configuration file.
[0071] In some embodiments, determining whether a core dump file exists in the server is performed in the following manner:
[0072] It is determined that a core dump file generated by a baseboard management controller exists under a designated path of the server; or, the server receives a core dump file sent by a previous-hop server through an operating system of the baseboard management controller.
[0073] Specifically, the existence of a core dump file generated by a baseboard management controller under a specified path of the server is determined in the following manner: the server monitors the file status under the specified path at a set time interval through the operating system of the baseboard management controller; when the file status is determined to be a target state, the baseboard management controller is determined to store the generated core dump file under the specified path. As an example, the target state can be a change in the folder content, or a file is created, or a change in the folder content is determined by other means, which is not specifically limited in this application.
[0074] In some embodiments, the core dump file in the server may be generated by the baseboard management controller of the server, that is, the core dump file generated by the server itself. In other embodiments, the core dump file may also be a core dump file sent by the previous hop server received by the operating system of the baseboard management controller, in which case the server acts as a transit server to forward the core dump file.
[0075] Step S302: If it is determined based on the destination IP address that the server cannot communicate with the target server over the network, a request message is broadcast to the server of the upper network layer, and the IP address of the next-hop server is determined from the response message corresponding to the received request message; a core dump file and a storage configuration file are sent to the next-hop server based on the IP address of the next-hop server.
[0076] In some embodiments, whether the server can communicate with the target server over the network is determined by:
[0077] Based on the destination IP address, a first message is sent to the target server. When a second message is received from the target server based on the first message, it is determined that the server can communicate with the target server over the network; when the second message is not received within a set time period, it is determined that the server cannot communicate with the target server over the network. In one possible implementation, the first message can be sent to the target server by executing a Ping command. It is understandable that other methods can also be used to determine whether the server can communicate with the target server over the network, and this application does not specifically limit this.
[0078] In some embodiments, when the server cannot communicate with the target server through the network, a request message is sent to the server of the upper layer network by broadcasting a message, and the IP address of the next hop server is determined based on the received response message, so that the IP address of the next hop server sends the core dump file and the storage configuration file to the next hop server. The request message can be a UDP datagram.
[0079] Step S303: If it is determined based on the destination IP address that the server can perform network communication with the target server, a core dump file is sent to the target server based on the destination IP address.
[0080] In some embodiments, the storage configuration file also includes a storage path of the core dump file in the server. When the server sends the core dump file, it is specifically implemented in the following manner:
[0081] Set the IP address of the designated server as the target transmission address of the remote synchronization rsync tool. Use the rsync tool to send the core dump file and storage configuration file to the designated server so that the designated server saves the core dump file in the storage path. The designated server is the next hop server or the target server.
[0082] In some embodiments, before sending the core dump file to the next-hop server, first verification information may be sent to the next-hop server through the rsync tool; the first verification information includes the identity information and password file of the rsync tool. Further, a verification result corresponding to the first verification information is received, and the verification result is determined to be identity authentication passed. The verification result is sent by the rsync tool of the next-hop server after the rsync tool authenticates the rsync tool based on the first verification information.
[0083] Based on the above scheme, when a core dump file is generated, different transfer modes are selected according to whether it is possible to communicate with the target server to realize the external transmission of the core dump file. This mode does not require user confirmation interaction, which is convenient for the daily maintenance of maintenance personnel. In addition, when the network composed of the server group has a multi-layer structure, when the low-level network server does not have the ability to access the external network, the low-level network server can obtain the IP address of the upper-level server device by means of a request message and forward the core dump file, thereby realizing the external transmission of the core dump file. This method does not need to configure the IP address of the upper-level network server for each server, can adapt to the variable network hierarchy, and is easy to expand and maintain.
[0084] In some embodiments, taking the server as a data computing server that generates a core dump file as an example, the forwarding process of the core dump file is as follows: Figure 4 As shown. Specifically, when the baseboard management controller BMC of the computing data server generates a core dump file during operation, the specific storage folder location of the core dump file can be specified. Further, the operating system of the BMC can monitor the folder through the command line tool inotify. After determining that the core dump file is stored in the folder, the file compression program gzip can be used to compress the file. Further, it can be determined whether network communication with the target server is possible. When it is determined that network communication with the target server is possible, the remote synchronization tool rsync is used to authenticate the rsync tool of the target server, and then the core dump file is forwarded to the target server. When it is determined that network communication with the target server is not possible, the IP address of the transit server (i.e., the next-hop server) is determined by broadcasting a UDP datagram, and then the remote synchronization tool rsync is used to authenticate the rsync tool of the transit server, and then the core dump file is forwarded to the transit server.
[0085] This application adopts the local file monitoring inotify+rsync tool to provide a simple, non-interactive core dump storage method for the server BMC running in the sub-intranet. On the one hand, it is conducive to the management of large-scale servers, and on the other hand, it provides a more convenient way to store and parse the core dump files generated in the sub-intranet. On this basis, the rsync core dump transmission method is expanded through UDP datagram broadcasting, which can adapt to the changing network hierarchy without specifying the destination transit IP address of each network level in advance.
[0086] In some embodiments, the target server is a server end storing the core dump file. For example, a multi-level sub-intranet includes a data computing server and a data processing server. When the data computing server generates a core dump file, the data computing server, as a client, sends the core dump file to the data processing server. The data processing server, as a transfer end, sends the core dump file to the target server, which is a server end. The forwarding process of the core dump file from the client end to the server end is as follows: Figure 5 As shown, the forwarding process is as follows:
[0087] S520: The data computing server sends a core dump file to the data processing server.
[0088] Specifically, when forwarding the core dump file, the rsync tool of the baseboard management controller of the data computing server sends the core dump file to the rsync tool of the data processing server.
[0089] In some embodiments, before sending the data to the data processing server, the following steps may also be included:
[0090] S511, the data computing server generates a core dump file, compresses the core dump file, and sends the core dump file to an rsync tool of the data computing server.
[0091] S512, the rsync tool sends the identity information to the rsync tool of the data processing server.
[0092] Specifically, the rsync tool authenticates the identity information to the daemon rsync of the data computing server through the password file, and the password file can only be accessed by the current user in a read-only manner.
[0093] S513, after the rsync tool of the data processing server authenticates the identity, it sends the authentication result to the rsync tool of the data computing server.
[0094] S514, the rsync tool of the data computing server determines that the verification is passed according to the verification result.
[0095] S540, the rsync tool of the data processing server transfers the core dump file to a specified path of the BMC of the data processing server.
[0096] In some embodiments, after receiving the core dump file, the rsync tool of the data processing server includes step S551: the rsync tool of the data processing server sends the transmission result to the rsync tool of the data computing server, so that the rsync tool of the data computing server sends the transmission result to the data computing server.
[0097] S560: The data processing server sends the core dump file to the target server.
[0098] Specifically, the data processing server sends the core dump file to the rsync tool of the target server through the rsync tool, so that the rsync tool of the target server stores the received core dump file in a designated path of the target server.
[0099] In some scenarios, before the data processing server sends the core dump file to the target server, the following steps may be included:
[0100] S552: The BMC of the data processing server detects that the core dump file has been transferred.
[0101] S553, sending the core dump file to the rsync tool.
[0102] S554, the rsync tool of the data processing server sends the identity information to the rsync tool of the target server.
[0103] Specifically, the data processing server needs to authenticate the rsync password file before transmission. When the data processing server's rsync receives the core dump file, it acts as the server of the data computing server. When the data processing server sends the core dump file to the target server, it acts as the client of the target server.
[0104] S555, the rsync tool of the target server performs identity authentication according to the identity information, and sends the authentication result to the rsync tool of the data processing server.
[0105] S556, the rsync tool of the data processing server determines that the verification is passed according to the verification result.
[0106] In some embodiments, after executing step S560, the following steps may also be included:
[0107] S571, the rsync tool of the target server transfers the core dump file to the specified path of the BMC of the target server.
[0108] S572, the rsync tool of the target server sends the transmission result to the rsync tool of the data processing server.
[0109] In some embodiments, see Figure 6 As shown, Figure 6 The intermediate transport layer (Intermediate transport layer) of the Transfer transfer end means that there are a total of N transfer end servers in the Transfer transfer end. The N transfer end servers are located in the N-layer network structure in the network, and the servers in each layer of the network can only access the servers in the adjacent network layer. Figure 6 PortX is the port number assigned by the system used by BMC, which is used to send UDP datagrams to servers at the upper layer of the network. PortX used by each server can be different. BMC receives UDP datagrams sent by servers at the lower layer of the network by listening to Port0. BMC receives UDP datagrams sent back by servers at the upper layer of the network by listening to Port1, which contains the network IP information of servers at the upper layer of the network. In addition, PortM is the port number assigned by the system used by BMC, which is used to send UDP datagrams to servers at the lower layer of the network. PortM used by each server can be different.
[0110] As an example, Figure 7 As shown, Server 1 broadcasts UDP datagrams to high-level servers in the network through Port6. When there are multiple servers in the high-level network of Server 1, only one server will listen to the port. Assuming that Server 2 listens to Port6 of Server 1, when multiple servers in the high-level network receive UDP datagrams broadcast by Server 1 through Port6 through Port0, only Server 2 will return the UDP datagram containing the IP address of Server 2 through Port3, so that Server 1 receives the UDP datagram returned by Server 2 through Port1, and then determines the IP address of Server 2, and then transfers the core dump file to Server 2.
[0111] As an example, the server transfers the core dump file through the rsync tool. The process is as follows Figure 8 As shown, the details are as follows:
[0112] S801, the server's BMC pings the IP address of the target server.
[0113] S802, determine whether the IP address of the target server is pinged successfully.
[0114] If the IP address of the target server cannot be pinged, execute step S803; otherwise, execute S806.
[0115] S803, the BMC sends a UDP datagram to the designated port by broadcasting.
[0116] S804, the designated port of the monitoring server is used to receive the datagram returned by the upper network server.
[0117] S805: Parse the IP address from the returned datagram.
[0118] S806, the rsync tool transfers the core dump file based on the IP address.
[0119] Specifically, when the IP address of the target server can be pinged, the IP address is the IP address of the target server; otherwise, the IP address is the IP address parsed from the datagram.
[0120] Further, the above steps may be repeated until the currently executing server can ping the IP address of the target server, and the IP address and storage path of the target server are filled into the rsync configuration to complete the storage of the core dump file.
[0121] In some embodiments, when there are multiple layers of networks in the sub-intranet, the number of transit ends exceeds one server, and the server serving as the transit end does not have the ability to access the external network except for the data processing server, then the server that generates the core dump file needs to send the core dump file to the transit server of the upper network layer, and then the transit server sends the core dump file to the server of the upper network layer, and transmits it upward layer by layer until the data processing server sends the received core dump file to the target server.
[0122] like Fig. 9 As shown, it is a flowchart of a method for transferring a core dump file applied to a multi-level sub-intranet provided in an embodiment of the present application, and the specific steps are as follows:
[0123] When the baseboard management controller of server 1 in the multi-level sub-intranet detects that the status of the folder is the target status through inotify, it is determined to generate a core dump file and compress the core dump file using gzip. Further, server 1 determines whether it can communicate with the target IP address of the target server for storing the core dump file in the storage configuration file. When it is determined that network communication is not possible, a UDP datagram is broadcast to the server in the adjacent high-level network. When the IP address of server 2 is determined based on the UDP datagram returned by server 2, the compressed core dump file and the storage configuration file are sent to the rsync of server 2 BMC based on the IP address of server 2 through the rsync tool, and stored in the specified path of server 2 BMC.
[0124] Further, when server 2 determines that it cannot communicate with the target server based on the target IP address in the storage configuration file, the server in the adjacent high-level network broadcasts the UDP datagram. Further, when the IP address of server 3 is determined based on the UDP datagram returned by server 3, the compressed core dump file and the storage configuration file are sent to the rsync of the BMC of server 3 through the rsync tool based on the IP address of server 3, and stored in the specified path of the BMC of server 3.
[0125] Repeat the above steps until the data processing server in the sub-intranet receives the core dump file and storage configuration file sent by the server in the adjacent low-level network. Since the data processing server has the ability to access the external network, the data processing server can communicate with the target server, and then send the core dump file to the target server based on the target IP address in the storage configuration file.
[0126] In some embodiments, the servers in the sub-intranet may respectively store the same storage configuration file, which includes the target IP address of the target server, the storage path in the target server, and the storage path of the transit server. At this time, during the transmission of the core dump file, only the core dump file needs to be transmitted between the servers at adjacent network levels. After receiving the core dump file, the target IP address is determined from the storage configuration file stored in itself. When it is determined that network communication with the target IP address is not possible, the IP address of the next-hop server is obtained, and the IP address of the next-hop server and the storage path of the transit server in the storage configuration file are actively sent to the rsync tool of the next-hop server through the rsync tool, so that the rsync tool of the next-hop server stores the core dump file in the storage path of the transit server.
[0127] Through the monitoring of inotify and rsync adopted by the application and the method of transferring files by verifying the identity through the password file, the core dump in the sub-intranet is forwarded and stored. The data computing server in the sub-intranet acts as the client of the transmission. The data computing server acts as the transfer station of the file, which is both the client and the server of the transmission. The multi-level network data transmission based on rsync is realized by broadcasting UDP datagrams. There is no need to specify the destination IP address of each level of transfer in advance. The rsync configuration files of each transfer end are the same, which can adapt to the changing network hierarchy and is easy to expand and maintain.
[0128] Based on the same technical concept, see Fig.10As shown, a core dump file transfer device 1000 provided in an embodiment of the present application can implement any step in the core dump file transfer method described above. To avoid repetition, it is not described here. The device 1000 includes a first determination module 1001 and a second determination module 1002.
[0129] The first determining module 1001 is used for obtaining a destination IP address of a target server for storing the core dump file from a storage configuration file when a core dump file exists;
[0130] The second determination module 1002 is used for broadcasting a request message to a server in an upper layer network if it is determined based on the destination IP address that the server cannot perform network communication with the target server, and determining the IP address of a next-hop server from a response message corresponding to the request message received; and sending the core dump file and the storage configuration file to the next-hop server based on the IP address of the next-hop server;
[0131] If it is determined based on the destination IP address that the server can perform network communication with the target server, the core dump file is sent to the target server based on the destination IP address.
[0132] In a possible implementation, the second determining module 1002 is specifically configured to:
[0133] Determine whether the server can communicate with the target server through the following methods:
[0134] Based on the destination IP address, sending a first message to the target server;
[0135] When receiving a second message returned by the target server based on the first message, determining that the server can perform network communication with the target server;
[0136] When the second message is not received within the set time period, it is determined that the server cannot perform network communication with the target server.
[0137] In some embodiments, the storage configuration file further includes a storage path of the core dump file in the server, and the second determination module 1002, when sending the core dump file, is specifically used to:
[0138] Set the IP address of the specified server as the target transmission address of the remote synchronization rsync tool;
[0139] Sending the core dump file and the storage configuration file to the designated server through the rsync tool, so that the designated server saves the core dump file in the storage path;
[0140] The designated server is the next-hop server or the target server.
[0141] In some embodiments, before sending the core dump file to the next-hop server, the second determining module 1002 is further configured to:
[0142] Sending first verification information to the next-hop server through the rsync tool; the first verification information includes the identity information and password file of the rsync tool;
[0143] Receive a verification result corresponding to the first verification information, and determine that the verification result is identity authentication passed; wherein the verification result is sent by the rsync tool of the next-hop server after the rsync tool authenticates the rsync tool based on the first verification information.
[0144] In some embodiments, the first determining module 1001 determines the existence of a core dump file by:
[0145] It is determined that a core dump file generated by a baseboard management controller exists under a designated path of the server; or, the server receives a core dump file sent by a previous-hop server through an operating system of the baseboard management controller.
[0146] In some embodiments, when determining that a core dump file generated by a baseboard management controller exists in a specified path of the server, the first determining module 1001 is specifically configured to:
[0147] The server monitors the file status under the specified path at a set time interval through the operating system of the baseboard management controller;
[0148] When it is determined that the file state is the target state, it is determined that the baseboard management controller stores the generated core dump file in the designated path.
[0149] Based on the same technical concept, the embodiment of the present application provides an execution device 1100, which can implement any step of the core dump file transfer method discussed above, please refer to Fig.11 The device includes a memory 1101 and a processor 1102 .
[0150] The memory 1101 is used to store program instructions;
[0151] The processor 1102 is used to call the program instructions stored in the memory and execute the core dump file transfer method according to the obtained program.
[0152] In the embodiment of the present application, the processor 1102 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0153] Memory 1101, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1101 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic storage, disk, optical disk, etc. Memory 1101 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1101 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0154] Based on the same technical concept, an embodiment of the present application provides a computer-readable storage medium, including computer program instructions, which, when executed on a computer, causes the computer to execute the core dump file transfer method discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the core dump file transfer method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0155] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0156] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0157] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0158] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0159] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for transferring a core dump file, characterized in that: Applied to a server, the server being located in a multi-level sub-intranet, the method comprises: When a core dump file exists, obtaining a destination IP address of a target server for storing the core dump file from a storage configuration file; If it is determined based on the destination IP address that the server cannot communicate with the target server over the network, broadcast a request message to a server in an upper network layer, and determine the IP address of a next-hop server from a response message corresponding to the request message received; send the core dump file and the storage configuration file to the next-hop server based on the IP address of the next-hop server; If it is determined based on the destination IP address that the server can perform network communication with the target server, the core dump file is sent to the target server based on the destination IP address.
2. The method according to claim 1, characterized in that Determine whether the server can communicate with the target server through the following methods: Based on the destination IP address, sending a first message to the target server; When receiving a second message returned by the target server based on the first message, determining that the server can perform network communication with the target server; When the second message is not received within the set time period, it is determined that the server cannot perform network communication with the target server.
3. The method according to claim 1, characterized in that The storage configuration file also includes a storage path of the core dump file in the server, and sending the core dump file includes: Set the IP address of the specified server as the target transmission address of the remote synchronization rsync tool; Sending the core dump file and the storage configuration file to the designated server through the rsync tool, so that the designated server saves the core dump file in the storage path; The designated server is the next-hop server or the target server.
4. The method according to claim 1, characterized in that Before sending the core dump file to the next-hop server, the method further includes: Sending first verification information to the next-hop server through the rsync tool; the first verification information includes the identity information and password file of the rsync tool; Receive a verification result corresponding to the first verification information, and determine that the verification result is identity authentication passed; wherein the verification result is sent by the rsync tool of the next-hop server after the rsync tool authenticates the rsync tool based on the first verification information.
5. The method according to claim 1, characterized in that Determine the existence of a core dump file by: Determine that a core dump file generated by a baseboard management controller exists in a specified path of the server; or, The server receives the core dump file sent by the previous-hop server through the operating system of the baseboard management controller.
6. The method according to claim 5, characterized in that The determining that a core dump file generated by a baseboard management controller exists in a designated path of the server includes: The server monitors the file status under the specified path at a set time interval through the operating system of the baseboard management controller; When it is determined that the file state is the target state, it is determined that the baseboard management controller stores the generated core dump file in the designated path.
7. A core dump file transfer device, characterized in that: include: A first determining module, configured to obtain, when a core dump file exists, a destination IP address of a target server for storing the core dump file from a storage configuration file; A second determination module is used to broadcast a request message to a server in an upper layer network if it is determined based on the destination IP address that the server cannot communicate with the target server through the network, and determine the IP address of the next hop server from a response message corresponding to the request message received; Sending the core dump file and the storage configuration file to the next-hop server based on the IP address of the next-hop server; If it is determined based on the destination IP address that the server can perform network communication with the target server, the core dump file is sent to the target server based on the destination IP address.
8. The device according to claim 7, characterized in that The second determining module is specifically used to: Determine whether the server can communicate with the target server through the following methods: Based on the destination IP address, sending a first message to the target server by executing a Ping command; When receiving a second message returned by the target server based on the first message, determining that the server can perform network communication with the target server; When the second message is not received within the set time period, it is determined that the server cannot perform network communication with the target server.
9. An execution device, characterized in that: include: A memory for storing program instructions; A processor, configured to obtain program instructions in the memory and execute the method according to any one of claims 1 to 6 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes computer instructions, and when the computer instructions are executed by a computer, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Distributed file management method and device
CN104408063A
Core dump file generation method, computing device and storage medium
CN113553211A
BMC (Baseboard Management Controller) fault diagnosis method and device, equipment and medium
CN116820932A
Protecting sensitive data in software products and in generating core dumps
US20150248564A1
Proxy forwarding method and device, proxy server and multi-level proxy network
WO2019061521A1
