Automatic installation source switching method, device and equipment and storage medium
An automatic switching and installation source technology, applied to electrical components, transmission systems, etc., can solve problems such as slowing down the installation speed of the operating system and high bandwidth occupation of the PXE server network
Inactive Publication Date: 2020-07-14
SUZHOU LANGCHAO INTELLIGENT TECH CO LTD
0 Cites 0 Cited by
AI-Extracted Technical Summary
Problems solved by technology
[0002] PXE (Preboot eXecution Environment, pre-boot execution environment) is a pre-boot execution environment provided by using a network interface; specifically, the server can automatically install the operating system through the host side of the PXE, usually using a host as the PXE server, multiple slave servers are connected to the PX...
Method used
If the network bandwidth that the PXE server is occupied by the slave server is higher than the expected network bandwidth, then the NFS server can be allocated for the purpose slave server, so that the purpose slave server can obtain the installation source from the NFS server allocated for it , the kernel is loaded on the PXE server, so that the network bandwidth ...
Abstract
The invention discloses an automatic installation source switching method, device and equipment and a storage medium. The method comprises the steps: receiving a system installation request transmitted by a slave server of any to-be-installed operating system, and determining the slave server of the any to-be-installed operating system as a target slave server; judging whether the total number ofslave servers currently performing operating system installation on the PXE server is greater than a corresponding number threshold value or not; if so, allocating a corresponding NFS server to the target slave server; if not, determining that the PXE server directly provides the installation source required for realizing the installation of the operating system for the target slave server, and indicating the target slave server to obtain the installation source required for realizing the installation of the operating system from the NFS server allocated to the target slave server. According to the method disclosed in the invention, the network bandwidth occupation of the PXE server can be reduced, the installation speed and efficiency of the operating system are improved, and the successof installing the operating system by the slave server is ensured.
Application Domain
Transmission
Technology Topic
Server allocationEngineering +1
Image
Examples
- Experimental program(1)
Example Embodiment
[0033] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
[0034] See figure 1 , Which shows a flowchart of a method for automatically switching installation sources according to an embodiment of the present invention, which may specifically include:
[0035] S11: Receive a system installation request sent by any slave server of the operating system to be installed, and determine that any slave server of the operating system to be installed is the destination slave server.
[0036] The execution subject of the installation source automatic switching method provided by the embodiment of the present invention may be the corresponding installation source automatic switching device, and the installation source automatic switching device may be set in the PXE server, so the execution subject of the installation source automatic switching method It can be a PXE server. The following is a specific description with the PXE server as the execution subject of the installation source automatic switching method.
[0037] PXE server is a host with PXE. The PXE server can provide NFS server distribution service (IP address distribution service), kernel loading and network installation source (can be referred to as installation source for short). The installation source can include PXE boot files and automation Install the configuration file, so that the slave server can install the operating system based on the installation source (the implementation principle of the operating system installation based on the installation source is the same as the implementation principle of the corresponding technical solution in the prior art, and will not be described here too much) ; Specifically, the PXE server can provide kernel loading through TFTP and installation source through NFS. In addition, such as figure 2 As shown, the PXE server, NFS server, and slave server in the embodiment of the present application can be connected through a network switch, and the PXE server, NFS server, and slave server are located in the same local area network; among them, the NFS server serves as a distributed storage node, The number can be multiple (greater than 1), the number of slave servers can also be multiple, and figure 2 Take the number of NFS server and slave server as an example; and, the NFS server is different from the PXE server in that it only opens the NFS service to provide the installation source. Since the installation source is large and the kernel is small, the slave server will occupy a relatively high network bandwidth when obtaining the installation source from the PXE server, while loading the kernel requires only a very low network bandwidth. Based on this, in this embodiment, The kernel can be loaded directly from the PXE server, and the installation source can be obtained by using distributed storage nodes to reduce the network bandwidth occupied by a single node of the PXE server.
[0038] When the slave server needs to install the operating system, it can send a system installation request to the PXE server to obtain the required kernel and installation source from the PXE server. Correspondingly, the PXE server can determine the current system installation request after receiving the system installation request. The slave server corresponding to the received system installation request is the target slave server that needs to be processed currently.
[0039] S12: Determine whether the total number of slave servers currently undergoing operating system installation on the PXE server is greater than the corresponding number threshold, if yes, execute step S13, if not, execute step S14.
[0040] Among them, the slave server that is currently installing the operating system on the PXE server is the server that is currently obtaining the installation source from the PXE server; and the number threshold can be set according to actual needs. Generally, if the slave server is required to occupy PXE The lower the network bandwidth of the server, the lower the number threshold is set; if the total number of slave servers currently undergoing operating system installation on the PXE server is greater than the number threshold, it means that the network bandwidth occupied by the slave servers by the PXE server is higher than The expected network bandwidth, that is, the network bandwidth occupied by the slave server is too high. Therefore, in order to share the network bandwidth pressure of the PXE server, you can indicate the server that currently needs to obtain the installation source but has not yet begun to obtain the installation source from the PXE server ( (The destination slave server) obtains the installation source from the NFS server. Otherwise, it means that the network bandwidth occupied by the PXE server by the slave server is not higher than the expected network bandwidth. Therefore, there is no need to share the network bandwidth pressure of the PXE server. Just get the installation source. In addition, when you need to assign an NFS server to a slave server, you only need to assign an NFS server to it.
[0041] S13: Assign a corresponding NFS server to the destination slave server, and instruct the destination slave server to obtain the installation source required to implement the operating system installation from the NFS server allocated to the destination slave server.
[0042] If the network bandwidth occupied by the PXE server by the slave server is higher than the expected network bandwidth, the NFS server can be allocated to the destination slave server, so that the destination slave server can obtain the installation source from the allocated NFS server, and PXE Load the kernel on the server, which can effectively share the network bandwidth pressure of the PXE server. Among them, the destination slave server obtains the installation source from the PXE server, and the destination slave server obtains the installation source from the NFS server, thereby realizing the switching of the installation source and reducing the network bandwidth pressure of the PXE server.
[0043] S14: It is determined that the PXE server directly provides the installation source required to implement the operating system installation for the target slave server.
[0044] If the network bandwidth occupied by the PXE server by the slave server is not higher than the expected network bandwidth, it means that there is no need to share the network bandwidth pressure of the PXE server, so the PXE server itself can directly provide the required slave server to implement the operating system installation. Installation source.
[0045] In the technical solution disclosed in this application, when the slave server needs to obtain the installation source to implement the installation of the corresponding operating system, it is determined whether the total number of slave servers currently implementing the operating system installation on the PXE server is greater than the corresponding number threshold, Determine whether the network bandwidth occupied by the PXE server by the slave server is higher than the expected network bandwidth. If so, assign an NFS server to the slave server that needs to obtain the installation source, so that the slave server that needs to obtain the installation source is assigned NFS The server obtains the installation source, otherwise the PXE server directly obtains the installation source; thus, when the slave server that realizes the operating system installation occupies too much network bandwidth of the PXE server, the installation source can be allocated to the NFS server to reduce The network bandwidth of a single node of the PXE server is occupied to avoid network congestion, improve the installation speed and installation efficiency of the operating system, and avoid the failure of the slave server to install the operating system due to the response time of the PXE server.
[0046] The method for automatically switching installation sources provided by the embodiment of the present invention instructs the destination slave server to obtain the installation source required to implement the operating system installation from the NFS server allocated to the destination slave server, which may include:
[0047] The address information of the NFS server allocated to the destination slave server is sent to the destination slave server to instruct the destination slave server to obtain the installation source required to implement the operating system installation from the NFS server corresponding to the address information.
[0048] Among them, the address information is information indicating the location of the NFS server. After the address information of the NFS server is obtained, the NFS server can be located based on the address information, and then the access to the located NFS server can be realized; thus, it can be This enables the slave server to implement access to the corresponding NFS server in a more convenient and efficient manner, thereby achieving the acquisition of the required installation source. In a specific implementation, the address information can be an IP address, each NFS server has a corresponding IP address, and the PXE server can allocate IP addresses through DHCP; and the PXE server can detect the allocation status of IP addresses in real time , And then determine the IP address of the NFS server that needs to be allocated to the slave server, and realize the allocation of the NFS server through the allocation of the IP address, thereby effectively distinguishing different NFS servers in this way.
[0049] The method for automatically switching installation sources provided in the embodiment of the present invention allocates a corresponding NFS server to the destination slave server, which may include:
[0050] Based on the number of allocated slave servers on multiple NFS servers set in advance, the corresponding NFS servers are allocated to the target slave servers according to the principle of load balancing.
[0051] When realizing the allocation of NFS servers, in order to make the network bandwidth occupied by the slave server on different NFS servers roughly the same, to prevent the network bandwidth occupied by the slave server on a certain NFS server from being too high, which will lead to network congestion. In this embodiment, by real-time detection of IP address allocation, the number of slave servers allocated on each NFS server can be determined, and the target slave server can be allocated to the least number of NFS servers according to the principle of load balancing; Of course, other methods for allocating NFS servers can also be determined according to actual needs, and they are all within the protection scope of the present invention.
[0052] According to an embodiment of the present invention, an installation source automatic switching method, before receiving a system installation request sent by a destination slave server, may further include:
[0053] Receive the connection request sent by the target slave server, and determine whether the identity information of the target slave server carried in the connection request is legal. If it is, it is determined that the system installation request sent by the target slave server can be received. If not, it is determined to refuse to receive it. The system installation request sent by the destination slave server.
[0054] After receiving the connection request sent by the slave server, the identity information carried in the connection request can be obtained from the connection request. The identity information can include user name and password information; by judging whether the identity information exists in all pre-stored legal identities In the information, or other methods selected according to actual needs, verify the identity information to determine whether the identity information is legal. If it is determined that the identity information is legal, it means that the slave server has access to the PXE server and the NFS server under the instruction of the PXE server Therefore, it is determined that it is allowed to receive the system installation request sent by the slave server, otherwise, it will refuse to receive the system installation request sent by the slave server; in this way, the legality of the slave server is verified, and illegal servers are avoided The access to the PXE server and the NFS server is realized under the instruction of the PXE server, thereby ensuring the security and reliability of the PXE server and the NFS server.
[0055] The method for automatically switching installation sources provided by the embodiment of the present invention may further include:
[0056] Instruct the NFS server and PXE server to encrypt the stored installation source, so as to provide the encrypted installation source to the corresponding slave server.
[0057] In order to further prevent illegal servers from installing operating systems based on PXE servers and/or NFS servers, in this embodiment, the NFS server and PXE server are instructed to encrypt the stored installation source, and the slave server needs to be NFS server or PXE server When obtaining the installation source in, you need to decrypt the installation source before you can use it. Among them, the encryption mode can be set according to actual needs, and all are within the protection scope of the present invention.
[0058] This application can set up an IP lease configuration file. The IP lease configuration file can contain information representing each NFS server (such as IP address, etc.), and each server identifier is recorded in real time with the current assigned needs corresponding to the server identifier Obtain the number of slave servers of the installation source on the NFS server; then you can obtain the number of slave servers allocated on each NFS server through the IP lease configuration file, that is, obtain the IP address allocation status, and the new IP address is detected When assigning, it is determined that a new slave server is assigned to a certain NFS server, and the installation source of the operating system is switched to the NFS server of distributed storage in real time through scripts, etc.
[0059] In a specific application scenario, the implementation sentence of an installation source automatic switching method provided by the embodiment of the present invention may be as follows:
[0060]
[0061]
[0062]
[0063] In the technical solution disclosed in this application, the PXE server provides IP distribution services through DHCP, kernel loading through TFTP, and installation sources through NFS. The NFS server as a distributed storage node is different from the service provided by the PXE server. Only the NFS service is enabled to provide installation. In this way, by detecting the distribution status of the IP address, switching the installation source of the operating system to other NFS servers in the same local area network through a script in real time, so as to realize the simultaneous operation of multi-node installation sources and reduce the network bandwidth occupation of a single-node installation source problem.
[0064] The embodiment of the present invention also provides an installation source automatic switching device, such as image 3 As shown, it can specifically include:
[0065] The receiving module 11 is configured to: receive a system installation request sent by any slave server of the operating system to be installed, and determine the arbitrary slave server of the operating system to be installed as the destination slave server;
[0066] The judging module 12 is used for judging whether the total number of slave servers currently undergoing operating system installation on the PXE server is greater than the corresponding number threshold;
[0067] The processing module 13 is used to allocate the corresponding NFS server to the destination slave server if the result of the judgment is yes, and instruct the destination slave server to obtain the required operating system installation from the NFS server allocated to the destination slave server Installation source, if the judgment result is negative, it is determined that the PXE server directly provides the installation source required to implement the operating system installation for the target slave server.
[0068] In the device for automatically switching installation sources provided in the embodiment of the present invention, the processing module may include:
[0069] The sending unit is used to: send the address information of the NFS server allocated to the destination slave server to the destination slave server to instruct the destination slave server to obtain the required operating system installation from the NFS server corresponding to the address information Installation source.
[0070] In the device for automatically switching installation sources provided in the embodiment of the present invention, the processing module may include:
[0071] The allocation unit is used for: based on the number of allocated slave servers on the multiple NFS servers set in advance, allocate corresponding NFS servers to the target slave servers according to the principle of load balancing.
[0072] The device for automatically switching installation sources provided by the embodiment of the present invention may further include:
[0073] The connection module is used to: before receiving the system installation request sent by the destination slave server, receive the connection request sent by the destination slave server, and determine whether the identity information of the destination slave server carried in the connection request is legal, and if it is, confirm that it can Receive the system installation request sent by the destination slave server, if not, determine to reject the system installation request sent by the destination slave server.
[0074] The device for automatically switching installation sources provided by the embodiment of the present invention may further include:
[0075] The encryption module is used to instruct the NFS server and the PXE server to encrypt the stored installation source, so as to provide the encrypted installation source to the corresponding slave server.
[0076] The embodiment of the present invention also provides an installation source automatic switching device, which may include:
[0077] Memory, used to store computer programs;
[0078] The processor is used to implement the steps of the installation source automatic switching method of any of the above embodiments when the computer program is executed.
[0079] The embodiment of the present invention also provides a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the installation source automatic switching method of any of the above embodiments can be implemented.
[0080] It should be noted that, for descriptions of related parts in the installation source automatic switching apparatus, equipment, and storage medium provided in the embodiments of the present invention, please refer to the detailed description of the corresponding parts in the installation source automatic switching method provided in the embodiments of the present invention. I will not repeat them here. In addition, the parts of the above technical solutions provided by the embodiments of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail, so as to avoid redundant description.
[0081] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined in this document can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown in this text, but should conform to the widest scope consistent with the principles and novel features disclosed in this text.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.