Server batch initialization method, system, device and medium

Through the treatment of asset documents, aggregating grouping, and central machine selection of the initial server, downloading and distribution of installation packages, the problem of inefficiency of the server batch initialization process in the existing technology, and realizing the efficient and reliable server batch deployment.

CN119356700AInactive Publication Date: 2025-01-24广州三七极耀网络科技有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411403073.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the server batch initialization process is inefficient and expensive, resulting in tight bandwidth of the source station, extended initialization time, low deployment efficiency and high operation and maintenance costs.

Method used

By obtaining the asset documents of the server to be initialized, the aggregation packet and select the central machine, the installation package download and distribution, pre -download the installation package to the local YUM source, and realize the efficientness of the server batch initialization.

Benefits of technology

The speed and success rate of the server batch deployment have been improved, the network redundant data transmission is reduced, the initialization time is saved, and the operation and maintenance cost is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356700A_ABST
    Figure CN119356700A_ABST
Patent Text Reader

Abstract

The invention is applicable to the technical field of servers, and provides a server batch initialization method, which comprises the following steps: acquiring asset files of all to-be-initialized servers; aggregating the servers according to the machine room fields to obtain aggregation groups, and determining the number of the servers and an intranet IP segment of each aggregation group; determining whether the aggregation group needs to execute packet downloading and distribution operations or not by judging whether the number of servers of the aggregation group is greater than a preset number value or not; selecting one server in the aggregation group as a central machine according to a preset rule for the aggregation group needing to execute packet downloading and distribution operation; for other servers in the aggregation group, downloading and decompressing an installation package through the central machine to obtain a pre-downloaded installation package; and pre-downloading the pre-downloaded installation package to a local yum source, and synchronously executing initialization operation by all servers in the aggregation group. According to the method, the high efficiency and the reliability of server batch initialization are realized, and the speed and the success rate of server batch deployment are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of server technology, and in particular, relates to a server batch initialization method, system, device and medium. Background Art

[0002] With the rapid development of cloud computing and big data, the deployment and initialization of large-scale server clusters have become an important means for enterprises to quickly respond to market demands and improve their business processing capabilities.

[0003] In the prior art, the process of batch initialization of servers mainly relies on self-built YUM source stations or operating machines to pull installation packages one by one, which is particularly inefficient and costly when facing large-scale server deployment. This process not only leads to tight bandwidth resources of the source station due to frequent network access, increasing additional costs, but also prolongs the initialization time of each server due to network delays and bandwidth limitations, seriously restricting the overall deployment efficiency. In addition, in a complex network environment across regions and multiple computer rooms, distributing and obtaining installation packages through the public network further aggravates bandwidth consumption, which not only prolongs the deployment cycle, but also increases the risk of installation package download failure or distribution failure due to network fluctuations. Once such abnormal situations occur, manual intervention is often required to resolve them, which greatly increases the operation and maintenance costs and deployment uncertainty, and seriously affects the rapid launch of servers and business continuity.

[0004] In summary, an innovative and efficient server batch initialization solution needs to be developed to ensure the smooth completion of the initialization process and improve the efficiency and success rate of server batch deployment. Summary of the invention

[0005] The embodiments of the present application provide a server batch initialization method, system, device and medium, which can solve one of the above-mentioned prior art problems.

[0006] In a first aspect, an embodiment of the present application provides a method for batch initialization of a server, comprising:

[0007] Obtain the asset files of all servers to be initialized, including the server's computer room field and intranet IP;

[0008] Aggregate the servers according to the computer room field to obtain an aggregation group, and determine the number of servers and the intranet IP segment of each aggregation group;

[0009] Determining whether the aggregation group needs to perform package download and distribution operations by judging whether the number of servers in the aggregation group is greater than a preset number value;

[0010] For an aggregation group that needs to perform package download and distribution operations, select a server in the aggregation group as a central machine according to a predetermined rule;

[0011] For other servers in the aggregation group, the central machine downloads and decompresses the installation package to obtain a pre-downloaded installation package, wherein the installation package includes files required for initializing the server;

[0012] The pre-downloaded installation package is pre-downloaded to a local yum source, and an initialization operation is synchronously performed on all servers in the aggregation group based on the local yum source.

[0013] Furthermore, the acquisition of asset files of all servers to be initialized includes:

