Server cluster configuration method and device
Through the multi-level parallel processing server cluster configuration method, the problem of low bare metal server configuration efficiency is solved, and efficient and stable server configuration is achieved, which is suitable for batch configuration scenarios.
Patent Information
- Application Number
- CN202411346459.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-31
AI Technical Summary
The prior art has problems of long time and low efficiency in bare metal server configuration, especially when multiple servers are installed in parallel, due to the limitations of network bandwidth and hard disk processing capacity, parallelism cannot be guaranteed, resulting in long configuration.
Using a multi-level parallel processing server cluster configuration method, the target configuration file is generated by determining the server configuration indication information and the target image file, and after the first hierarchy subset is configured, it is transmitted to the next hierarchy subset. Achieve parallel configuration step by step to improve configuration efficiency and robustness.
It significantly improves the configuration efficiency of bare metal servers, can achieve efficient and stable batch server configuration in the case of unstable network environment, reduces the need for manual installation and configuration, and improves the robustness and reliability of the system.
Smart Images

Figure CN119232571A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and more specifically to a server cluster configuration method and device. Background Art
[0002] With the development of Internet technology, the demand for devices or servers is increasing. Before using a device or server, it is necessary to configure it. For example, a bare metal server needs to be initialized, installed and configured. How to quickly and efficiently deploy bare metal servers or bare metal devices has become an urgent problem to be solved. Summary of the invention
[0003] In view of this, this application provides the following technical solutions:
[0004] A server cluster configuration method, comprising:
[0005] Determine server configuration indication information corresponding to a server cluster to be configured; the server cluster to be configured includes at least one server to be configured;
[0006] Generate a target image file corresponding to the server cluster to be configured, wherein the target image file at least includes an operating system image sub-file corresponding to the server to be configured;
[0007] Generate a target configuration file according to the server configuration indication information and the target image file;
[0008] The target configuration file is sent to the server subset of the first level in the server cluster so that the server subset of the first level executes the target configuration process, and the target configuration process includes configuring its own server based on the target configuration file, and sending the target configuration file to the corresponding server subset of the next level after the configuration is completed.
[0009] Optionally, the determining server configuration indication information corresponding to the server cluster to be configured includes:
[0010] Based on the environmental characteristics of the configuration environment, a target structure tree of the server cluster to be configured is constructed, wherein each node in the target structure tree represents a server to be configured in the server cluster;
[0011] Determining server hierarchical information corresponding to the server cluster to be configured based on the hierarchical structure between nodes in the target structure tree;
[0012] Determine configuration requirement information corresponding to each of the servers to be configured;
[0013] The server configuration indication information is determined based on the configuration requirement information and the server level information.
[0014] Optionally, it also includes:
[0015] During the configuration of the servers to be configured in the subset of servers at the current level, monitoring the environmental characteristics of the configuration environment;
[0016] If the environmental characteristics meet the target conditions, the number of servers to be configured at the next level corresponding to the server subset at the current level is updated, so that the target configuration file is updated based on the updated number of servers to be configured at the next level.
[0017] Optionally, constructing a target structure tree of the server cluster to be configured based on the environment characteristics of the configuration environment includes:
[0018] Determine the transmission characteristics of each server to be configured in the server cluster to be configured based on the environmental characteristics of the configuration environment;
[0019] Determine configuration association information of each server to be configured in the server cluster to be configured;
[0020] Based on the transmission characteristics of each server to be configured and the configuration association information of each server to be configured, determining the nodes of each level of the structure tree to be generated and the number of nodes of each level;
[0021] A target structure tree is generated based on the nodes of each level and the number of nodes of each level.
[0022] Optionally, generating a target image file corresponding to the server cluster to be configured includes:
[0023] Creating a virtual operating system corresponding to each server to be configured in the server cluster to be configured;
[0024] Based on the virtual operating system, generate an operating system image subfile corresponding to the server to be configured;
[0025] Based on the application to be configured corresponding to the operating system to be configured, the application image information of the application to be configured is written into the corresponding operating system image sub-file to obtain a target image file.
[0026] Optionally, the method further comprises:
[0027] Based on the content features corresponding to the target image files, a file identifier of each of the target image files is determined, and the file identifier matches the configuration requirement information in the server configuration indication information.
[0028] Optionally, the first-level server subset executes a target configuration process, including:
[0029] If the server subset of the next level of the server subset of the first level is the second server subset, each server to be configured in the server subset of the first level obtains a target image file corresponding to the server itself based on the target configuration file, and performs configuration based on the target image file;
[0030] If the first server to be configured in the server subset of the first level completes configuration, the first server to be configured transmits the target configuration file to the corresponding server to be configured in the second server subset.
[0031] Optionally, it also includes:
[0032] If the second server to be configured in the second server subset is interrupted when receiving the target configuration file, the target identifier of the target configuration file that has been transmitted during the interruption is recorded, so that the second server to be configured sends the target identifier to the server at an upper level thereof, so that the server at an upper level thereof continues to transmit the target configuration file to the second server to be configured based on the target identifier when the transmission environment meets the conditions.
[0033] Optionally, it also includes:
[0034] Record feedback information of the servers to be configured in the server cluster to be configured.
[0035] A server cluster configuration device, comprising:
[0036] A determination unit, configured to determine server configuration indication information corresponding to a server cluster to be configured; the server cluster to be configured includes at least one server to be configured;
[0037] A first generating unit, configured to generate a target image file corresponding to the server cluster to be configured, wherein the target image file at least includes an operating system image sub-file corresponding to the server to be configured;
[0038] A second generating unit, configured to generate a target configuration file according to the server configuration indication information and the target image file;
[0039] A sending unit is used to send the target configuration file to the server subset of the first level in the server cluster, so that the server subset of the first level executes the target configuration process, and the target configuration process includes configuring its own server based on the target configuration file, and sending the target configuration file to the corresponding server subset of the next level after the configuration is completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0041] Figure 1 A flow chart of a server cluster configuration method provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of the hierarchical relationship of each server to be configured in a server cluster provided in an embodiment of the present application;
[0043] Figure 3 A schematic diagram of the structure of a target structure tree provided in an embodiment of the present application;
[0044] Figure 4 A schematic diagram of a server cluster configuration scenario provided in an embodiment of the present application;
[0045] Figure 5 A schematic diagram of the structure of a server cluster configuration device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] 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. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] The terms "first" and "second" etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0048] The embodiment of the present application provides a server cluster configuration method, which is used in the scenario of batch configuration of servers to be configured in an application system (such as a cloud computing application system). Among them, the server to be configured can be a bare metal server device that generally does not have an operating system installed when it leaves the factory. Usually, when the server is used, the corresponding operating system will be manually installed one by one to the server to be configured according to the scene requirements, but because the operating system installation file is large, manual configuration will take a lot of time. If the pre-boot execution environment (preboot execute environment, PXE) network installation method is adopted, when the operating system is installed in batches for the server remotely, due to the network bandwidth limitation between the PXE server and the server to be installed with the operating system, and the limitation of the hard disk processing capacity of the PXE server itself, when multiple servers to be installed with the operating system install the operating system in parallel, the parallelism of the operating system cannot be guaranteed at the same time, and there may still be problems of long time consumption and low efficiency. In order to solve the above problems, the embodiment of the present application provides a server cluster configuration method, which improves the configuration efficiency of the bare metal server by multi-level parallel processing of the server to be configured, and can improve the robustness and reliability of the system when the server to be configured is configured.
[0049] See also Figure 1 , is a flow chart of a server cluster configuration method provided in an embodiment of the present application, the method may include the following steps:
[0050] S101: Determine server configuration indication information corresponding to a server cluster to be configured.
[0051] Among them, the server cluster to be configured includes at least one server to be configured, and each server to be configured included in the server cluster to be configured may have the same configuration requirements, such as each server to be configured is a bare metal server that needs to be configured before leaving the factory. Correspondingly, each server to be configured in the server cluster to be configured may have different configuration requirements, such as each server to be configured may be configured with the same operating system, or different operating systems, or may need to be configured with the same operating system but different applications, etc.
[0052] According to the configuration requirements of the servers to be configured in the server cluster to be configured, as well as the current application environment, the number of servers to be configured, etc., the server configuration indication information is determined, and the server configuration indication information is used to guide the corresponding server to be configured to complete the server configuration process, such as guiding the server to be configured to obtain the corresponding configuration file, and guiding the subsequent operations of the server to be configured after the configuration is completed. By determining the server configuration indication information corresponding to the server cluster to be configured, the server to be configured can be assisted to complete the corresponding configuration, providing reference information for the subsequent batch configuration of the servers to be configured, so as to facilitate the efficient and accurate completion of the server configuration.
[0053] S102: Generate a target image file corresponding to the server cluster to be configured.
[0054] Among them, the target image file at least includes an operating system image subfile corresponding to the server to be configured. The image file is usually a copy of the relevant data, which is consistent with the original data in content. The image file can improve the availability of data. In the embodiment of the present application, the target image file may include an operating system image subfile, and may also include an application image subfile of the application to be configured on the corresponding server. The operating system image subfile includes all the contents of the operating system to be configured on the server, such as system files, programs, databases, drivers, configuration parameters, etc. The operating system image subfile is usually used to install the operating system for the server to be configured. The server to be configured can download the operating system image subfile, then use the corresponding driver to start the server, and install the operating system from the operating system image subfile. Similarly, the application image subfile can be used to install the application of the server. In the embodiment of the present application, configuring the server based on the target image file can save time and resources, reduce the need for manual installation and configuration; and can realize offline installation based on the target image file, which is not limited by the network environment, and improves the stability and reliability of the server configuration.
[0055] S103: Generate a target configuration file according to the server configuration instruction information and the target image file.
[0056] S104: Send the target configuration file to the first-level server subset in the server cluster, so that the first-level server subset executes the target configuration process.
[0057] After obtaining the server configuration indication information and the target image file, a corresponding target configuration file can be generated. The server to be configured executes the corresponding target configuration process according to the target configuration file. The target configuration process includes configuring its own server based on the target configuration file, and sending the target configuration file to the corresponding server subset of the next level after the configuration is completed. Among them, the server configuration indication information can indicate how the server to be configured completes the configuration, for example, instructing the server to be configured to obtain the corresponding target image file, and instructing the server to be configured to pass the information to the server to be configured at the next level after the configuration is completed. The server to be configured can determine the image file to be configured according to the server configuration indication information in the target configuration file, and then obtain the corresponding target image file to complete the configuration. Further, in order to achieve efficient server configuration in the embodiment of the present application, the server cluster to be configured can be configured in parallel step by step, such as each level of the server subset includes multiple servers to be configured. After the configuration file of the server to be configured at the current level is completed, the server will send the target configuration file to each server to be configured at the corresponding next level. In one implementation of the embodiment of the present application, the server cluster can be randomly divided into levels according to the number of servers to be configured in the current server cluster to be configured, that is, the number of servers to be configured at each level can be determined to achieve the configuration processing effect of maximizing parallelism, so that the configuration effect is the highest. For example, if the server subset of the first level includes 10 servers to be configured, and the next level of servers corresponding to the server subset of the first level also includes 10 servers to be configured, then when configuring the server subset of the first level, 10 servers can be configured at the same time, and when configuring the servers of the next level, 100 servers can be configured at the same time, which can improve the configuration efficiency of the server. In another implementation of the embodiment of the present application, the hierarchical relationship of the server cluster to be configured and the number of servers to be configured corresponding to each level can also be determined according to the configuration requirements of the servers to be configured. For example, the server cluster to be configured includes servers that need to install an operating system and servers that need to install an operating system and specific applications at the same time. The servers that need to install the operating system can be determined as a server subset of the first level and configured first, which can reduce the configuration time. The servers that need to install the operating system and specific applications at the same time are identified as a server subset of the second level, where the second level is the next level of the first level. In this way, even if there are servers to be configured with complex configuration requirements, it will not affect the parallel configuration process of the current servers to be configured, thereby improving the efficiency of server configuration.
[0058] Specifically, the server cluster configuration method of the embodiment of the present application can be executed by a controller for the server cluster to be configured, and the controller can be a server that has been configured, that is, a server with normal data transmission, processing and response, or an electronic device with data regulation function, etc. The controller generates a target configuration file based on the server configuration indication information and the target image file, and then sends the target configuration file to the first-level server subset in the server cluster, so that each server to be configured in the first-level server subset executes the target configuration process, that is, each server to be configured in the first-level server subset configures its own server based on the target configuration file, and sends the target configuration file to the corresponding next-level server subset after the configuration is completed.
[0059] See also Figure 2 , is a hierarchical relationship of each server to be configured in a server cluster provided in an embodiment of the present application, the controller 200, sends the generated target configuration file to the server subset of the first level, the server subset of the first machine includes server 201 and server 202, server 201 and server 202 complete the configuration of their own operating system based on the target image file (such as the operating system image subfile) in the target configuration file, if server 201 and server 202 complete the configuration of their own servers (such as completing the installation of the operating system), they will send the target configuration file to the server subset of the second level according to the transmission path corresponding to the server configuration indication information in the target configuration file, for example, server 201 sends the target configuration file to server 203 and server 204; server 202 sends the target configuration file to server 205 and server 206. After the servers in the second-level server subset complete their own configuration, they will continue to send the target configuration file to the third-level server subgroup, such as server 203 sending the target configuration file to server 207 and server 208, server 204 sending the target configuration file to server 209 and server 210, server 205 sending the target configuration file to server 211 and server 212; server 206 sending the target configuration file to server 213 and server 214. In this way, parallel configuration of servers can be achieved at each level, and based on sending the pre-generated target image file to the server to be configured, there is no need to obtain relevant configuration information through the network in real time, and the offline configuration of the server can be achieved. In the case of an unstable network environment, efficient configuration of the server can also be achieved, meeting the scenario requirements of batch configuration of servers.
[0060] The server cluster configuration method of the embodiment of the present application is described below in conjunction with specific application scenarios and corresponding implementation methods.
[0061] In one implementation of the present application, in order to clearly, accurately and quickly configure batch servers, the servers to be configured at each level can be configured in parallel through a cascading strategy. Therefore, a structure tree corresponding to the server cluster to be configured can be constructed to make it possible to clarify the server configuration transmission relationship at each level. Specifically, Figure 1 The process of determining the server configuration indication information corresponding to the server cluster to be configured may include:
[0062] Based on the environmental characteristics of the configuration environment, a target structure tree of the server cluster to be configured is constructed, and each node in the target structure tree represents the server to be configured in the server cluster; based on the hierarchical structure between the nodes in the target structure tree, the server hierarchy information corresponding to the server cluster to be configured is determined; the configuration requirement information corresponding to each server to be configured is determined; based on the configuration requirement information and the server hierarchy information, the server configuration indication information is determined.
[0063] Specifically, the target structure tree constructed can be a multi-branch tree structure, see Figure 3, is a schematic diagram of the structure of a target structure tree provided in an embodiment of the present application, in which the topmost node of the target structure tree is the controller G1 pointing to the server cluster configuration method, and the corresponding next-layer node is the first-level server subset in the server cluster to be configured, such as including the servers to be configured G2 and G3, and the next-layer node of G2 and G3 is the second-level server subset in the server cluster to be configured, such as including the servers to be configured G4, G5, G6, G7, G8, and G9. The number of nodes at each level can be the same or different. It should be noted that in the embodiment of the present application, if the configuration requirements of the servers to be configured are similar, the number of servers to be configured at each level and the corresponding number of levels can be randomly determined. The number of levels of the target structure tree and the number of servers to be configured corresponding to each level can also be determined according to the environmental characteristics of the configuration environment. Since in the embodiment of the present application, after the configuration of the server at the current level is completed, the corresponding target configuration file needs to be sent to the corresponding next-level server, so in order to improve the transmission efficiency, the target structure tree can be constructed according to the environmental characteristics of the configuration environment. Among them, the environmental characteristics of the configuration environment may include the network characteristics of the current configuration scenario, the number of server clusters to be configured, etc. For example, different servers can be connected through a wireless network. If the current wireless network conditions are relatively good, that is, the transmission efficiency is high, when constructing the target structure tree, the number of nodes in each layer can be configured more, otherwise it can be configured less. For another example, if the target configuration file is large, the efficiency may be slow during transmission, and the corresponding number of nodes in each layer can be relatively small. The number of layers can also be determined according to the number of server clusters to be configured. If the number of servers is less than the target number threshold, the number of divided layers will be smaller. If the number of servers is not less than the target number threshold, the number of divided layers will be relatively larger, so that the server configuration can be completed quickly. It should be noted that when nodes at each level transmit the target configuration file to nodes at the next level (i.e., the server to be configured), the transmission can be based on the corresponding network, such as a wireless network, a wired network, etc. However, in the process of configuring the server based on the target configuration file, since the target configuration file includes a target image file for configuring the operating system and / or other applications, the server can be configured offline based on the target configuration file without having to obtain the corresponding data through the network. Even in an environment with poor network conditions, configuration can be performed, thereby ensuring the stability of the server configuration.
[0064] After determining the server-level information corresponding to the server cluster to be configured, the configuration requirement information corresponding to each server to be configured can also be determined, such as whether to configure the operating system, or to configure the operating system and a specific application, etc. The configuration requirement information can be used to indicate which type of image sub-file in the target configuration file the server to be configured obtains, etc., so that the server to be configured can accurately complete the configuration corresponding to the configuration requirement. Through the configuration requirement information and the server-level information, server configuration indication information can be generated, which can instruct the current server to obtain the image sub-file (such as the operating system image sub-file) used for configuration in the target configuration file, and can also indicate which server to send the target configuration file to after the current server configuration is completed, so as to continue the configuration. In this way, automatic configuration of the server can be achieved, which improves the efficiency and accuracy of the configuration.
[0065] In one implementation of the present application, based on the environmental characteristics of the configuration environment, a target structure tree of the server cluster to be configured is constructed, including: determining the transmission characteristics of each server to be configured in the server cluster to be configured based on the environmental characteristics of the configuration environment; determining the configuration association information of each server to be configured in the server cluster to be configured; determining the nodes of each level of the structure tree to be generated and the number of nodes of each level based on the insertion loss characteristics of each server to be configured and the configuration association information of each server to be configured; generating the target structure tree based on the nodes of each level and the number of nodes of each level. Among them, the transmission characteristics can characterize the data transmission efficiency between servers, so that the number of servers of each level can be determined based on the transmission characteristics, and the transmission efficiency of the server of the current level to transmit the target configuration file to the server of the next level is guaranteed, so as to avoid problems such as transmission jam or low transmission efficiency. Through the configuration association information of each server to be configured, servers with the same configuration requirements can be determined. For example, which servers are configured for type A operating system and which servers are configured for type B operating system. In this way, servers with the same type of operating system configuration requirements can be divided into upper and lower hierarchical relationships. For example, server G1 and server G2 are both configured for type A operating system. G2 can be used as the server at the next level of G1. When G1 obtains the image file of type A operating system from the target configuration file, the image file of type A operating system can be directly transferred to G2 according to the instruction information. There is no need to transfer the entire target configuration file to G2, which can improve transmission efficiency and achieve accurate configuration.
[0066] Furthermore, in order to efficiently configure the server, the number of servers of the corresponding level can also be updated in real time according to the current configuration environment. Specifically, the process includes: monitoring the environmental characteristics of the configuration environment during the configuration of the servers to be configured in the current server subset; if the environmental characteristics meet the target conditions, updating the number of servers to be configured in the next level corresponding to the server subset of the current level, so that the target configuration file is updated based on the updated number of servers to be configured in the next level. Among them, the environmental characteristics meeting the target conditions can be that the network transmission rate determined based on the environmental characteristics is greater than the target rate threshold, and the number of servers to be configured in the next level can be increased, and correspondingly, the number of server levels can be reduced. It can also be based on the configuration efficiency of the servers at the current level to adjust the number of servers to be configured at the corresponding level and the number of levels. For example, if the configuration time of the servers at the current level is less than the preset time, it means that the configuration efficiency is higher than expected, and more servers can be added at the next level to reduce the configuration time. In this way, the level of the servers to be configured or the number of each level can be adjusted according to the real-time environmental characteristics, meeting the real-time scene characteristics, and improving the configuration efficiency.
[0067] In an embodiment of the present application, a method for generating a target image file is also provided, that is, the processing process of generating a target image file corresponding to a server cluster to be configured includes: creating a virtual operating system corresponding to each server to be configured in the server cluster to be configured; based on the virtual operating system, generating an operating system image sub-file corresponding to the server to be configured; based on the application to be configured corresponding to the operating system to be configured, writing the application image information of the application to be configured into the corresponding operating system image sub-file to obtain the target image file.
[0068] In this embodiment, the target image file includes not only the image information of the operating system, but also the image information of the application to be configured. The image information in the operating system image subfile includes pre-packaged operating system files, programs and setting information. The application image information of the application to be configured includes the files and setting information of the application, etc. For example, the operating system image subfile can be created by the Packer tool. In the process of creating an image file based on the Packer tool, a configuration file can be pre-defined to specify the basic image, installation steps, software installation and other information, so that the Packer tool will automatically create a customized image file according to these definitions. The QEMU virtualization tool can also be used to create the corresponding image file. QEMU can be used to simulate different hardware platforms, including central processing units, memory, etc., so as to create corresponding image files according to the simulated platform requirements. In the embodiment of the present application, the application tool for creating the image file is not limited, as long as it can meet the configuration requirements of the server's operating system and related applications. Correspondingly, the format of the generated target image file can be determined by actual requirements, such as the format information of the image file can include RAW image file format, qcow2 image file format, vhd image file format, vhdx image file format or vmdk image file format. Among them, the RAW image file format is an image image file format, the qcow2 image file format is a disk image file format, the vhd image file format is a disk image file format, the vhdx image file format is a disk image file format, and the vmdk image file format is a disk image file format. Among them, the RAW image file can accurately copy the original data, including the file system, data, partition table and boot sector, etc., with higher accuracy and better compatibility. Therefore, the format of the target image file can be the RAW format.
[0069] Furthermore, in order to save resource storage space and improve the transmission efficiency of the configuration file, files corresponding to the same configuration requirements can be stored by type, so as to avoid the problem of large storage resources occupied by generating a target configuration file for each server. Therefore, the method also includes: determining the file identifier of each target image file based on the content characteristics corresponding to the target image file, wherein the file identifier matches the configuration requirement information in the server configuration indication information. In this way, a target image file can be generated for servers with the same type of requirements, and the corresponding target image file can be searched according to the file identifier when the server is configured later, without generating a configuration file for each server, which can avoid the waste of storage space. Since the storage capacity of the target configuration file is reduced, bandwidth can also be saved when transmitting the target configuration file, thereby improving the transmission efficiency.
[0070] In the server cluster configuration method of the embodiment of the present application, the function of breakpoint resumption can also be implemented, that is, if there is a problem with the file transfer during the server configuration process, the transmission can be continued after the problem is solved based on the current transmission progress. Take the process of the first-level server subset executing the target configuration process as an example, if the server subset of the next level of the first-level server subset is the second server subset. Each server to be configured in the first-level server subset obtains the target image file corresponding to its own server based on the target configuration file, and configures based on the target image file; the first server to be configured in the first-level server subset completes the configuration, and the first server to be configured transmits the target configuration file to the corresponding server to be configured in the second server subset.
[0071] If the second server to be configured in the second server subset is interrupted when receiving the target configuration file, the target identifier of the target configuration file that has been transmitted during the interruption is recorded, so that the second server to be configured sends the target identifier to the server at the upper level, so that the server at the upper level continues to transmit the target configuration file to the second server to be configured based on the target identifier when the transmission environment meets the conditions. If the transmission of the target configuration file is not completed due to the influence of the network environment or server power failure, the unfinished part can be continued from the interruption point without retransmitting the entire target configuration file, so that there is no need to re-download the data that has been transmitted, thereby saving time and network bandwidth. Even in the case of unstable network conditions or other interruption factors, it can be ensured that the file is finally transmitted completely. In this embodiment, the target identifier is the location identifier of the current interruption point, and the transmission environment meets the conditions, which means that the interruption fault is resolved and the normal transmission state is restored.
[0072] In order to obtain the configuration status of the corresponding server to be configured in real time, the feedback information of the server to be configured in the server cluster to be configured can be recorded. For example, after the configuration of the server to be configured in the server cluster to be configured is completed, the feedback information of the configuration project will be sent to the controller of the current application scenario, which can enable the controller to record this information to clarify the number and configuration status of the servers that have been configured, so that users can obtain the configuration progress and improve the user experience.
[0073] See also Figure 4, a schematic diagram of a server cluster configuration scenario provided by an embodiment of the present application. First, the image file of the server configuration requirement is determined according to the current configuration scenario, such as the image image can be created in the cloud based on the image. Then, the target structure tree corresponding to the server cluster is generated based on the characteristics of the current server cluster, and the image file and the target structure tree and other related configuration information can be stored in the local management system (XCC) of the control server, and then based on the control unit of the control server, the corresponding image file is transmitted to the first-level server such as server G1, and then server G1 completes the configuration based on the image file in the target configuration file, and based on the identification information of the server of the next level included in the indication information, the image file is sent to the server of the next level, such as server G2 and server G3, and then after servers G2 and G3 complete the configuration, based on the identification information of the server of the next level corresponding to the indication information, the image file is sent to the server of the next level, such as server G4 and server G5, until the configuration of each server in the current server cluster is completed. Among them, the image file can be transmitted to the local management system (XCC) of the corresponding server, and the local management system can be a system that can be called without being based on the operating system, so that the server can call the image file to complete the configuration.
[0074] Assume that in k transfers (for example, when k=2, the controller transfers the file to the first level, and the first level transfers the file to the second level), there are 2 k-1 The controller is the first sending group, and the server groups are from 1 to 2. k -1 The groups with -1 are also sent as groups because they already have the image files from the previous pass (k-1). k-1 To 2 k -1 group receives the mirror file sent by the above sending group in parallel. If the number of servers in each group is m, there are 2 in each transmission. (k-1) *m parallel transmissions, if the server cluster includes N servers, the total number of transmissions for image file distribution is log2(N / m)+1 times. It can be seen that the deployment time of large-scale server systems is reduced exponentially, which improves the deployment efficiency of servers.
[0075] In the embodiment of the present application, a server cluster configuration device is also provided. Figure 5 , the device comprises:
[0076] The determining unit 501 is used to determine server configuration indication information corresponding to a server cluster to be configured; the server cluster to be configured includes at least one server to be configured;
[0077] A first generating unit 502 is configured to generate a target image file corresponding to the server cluster to be configured, wherein the target image file at least includes an operating system image sub-file corresponding to the server to be configured;
[0078] A second generating unit 503 is used to generate a target configuration file according to the server configuration indication information and the target image file;
[0079] The sending unit 504 is used to send the target configuration file to the server subset of the first level in the server cluster, so that the server subset of the first level executes the target configuration process, and the target configuration process includes configuring its own server based on the target configuration file, and sending the target configuration file to the corresponding server subset of the next level after the configuration is completed.
[0080] Optionally, the determining unit includes:
[0081] A construction subunit, configured to construct a target structure tree of the server cluster to be configured based on the environmental characteristics of the configuration environment, wherein each node in the target structure tree represents a server to be configured in the server cluster;
[0082] A first determining subunit, configured to determine server hierarchical information corresponding to the server cluster to be configured based on the hierarchical structure between the nodes in the target structure tree;
[0083] A second determining subunit is used to determine configuration requirement information corresponding to each of the servers to be configured;
[0084] The third determining subunit is used to determine the server configuration indication information based on the configuration requirement information and the server level information.
[0085] Optionally, it also includes:
[0086] A monitoring subunit, used to monitor environmental characteristics of a configuration environment during the configuration of a server to be configured in the server subset of the current level;
[0087] The updating subunit is used to update the number of servers to be configured at the next level corresponding to the server subset of the current level if the environmental characteristics meet the target conditions, so as to update the target configuration file based on the updated number of servers to be configured at the next level.
[0088] Optionally, the construction subunit is configured to:
[0089] Determine the transmission characteristics of each server to be configured in the server cluster to be configured based on the environmental characteristics of the configuration environment;
[0090] Determine configuration association information of each server to be configured in the server cluster to be configured;
[0091] Based on the transmission characteristics of each server to be configured and the configuration association information of each server to be configured, determining the nodes of each level of the structure tree to be generated and the number of nodes of each level;
[0092] A target structure tree is generated based on the nodes of each level and the number of nodes of each level.
[0093] Optionally, the first generating unit includes:
[0094] A creation subunit, used to create a virtual operating system corresponding to each server to be configured in the server cluster to be configured;
[0095] A first generating sub-unit is used to generate an operating system image sub-file corresponding to the server to be configured based on the virtual operating system;
[0096] The writing subunit is used to write the application image information of the application to be configured into the corresponding operating system image subfile based on the application to be configured corresponding to the operating system to be configured, so as to obtain a target image file.
[0097] Optionally, the device further comprises:
[0098] The identifier determination subunit is used to determine the file identifier of each target image file based on the content characteristics corresponding to the target image file, and the file identifier matches the configuration requirement information in the server configuration indication information.
[0099] Optionally, the first-level server subset executes a target configuration process, including:
[0100] If the server subset of the next level of the server subset of the first level is the second server subset, each server to be configured in the server subset of the first level obtains a target image file corresponding to the server itself based on the target configuration file, and performs configuration based on the target image file;
[0101] If the first server to be configured in the server subset of the first level completes configuration, the first server to be configured transmits the target configuration file to the corresponding server to be configured in the second server subset.
[0102] Furthermore, it also includes:
[0103] If the second server to be configured in the second server subset is interrupted when receiving the target configuration file, the target identifier of the target configuration file that has been transmitted during the interruption is recorded, so that the second server to be configured sends the target identifier to the server at an upper level thereof, so that the server at an upper level thereof continues to transmit the target configuration file to the second server to be configured based on the target identifier when the transmission environment meets the conditions.
[0104] Optionally, it also includes:
[0105] The recording unit is used to record feedback information of the servers to be configured in the server cluster to be configured.
[0106] It should be noted that the specific implementation of each unit and sub-unit in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0107] In another embodiment of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the server cluster configuration method as described in any one of the above items is implemented.
[0108] In another embodiment of the present application, an electronic device is further provided, and the electronic device may include:
[0109] A memory, used to store applications and data generated by the operation of the applications;
[0110] The processor is used to execute the application program to implement the server cluster configuration method as described in any one of the above.
[0111] It should be noted that the specific implementation of the processor in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0112] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0113] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0114] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0115] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A server cluster configuration method, comprising: Determine server configuration indication information corresponding to the server cluster to be configured; The server cluster to be configured includes at least one server to be configured; Generate a target image file corresponding to the server cluster to be configured, wherein the target image file at least includes an operating system image sub-file corresponding to the server to be configured; Generate a target configuration file according to the server configuration indication information and the target image file; The target configuration file is sent to the server subset of the first level in the server cluster so that the server subset of the first level executes the target configuration process, and the target configuration process includes configuring its own server based on the target configuration file, and sending the target configuration file to the corresponding server subset of the next level after the configuration is completed.
2. According to the method of claim 1, the step of determining the server configuration indication information corresponding to the server cluster to be configured comprises: Based on the environmental characteristics of the configuration environment, a target structure tree of the server cluster to be configured is constructed, wherein each node in the target structure tree represents a server to be configured in the server cluster; Determining server hierarchical information corresponding to the server cluster to be configured based on the hierarchical structure between nodes in the target structure tree; Determine configuration requirement information corresponding to each of the servers to be configured; The server configuration indication information is determined based on the configuration requirement information and the server level information.
3. The method according to claim 2, further comprising: During the configuration of the servers to be configured in the subset of servers at the current level, monitoring the environmental characteristics of the configuration environment; If the environmental characteristics meet the target conditions, the number of servers to be configured at the next level corresponding to the server subset at the current level is updated, so that the target configuration file is updated based on the updated number of servers to be configured at the next level.
4. The method according to claim 2, wherein the step of constructing a target structure tree of the server cluster to be configured based on the environmental characteristics of the configuration environment comprises: Determine the transmission characteristics of each server to be configured in the server cluster to be configured based on the environmental characteristics of the configuration environment; Determine configuration association information of each server to be configured in the server cluster to be configured; Based on the transmission characteristics of each server to be configured and the configuration association information of each server to be configured, determining the nodes of each level of the structure tree to be generated and the number of nodes of each level; A target structure tree is generated based on the nodes of each level and the number of nodes of each level.
5. The method according to claim 1, wherein generating a target image file corresponding to the server cluster to be configured comprises: Creating a virtual operating system corresponding to each server to be configured in the server cluster to be configured; Based on the virtual operating system, generate an operating system image subfile corresponding to the server to be configured; Based on the application to be configured corresponding to the operating system to be configured, the application image information of the application to be configured is written into the corresponding operating system image sub-file to obtain a target image file.
6. The method according to claim 5, further comprising: Based on the content features corresponding to the target image files, a file identifier of each of the target image files is determined, and the file identifier matches the configuration requirement information in the server configuration indication information.
7. The method according to claim 1, wherein the first-level server subset performs a target configuration process, comprising: If the server subset of the next level of the server subset of the first level is the second server subset, each server to be configured in the server subset of the first level obtains a target image file corresponding to the server itself based on the target configuration file, and performs configuration based on the target image file; If the first server to be configured in the server subset of the first level completes configuration, the first server to be configured transmits the target configuration file to the corresponding server to be configured in the second server subset.
8. The method according to claim 7, further comprising: If the second server to be configured in the second server subset is interrupted when receiving the target configuration file, the target identifier of the target configuration file that has been transmitted during the interruption is recorded, so that the second server to be configured sends the target identifier to the server at an upper level thereof, so that the server at an upper level thereof continues to transmit the target configuration file to the second server to be configured based on the target identifier when the transmission environment meets the conditions.
9. The method according to claim 1, further comprising: Record feedback information of the servers to be configured in the server cluster to be configured.
10. A server cluster configuration device, comprising: A determination unit, used to determine server configuration indication information corresponding to the server cluster to be configured; The server cluster to be configured includes at least one server to be configured; A first generating unit, configured to generate a target image file corresponding to the server cluster to be configured, wherein the target image file at least includes an operating system image sub-file corresponding to the server to be configured; A second generating unit, configured to generate a target configuration file according to the server configuration indication information and the target image file; A sending unit is used to send the target configuration file to the server subset of the first level in the server cluster, so that the server subset of the first level executes the target configuration process, and the target configuration process includes configuring its own server based on the target configuration file, and sending the target configuration file to the corresponding server subset of the next level after the configuration is completed.