[0014] Obtain configuration information of all servers through the configuration management system, match the configuration information with the server to be initialized requested by the work order, and generate a preliminary asset file;

[0015] Based on the role-based access control strategy, conduct a multi-level review of the preliminary asset documents to obtain review opinions;

[0016] The audit opinion is associated with the preliminary asset file in the form of additional attributes to obtain an asset file.

[0017] Further, the server is aggregated according to the computer room field to obtain an aggregation group, and the number of servers and the intranet IP segment of each aggregation group are determined, including:

[0018] Obtain the computer room fields of all servers to be initialized, and divide the servers belonging to the same computer room field into the same aggregation group;

[0019] Obtain the intranet IP addresses of all servers in each of the aggregation groups, and count the number of servers in each of the aggregation groups;

[0020] A regular expression is used to obtain the same network segment prefix of all the intranet IPs in the aggregation group, and the network segment prefix is ​​used as the intranet IP segment corresponding to the aggregation network.

[0021] Furthermore, for other servers in the aggregation group, the central machine downloads and decompresses the installation package to obtain a pre-downloaded installation package, and the installation package includes files required for initializing the server, including:

[0022] For other servers in the aggregation group, the files required for initializing the servers are configured as installation packages on the operation machine, and the installation packages are stored in the central machine;

[0023] Based on the central machine, the installation package is decompressed and the firewall and Web service are started, and the directory of the installation package is exposed to the intranet through the Web service;

[0024] For other servers in the aggregation group, the installation package is downloaded from the central machine through the intranet and decompressed.

[0025] Furthermore, based on the central machine, the installation package is decompressed and the firewall and Web service are started, and the directory of the installation package is exposed to the intranet through the Web service, including:

[0026] Creating a Web service directory on the central machine, and decompressing the received installation package into the Web service directory;

[0027] Install and start a firewall on the central machine and configure firewall rules;

[0028] Start the Web service, expose the Web service directory to the intranet, and allow other servers in the intranet to access it.

[0029] Further, the synchronously performing the initialization operation on all servers in the aggregation group based on the local yum source includes:

[0030] Create a configuration file for yum source management and configure the local yum source as the highest priority;

[0031] When the server is initialized, the pre-downloaded installation package is uniformly obtained from the local yum source for installation.

[0032] Further, the synchronously performing the initialization operation on all servers in the aggregation group based on the local yum source also includes:

[0033] Performing a quality check on the pre-downloaded installation packages in the local yum source;

[0034] For pre-downloaded installation packages that do not meet quality requirements, download and install the installation packages from the remote yum source;

[0035] For pre-downloaded installation packages that meet the quality requirements, the pre-downloaded installation packages are obtained from the local yum source for installation.

[0036] In a second aspect, an embodiment of the present application provides a server batch initialization system, including:

[0037] The first processing module is used to obtain the asset files of all servers to be initialized, wherein the asset files include the server's computer room field and intranet IP;

[0038] The second processing module is used to aggregate the servers according to the computer room field to obtain an aggregation group, and determine the number of servers and the intranet IP segment of each aggregation group;

[0039] A third processing module: used to determine whether the aggregation group needs to perform package download and distribution operations by judging whether the number of servers in the aggregation group is greater than a preset number value;

[0040] The fourth processing module is used for selecting a server in the aggregation group as a central machine according to a predetermined rule for the aggregation group that needs to perform the package download and distribution operation;

[0041] A fifth processing module: for downloading and decompressing the installation package for other servers in the aggregation group through the central machine to obtain a pre-downloaded installation package, wherein the installation package includes files required for initializing the server;

[0042] The sixth processing module is used to pre-download the pre-downloaded installation package to a local yum source, and synchronously perform initialization operations on all servers in the aggregation group based on the local yum source.

[0043] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned server batch initialization method when executing the computer program.

[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned server batch initialization method is implemented.

[0045] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0046] The present application discloses a method for batch initialization of servers. By aggregating and grouping the servers to be initialized according to the computer room field, the nearby deployment of the servers in the group can be achieved. In addition, in each aggregation group, a server is selected as a central machine, as a management center and a resource center, which can centrally manage the download requests of the installation packages of the servers to be initialized, and process multiple download tasks in parallel, thereby optimizing the installation package download and distribution process, improving the pre-download efficiency of the pre-downloaded installation package, and in addition, the pre-download operation of the installation package by the central machine can significantly reduce the redundant data transmission in the network and improve the download efficiency. For servers that need to be initialized, the subsequent initialization operation can be quickly performed by pre-downloading the installation package, which saves time and improves the initialization efficiency. In general, the present application realizes the high efficiency and reliability of batch initialization of servers, can significantly improve the speed and success rate of batch deployment of servers, and has a strong practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 only 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.

[0048] Figure 1 It is a flow chart of a method for batch initialization of servers provided by one embodiment of the present invention;

[0049] Figure 2 It is a structural diagram of a server batch initialization system provided by an embodiment of the present invention;

[0050] Figure 3 It is a structural diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0052] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0053] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0054] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0055] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0056] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0057] See also Figure 1 As shown, the present invention is a server batch initialization method, comprising the following steps:

[0058] S100, obtaining asset files of all servers to be initialized, wherein the asset files include a computer room field and an intranet IP address of the server;

[0059] In some embodiments, the above step S100 includes:

[0060] Obtain configuration information of all servers through the configuration management system, match the configuration information with the server to be initialized requested by the work order, and generate a preliminary asset file;

[0061] Based on the role-based access control strategy, conduct a multi-level review of the preliminary asset documents to obtain review opinions;

[0062] The audit opinion is associated with the preliminary asset file in the form of additional attributes to obtain an asset file.

[0063] In this embodiment, the configuration management system is connected to the interface of the server batch initialization method, and the latest server configuration information is pulled from the configuration management system regularly or in real time. The server configuration information includes environment variables, service dependencies, network configuration, security policies, etc., and then the configuration information such as the computer room field and intranet IP when the server is initialized is obtained. Specifically, the application work order for server batch initialization submitted through the work order system is received and parsed. The application work order includes the required configuration information of the server to be initialized, such as the computer room field and intranet IP, and the server configuration information is accurately matched with the configuration information required by the server to be initialized, and a preliminary asset file in JSON format is generated.

[0064] In this embodiment, the configuration management system is preferably the Apollo system. As an open source configuration management system, the Apollo system is open sourced by Ctrip and provides centralized configuration management services. In the scenario of batch initialization of servers, Apollo can centrally store the configuration information of all servers, including network settings, software versions, service parameters, etc. As a result, users can manage and distribute the configuration information required in the batch initialization process of servers through the unified interface of the Apollo system without having to manually set each server.

[0065] In this embodiment, a role-based access control strategy is used to review and verify the preliminary asset file to ensure that all necessary information has been provided and complies with internal specifications. Specifically, the role-based access control strategy grants corresponding permissions to auditors at different levels and sets up a multi-level review process. The opinions and suggestions generated during the review process are associated with the preliminary asset file in the form of additional attributes for easy tracking and processing.

[0066] In one embodiment, for asset files that have passed the review, the archiving process is started, the asset files are transferred to a dedicated storage area, and compressed and encrypted. At the same time, key metadata is extracted to build an index to facilitate subsequent retrieval and query. To ensure the integrity of the archived files, hash value comparisons are performed regularly to timely detect and handle file damage or loss. At the same time, a file recovery mechanism is established through redundant backup and off-site disaster recovery to minimize the risk of data loss.

[0067] In one embodiment, in order to respond to configuration information change events of servers in the configuration management system, a message queue is introduced to listen to data change events, triggering the corresponding real-time processing flow. The changed content is synchronized to the associated servers in real time through an event-driven mechanism to ensure the consistency and timeliness of data in each link.

[0068] In one embodiment, the different requirements for data storage and access at various stages of the asset file life cycle are comprehensively considered, and a reasonable data structure and data model are designed. For structured asset metadata, a relational database is used for storage and management. For unstructured asset file content, a distributed file system or object storage is used for storage. Through data sharding and load balancing strategies, efficient management and scalability of massive asset data are achieved.

[0069] S200, aggregating the servers according to the computer room field to obtain an aggregation group, and determining the number of servers and the intranet IP segment of each aggregation group;

[0070] In some embodiments, the step S200 includes:

[0071] Obtain the computer room fields of all servers to be initialized, and divide the servers belonging to the same computer room field into the same aggregation group;

[0072] Obtain the intranet IP addresses of all servers in each of the aggregation groups, and count the number of servers in each of the aggregation groups;

[0073] A regular expression is used to obtain the same network segment prefix of all the intranet IPs in the aggregation group, and the network segment prefix is ​​used as the intranet IP segment corresponding to the aggregation network.

[0074] In this embodiment, the computer room field is the computer room name, computer room number or physical location of the computer room, etc., which is used to group multiple servers so that multiple servers to be initialized are easy to manage and maintain. At the same time, servers in the same computer room or the same area can be centrally displayed and processed.

[0075] In this embodiment, for servers in the same aggregation group, the same virtual private cloud, such as VPC, is configured for them. Virtual private cloud is a network isolation technology commonly used in cloud computing, which allows users to own and manage their own computing resources and network resources, and completely isolate them from other users' resources, thereby ensuring network security, resource isolation and management convenience within the servers in the same computer room or the same area.

[0076] In this embodiment, a regular expression is used to configure an intranet IP segment for each virtual private cloud, that is, an intranet IP segment is configured for each aggregation group. Through the intranet IP segment, data storage and access between servers in the same aggregation group are guaranteed, while preventing unauthorized access and data leakage, which can enhance the security of the network. Specifically, the intranet IP of each server in the aggregation group is obtained, and the above intranet IP is stored in a list to form an IP address table. Traverse all intranet IPs in the above IP address table, extract the network segment prefix of each intranet IP by designing a regular expression, and store the extracted network segment prefix synchronously in the IP address table, analyze all network segment prefixes stored in the IP address table, and find the longest common prefix. In one embodiment, it can be achieved by comparing each bit of the prefix, starting from the highest bit, until the first unmatched bit is found. The found common prefix is ​​configured as the intranet IP segment of the server in the aggregation group, and the corresponding routing, ACL and security group rules are set in the network configuration to ensure that the traffic in the intranet IP segment can be correctly routed and isolated.

[0077] S300, determining whether the aggregation group needs to perform a package download and distribution operation by judging whether the number of servers in the aggregation group is greater than a preset number value;

[0078] In order to improve the initialization efficiency of the servers to be initialized and reduce the bandwidth consumption when the work order system requests batch initialization of the servers, the present application divides a large number of servers to be initialized into multiple aggregation groups, each of which has at least one server and each server has the same intranet IP segment, which can be used for data storage and access of the servers in the same aggregation group. Each aggregation group can synchronously perform pre-download operations before the batch initialization operation of the servers, thereby improving the initialization efficiency of the servers. In addition, when the number of servers in the aggregation group is greater than 1, in order to improve the initialization efficiency of the servers in the same aggregation group, it is necessary to perform package download and distribution operations on each server, that is, to perform pre-download operations on the installation packages of the servers to be downloaded. Therefore, in this embodiment, the preset number value is preferably 1.

[0079] S400, for an aggregation group that needs to perform package download and distribution operations, select a server in the aggregation group as a central machine according to a predetermined rule;

[0080] In this embodiment, one of the multiple servers in the aggregation group is selected as the central machine to perform package downloading and distribution operations, which has the function of centrally controlling and managing the package downloading and distribution operations of the entire aggregation group. It can uniformly schedule and allocate resources according to preset policies or rules to ensure the smooth progress of downloading and distribution operations. Through the centralized management of the central machine, the confusion and conflicts caused by multiple nodes acting independently can be reduced.

[0081] In this embodiment, a unified standard is used to select a central machine in multiple aggregation groups, thereby maintaining configuration consistency and reducing confusion and errors caused by configuration differences.

[0082] In the process of packet downloading and distribution, the central machine needs to exchange a lot of data with other servers. Since in the network configuration, there are usually rules for configuring default routes or preferentially routing to smaller IP addresses, in one of the preferred embodiments, the servers in the aggregation group are sorted in descending order according to the server's intranet IP, and the server with the smallest intranet IP is selected as the central machine according to the predetermined rules, which can optimize the transmission path of the data packet to a certain extent, reduce the transmission delay and packet loss rate, and help ensure the efficient distribution operation.

[0083] S500: For other servers in the aggregation group, the central machine downloads and decompresses the installation package to obtain a pre-downloaded installation package, where the installation package includes files required for initializing the server;

[0084] In this embodiment, the central machine, as the management center within the aggregation group, can centrally manage the download requests of the installation packages of the servers to be initialized. In addition, the central machine is also the resource center within the aggregation group, and can make full use of its computing power and storage resources to optimize the download and distribution process. During the download process, the central machine can process multiple download tasks in parallel to improve the utilization rate of the network bandwidth. During the distribution process, the central machine can dynamically adjust the distribution strategy according to the load conditions of each server to achieve load balancing. This can not only improve the utilization rate of resources, but also ensure the stability and reliability of the entire aggregation group. It can be understood that compared to the method of downloading the installation package separately for each server, the pre-download operation of the installation package by the central machine in this application can significantly reduce redundant data transmission in the network and improve download efficiency. For servers that need to perform initialization operations, subsequent initialization operations can be quickly performed by pre-downloading the installation package, which saves time and improves initialization efficiency.

[0085] In this embodiment, the central machine downloads and decompresses the installation package, which makes the batch initialization process of the servers in the aggregation group more centralized and controllable. Users can monitor the entire initialization process through the management of the central machine, and find and solve problems in time. At the same time, when the installation package needs to be updated or upgraded, it only needs to be operated on the central machine and then distributed to other servers, which greatly simplifies the workload of management and maintenance.

[0086] In some embodiments, the step S500 includes:

[0087] For other servers in the aggregation group, the files required for initializing the servers are configured as installation packages on the operation machine, and the installation packages are stored in the central machine;

[0088] Based on the central machine, the installation package is decompressed and the firewall and Web service are started, and the directory of the installation package is exposed to the intranet through the Web service;

[0089] For other servers in the aggregation group, the installation package is downloaded from the central machine through the intranet and decompressed.

[0090] In this embodiment, the yum source, configuration files, scripts and other files required in the initialization process are configured as installation packages through the operating machine, and the installation packages are pushed to the central machine. In some preferred embodiments, a new storage bucket is created in the central machine through the object storage service to store the above-mentioned installation package. By initializing the storage bucket settings and configuring the intranet access rights, it is ensured that only the central machine can access it, thereby ensuring the storage security of the data in the central machine.

[0091] In this embodiment, the unified configuration of the installation package can greatly simplify the server initialization process. For newly added servers or servers that need to be reinitialized, only the download and installation operation of the installation package needs to be executed, and the required yum sources, configuration files and scripts can be automatically configured without manual configuration one by one, thereby saving time and labor costs. At the same time, the unified installation package configuration helps to improve the stability and reliability of server batch initialization.

[0092] In this embodiment, access permissions are set through the configuration file of the Web service to restrict visitors to connect only from the intranet, monitor the access log of the Web service, and obtain the access data of the intranet users for subsequent security and maintenance operations.

[0093] In some embodiments, the central machine is used to decompress the installation package and start the firewall and Web service, and the directory of the installation package is exposed to the intranet through the Web service, including:

[0094] Creating a Web service directory on the central machine, and decompressing the received installation package into the Web service directory;

[0095] Install and start a firewall on the central machine and configure firewall rules;

[0096] Start the Web service, expose the Web service directory to the intranet, and allow other servers in the intranet to access it.

[0097] In this embodiment, the firewall service is installed and started on the central machine, the firewall rules are configured to protect the Web service, the Web service is installed and started, and the service parameters are configured to support intranet access. The decompressed installation package is set in the Web service directory to ensure that intranet users can access it through the Web.

[0098] S600: pre-download the pre-downloaded installation package to a local yum source, and synchronously perform initialization operations on all servers in the aggregation group based on the local yum source.

[0099] In this embodiment, the installation packages of all servers to be initialized are pre-downloaded to the local yum source after passing through the above-mentioned S100-S500, and are embedded in a plug-in manner before the server initialization operation, so that the pre-download operation of the pre-downloaded installation package does not affect the original server batch initialization process. At the same time, the pre-downloaded installation package can be downloaded multiple times, which improves the initialization efficiency.

[0100] In some embodiments, the synchronously performing the initialization operation on all servers in the aggregation group based on the local yum source includes:

[0101] Create a configuration file for yum source management and configure the local yum source as the highest priority;

[0102] When the server is initialized, the pre-downloaded installation package is uniformly obtained from the local yum source for installation.

[0103] In this embodiment, the yum source management mechanism is adopted. When creating the configuration file of the yum source management, the local yum source is configured as the highest priority. This can ensure that when the server is initialized, the yum source will first obtain the pre-downloaded installation package from the local yum source, thereby improving efficiency and reliability, and also avoiding repeated downloading of installation packages, which causes waste of resources.

[0104] In this embodiment, each server downloads the pre-downloaded installation package from the yum source of the central machine and decompresses it, and creates a pre-downloaded installation package index in the yum source through the createrepo command, which facilitates the management of the pre-downloaded installation package of each server.

[0105] In some embodiments, the synchronously performing the initialization operation on all servers in the aggregation group based on the local yum source further includes:

[0106] Performing a quality check on the pre-downloaded installation packages in the local yum source;

[0107] For pre-downloaded installation packages that do not meet quality requirements, download and install the installation packages from the remote yum source;

[0108] For pre-downloaded installation packages that meet the quality requirements, the pre-downloaded installation packages are obtained from the local yum source for installation.

[0109] In this application, if the required pre-downloaded installation package does not exist in the local yum source or the quality of the pre-downloaded installation package does not meet the requirements, the required installation package is downloaded from the remote yum source to ensure the normal download of all installation packages, and then the downloaded installation package is installed automatically through the script. Through the application of the remote yum source, the success rate of the server batch initialization method for batch initialization of servers is improved.

[0110] In some embodiments, the installation package in the local yum source is verified using the SHA-256 algorithm. If the verification value is consistent with the verification value of the installation package in the remote yum source, it is confirmed that the local yum source has the required pre-downloaded installation package and the pre-downloaded installation package has not been tampered with or damaged.

[0111] See also Figure 2 As shown, the present invention also provides a server batch initialization system, the system comprising:

[0112] The first processing module 201 is used to obtain asset files of all servers to be initialized, wherein the asset files include the server's computer room field and intranet IP address;

[0113] The second processing module 202 is used to aggregate the servers according to the computer room field to obtain an aggregation group, and determine the number of servers and the intranet IP segment of each aggregation group;

[0114] The third processing module 203 is used to determine whether the aggregation group needs to perform a package download and distribution operation by judging whether the number of servers in the aggregation group is greater than a preset number value;

[0115] The fourth processing module 204 is used for selecting a server in the aggregation group as a central server according to a predetermined rule for the aggregation group that needs to perform the package download and distribution operation;

[0116] The fifth processing module 205 is used to download and decompress the installation package for other servers in the aggregation group through the central machine to obtain a pre-downloaded installation package, where the installation package includes files required for initializing the server;

[0117] The sixth processing module 206 is used to pre-download the pre-downloaded installation package to a local yum source, and synchronously perform an initialization operation on all servers in the aggregation group based on the local yum source.

[0118] It is understandable that if Figure 1 The contents of the server batch initialization method embodiment shown in the figure are applicable to the server batch initialization system embodiment. The functions specifically implemented by the server batch initialization system embodiment are similar to those in the example shown in the figure. Figure 1 The server batch initialization method embodiment shown is the same as that shown in FIG. Figure 1 The beneficial effects achieved by the server batch initialization method embodiment shown are also the same.

[0119] It should be noted that the information interaction, execution process and other contents between the above-mentioned systems are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0120] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0121] See also Figure 3 As shown, an embodiment of the present invention further provides a computer device 3, comprising: a memory 302 and a processor 301 and a computer program 303 stored in the memory 302. When the computer program 303 is executed on the processor 301, a server batch initialization method as described in any one of the above methods is implemented.

[0122] The computer device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of computer device 3 and does not constitute a limitation on computer device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.

[0123] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0124] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 3. Further, the memory 302 may also include both an internal storage unit of the computer device 3 and an external storage device. The memory 302 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 302 may also be used to temporarily store data that has been output or is to be output.

[0125] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the server batch initialization method as described in any one of the above methods is implemented.

[0126] In this embodiment, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / computer device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0127] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A server batch initialization method, characterized in that: include: Obtain the asset files of all servers to be initialized, including the server's computer room field and intranet IP address. Aggregate the servers according to the computer room field to obtain aggregation groups, and determine the number of servers and intranet IP segments in each aggregation group; Determining whether the aggregation group needs to perform package download and distribution operations by judging whether the number of servers in the aggregation group is greater than a preset number value; For an aggregation group that needs to perform package download and distribution operations, select a server in the aggregation group as a central server according to a predetermined rule; For other servers in the aggregation group, the central server downloads and decompresses the installation package to obtain a pre-downloaded installation package, wherein the installation package includes files required for initializing the server; The pre-downloaded installation package is pre-downloaded to a local yum source, and initialization operations are synchronously performed on all servers in the aggregation group based on the local yum source.

2. The method according to claim 1, wherein The asset files of all servers to be initialized are obtained, including: Obtain the configuration information of all servers through the configuration management system, match the configuration information with the servers to be initialized requested in the work order, and generate a preliminary asset file; Based on the role-based access control policy, conduct a multi-level review of the preliminary asset documents and obtain review opinions; The audit opinion is associated with the preliminary asset file in the form of additional attributes to obtain an asset file.

3. The method according to claim 1, wherein The step of aggregating the servers according to the computer room field to obtain an aggregation group and determining the number of servers and the intranet IP segment of each aggregation group includes: Get the computer room fields of all servers to be initialized, and divide the servers belonging to the same computer room field into the same aggregation group; Obtain the intranet IP addresses of all servers in each aggregation group and count the number of servers in each aggregation group; A regular expression is used to obtain the same network segment prefix of all intranet IPs in the aggregation group, and the network segment prefix is ​​used as the intranet IP segment corresponding to the aggregation network.

4. The method according to claim 3, wherein For other servers in the aggregation group, the central server downloads and decompresses the installation package to obtain a pre-downloaded installation package, which includes the files required to initialize the server, including: For other servers in the aggregation group, configuring the files required for initializing the servers into installation packages on the operation machine, and storing the installation packages in the central machine; Based on the central machine, decompress the installation package and start the firewall and Web service, and expose the directory of the installation package to the intranet through the Web service; For other servers in the aggregation group, the installation package is downloaded from the central computer through the intranet and decompressed.

5. The method according to claim 4, wherein The central machine decompresses the installation package and starts the firewall and Web service, and exposes the directory of the installation package to the intranet through the Web service, including: Create a Web service directory on the central machine and decompress the received installation package to the Web service directory; Install and start a firewall on the central machine and configure firewall rules; Start the Web service, expose the Web service directory to the intranet, and allow other servers on the intranet to access it.

6. The method according to claim 1, wherein The synchronously performing initialization operations on all servers in the aggregation group based on the local yum source includes: Create a configuration file for yum source management and configure the local yum source as the highest priority; When the server is initialized, the pre-downloaded installation package is obtained from the local yum source for installation.

7. The method according to claim 6, wherein The synchronously performing initialization operations on all servers in the aggregation group based on the local yum source also includes: Performing a quality check on the pre-downloaded installation packages in the local yum source; For pre-downloaded installation packages that do not meet quality requirements, download and install them from the remote yum source; For pre-downloaded installation packages that meet the quality requirements, the pre-downloaded installation packages are obtained from the local yum source and installed.

8. A server batch initialization system, characterized in that: include: The first processing module is used to obtain the asset files of all servers to be initialized, wherein the asset files include the server's computer room field and intranet IP address; The second processing module is used to aggregate the servers according to the computer room field to obtain an aggregation group, and determine the number of servers and the intranet IP segment of each aggregation group; A third processing module: configured to determine whether the aggregation group needs to perform package download and distribution operations by judging whether the number of servers in the aggregation group is greater than a preset number value; The fourth processing module is configured to select, for an aggregation group that needs to perform a package download and distribution operation, a server in the aggregation group as a central server according to a predetermined rule; A fifth processing module is configured to download and decompress the installation package for other servers in the aggregation group through the central computer to obtain a pre-downloaded installation package, wherein the installation package includes files required for initializing the server; The sixth processing module is used to pre-download the pre-downloaded installation package to a local yum source, and synchronously perform an initialization operation on all servers in the aggregation group based on the local yum source.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Batch deployment method and system of server cluster, and computer readable storage medium

    CN112272221A

  • Server deployment method, device and equipment and readable storage medium

    CN113495732A

  • User server cluster environment deployment management system and method

    CN117319196A