Distributed software deployment method and system for large-scale cluster
By installing deployment agents and configuration centers in the LAN of large-scale distributed clusters, intelligent deployment and upgrade of distributed software is solved, and the problems of inefficient deployment efficiency and complex configuration management in the existing technology are solved, and deployment efficiency and success rate are improved.
Patent Information
- Application Number
- CN202411940451.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The existing technology is difficult to quickly and efficiently deploy and upgrade software for large-scale distributed clusters. The manual deployment method is large in work and is prone to human errors. The container-based deployment method depends on the container orchestration platform and hardware virtualization functions, and does not support physical and virtual machine clusters.
By installing and deploying agents in the cluster LAN, using unified processing logic to intelligently install, uninstall, update and upgrade distributed software, realizing resource reuse, simplifying user logic for using the system, and using a centralized configuration center to check the installation and update data and cluster configuration update.
It improves the deployment efficiency and success rate of large-scale clusters, reduces the user's usage complexity and human error probability, can efficiently handle configuration data missing/error and configuration conflict issues, and solves the problem of cluster node state dependence.
Smart Images

Figure CN119960768A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed software systems, and in particular to a distributed software deployment method and system for large-scale clusters. Background Art
[0002] A distributed software system is a software system that uses a distributed architecture. The distributed architecture can ensure high throughput and high availability of the software system. In actual deployment, a distributed software system is usually installed on multiple computers, and each computer communicates with each other through the network to form a distributed cluster. Depending on the business scenario, the scale of a distributed cluster ranges from a few to thousands of machines. For large-scale distributed clusters with a large number of nodes (for example, more than 100 nodes), how to quickly deploy software on the distributed cluster has always been a problem that plagues software operation and maintenance personnel.
[0003] For software deployment in distributed clusters, the existing technology usually adopts manual deployment node by node, but the manual deployment method is only applicable to smaller-scale clusters. When facing large-scale clusters, the manual deployment method is not only huge in workload and prone to human errors, but also inefficient and difficult to meet the needs of rapid iteration and frequent updates. In order to solve the above problems, one solution is to adopt a container-based automatic software deployment method, such as using container orchestration tools such as Kubernetes' open source container orchestration platform for deployment. Such tools can automatically manage the life cycle of containerized applications, including deployment, expansion, and service discovery functions, which can greatly improve the degree of automation of the deployment process and reduce human intervention. However, the container-based deployment method depends on container orchestration platforms such as Kubernetes and hardware virtualization functions. The software needs to be containerized and packaged in advance. The deployment form is container image, and physical machine and virtual machine clusters are not supported. Summary of the invention
[0004] The technical problem to be solved by the present invention is as follows: In view of the above-mentioned problems in the prior art, a distributed software deployment and upgrade method and system with simple implementation, low cost, intelligent deployment and high efficiency is provided, which can intelligently realize distributed software deployment of large-scale clusters and improve the deployment efficiency and success rate of large-scale clusters.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A distributed software deployment method for large-scale clusters includes the following steps:
[0007] Step 1: Installation and initialization of the deployment agent and distributed cluster: Install the deployment agent on any node in the LAN of the cluster to be deployed, establish communication connections between the deployment agent and the client and distributed cluster respectively, start the deployment agent to automatically scan the IP addresses of each host in the cluster, and generate SSH public keys for each host in the cluster;
[0008] Step 2: Distributed software installation and uninstallation: The user logs in to the deployment agent through the client to check whether the user has installation permissions. If yes, a deployment task is created, and the deployment task parameters and task type are obtained. The configuration center sends basic configuration data including node roles to each node in the cluster, and the configuration center verifies whether the configuration data of each node in the target distributed cluster is missing or wrong. If the verification fails, the missing or required correct configuration data is obtained from the configuration center, and the deployment task is executed on each node in the distributed cluster according to the obtained deployment task parameters, task type and configuration data. The task types include installation and uninstallation.
[0009] Step 3: Distributed software update configuration: The user logs in to the deployment agent through the client to check whether the user has configuration permissions. If yes, the user enters the distributed software update configuration, obtains the configuration parameters and sends them to the target distributed cluster to control the target distributed cluster to update the parameters, and verifies the local data of each node in the target distributed cluster with the configuration data sent by the configuration center. If there is conflicting data, the data is synchronized according to the status of each node;
[0010] Step 4: Distributed software upgrade: The user logs in to the deployment agent through the client to check whether the user has upgrade permissions. If yes, the distributed software upgrade configuration is entered. The current upgrade task is associated with the historical installation task, and the task template corresponding to the historical installation task is selected as the task template of the current upgrade task to obtain the upgrade task parameters. After uploading the software package required for the upgrade, the target distributed cluster is upgraded. The status of each node in the target distributed cluster is obtained through the configuration center to calculate the upgrade order of each node, and the data containing the upgrade order is sent to each node to update the cluster configuration.
[0011] Further, step 1 comprises:
[0012] Step 101. Deploy a firewall between the client and the deployment agent, and enable a client IP address whitelist on the firewall to control that only clients on the whitelist are allowed to pass through the firewall;
[0013] Step 102. After the deployment agent is installed in the cluster LAN to be deployed, the host scanning tool of the deployment agent service is started to automatically scan the IP addresses of the cluster hosts;
[0014] Step 103. Group the cluster host IP addresses and add the SSH public key for each host. If the host does not have a public key, generate one using the command.
[0015] Step 104.6. Create the user and password required by the client on the deployment agent and set permissions, and generate a digital certificate for the client.
[0016] Furthermore, the step 2 comprises:
[0017] Step 201: The user logs in to the deployment agent through the client using a pre-created user name and password;
[0018] Step 202: The deployment agent checks whether the user has installation authority. If yes, the process goes to step 203. Otherwise, the current process ends.
[0019] Step 203: Enter the deployment task management phase and create a deployment task;
[0020] Step 204: Select whether to import from a template. If yes, select a deployment template. Otherwise, directly create a task template.
[0021] Step 205: Obtain task parameters and task type according to the current task template, wherein the task parameters include any of task number, task remarks, task executor, script path, script parameters, and execution order;
[0022] Step 206: Determine the current task type. If it is an installation task, upload the software package to be installed through the client and load it to the deployment agent, and then proceed to step 207. If it is an uninstallation task, then proceed directly to step 207.
[0023] Step 207: The configuration center sends basic configuration data including node roles to each node in the cluster;
[0024] Step 208: The configuration center verifies whether the configuration data of each node in the target distributed cluster is missing or wrong. If the verification fails, the missing or required correct configuration data is obtained from the configuration center.
[0025] Step 209. Execute tasks on each node in the distributed cluster according to the acquired task parameters and configuration data until the deployment tasks on all selected nodes are completed. If it is an installation task, install the software packages one by one on the distributed cluster until the software packages on all selected nodes are installed. If it is an uninstallation task, execute the uninstallation command on each node in the distributed cluster until the software on all selected nodes has been safely removed.
[0026] Step 210: Check whether the deployment tasks of each node in the distributed cluster are successfully executed. If not, return to step 207 and try to execute the task again.
[0027] Furthermore, the step 3 comprises:
[0028] Step 301: The user logs in to the deployment agent through the client using the pre-created user name and password;
[0029] Step 302: The deployment agent checks whether the user has the configuration permission. If yes, it goes to step 303, otherwise, the current process ends;
[0030] Step 303: determine whether the configuration parameter input mode is batch import, if yes, obtain a group of configuration parameters in the batch import configuration file, otherwise register the configuration parameters one by one to obtain a group of configuration parameters;
[0031] Step 304: Send the configuration parameters acquired in step 303 to the target cluster to control the target distributed cluster to update the parameters;
[0032] Step 305: Verify the local data of each node in the target distributed cluster with the configuration data sent by the configuration center. If there is conflicting data, update the conflicting node with the configuration data of the configuration center, obtain the status of the remaining nodes in the target distributed cluster, and calculate the latest synchronization data.
[0033] Step 306: Determine whether the cluster needs to be restarted. If yes, restart the cluster nodes one by one in a rolling restart manner, such as until all nodes are restarted. Otherwise, exit the current process.
[0034] Step 307: Check whether the current configuration update is successful. If not, return to step 304 to re-send the configuration parameter number.
[0035] Furthermore, in step 304, the configuration parameters are sent down by writing the configuration parameters obtained in step 303 into a designated file of the target cluster or directly writing the configuration parameters obtained in step 303 through an interface of the cluster.
[0036] Further, step 4 includes:
[0037] Step 401: The user logs in to the deployment agent through the client using a pre-created user name and password;
[0038] Step 402: The deployment agent checks whether the user has the upgrade permission. If yes, the process goes to step 403. Otherwise, the current process ends.
[0039] Step 403: Select a historical installation task and associate it with the current upgrade task, and use the task template of the selected historical installation task as the task template of the current upgrade task to achieve template reuse;
[0040] Step 404: Obtain upgrade task parameters according to the task template obtained in step 403, wherein the upgrade task parameters include any one or more of an upgrade script, an upgrade configuration file path, a task responsible person, a task description, and a rollback script;
[0041] Step 405: Upload a full or incremental software package to the deployment agent to execute the upgrade task, wherein the full software package is all software package data, and the incremental software package is the software package data updated before and after the upgrade;
[0042] Step 406: The configuration center communicates with each node in the target distributed cluster to collect the status of each node in the cluster, and calculates the upgrade order of each node according to the status of each node;
[0043] Step 407: Send the data including the upgrade sequence of each node to each node in the target distributed cluster to update the cluster configuration;
[0044] Step 408: Execute the upgrade script on each node of the target distributed cluster in a rolling upgrade mode until the upgrade of all cluster nodes is completed;
[0045] Step 409: Check whether each node in the cluster is upgraded successfully. If there is a cluster node upgrade failure, return to step 406 to retry the upgrade, or perform a rollback operation to cancel the upgrade task.
[0046] A system for implementing the above-mentioned distributed software deployment method for large-scale clusters, comprising:
[0047] The client is used to provide an interface with the deployment agent for data input and output;
[0048] Deployment agent, deployed on any node in the cluster LAN, used to perform distributed cluster management and deployment task agent;
[0049] Distributed clusters, including multiple physical or virtual machines;
[0050] The client and the distributed cluster communicate with the deployment agent respectively through HTTP connection.
[0051] Further, the deployment agent includes:
[0052] Distributed cluster management unit, used to implement distributed cluster host addition, batch import, host grouping and cluster information management;
[0053] The deployment task management unit is used to implement three types of deployment tasks: installation, upgrade, and update provided by the distributed cluster, and to implement any one or more of task editing, task execution, task rollback, and task retry;
[0054] The configuration center unit is used to centrally manage the configuration parameter management function of the distributed cluster and provide the corresponding configuration parameters to the distributed cluster during the execution of the deployment task;
[0055] A software package management unit, used to implement software package management;
[0056] Role and authority management unit, used to implement user management, user authority management and user role management, so as to control different users to access and operate the system according to different authorities;
[0057] A system configuration unit, used to implement system configuration, wherein the configuration includes any one or more of the startup memory size, data storage path, and user blacklist and whitelist;
[0058] The template management unit is used to manage task templates.
[0059] Furthermore, it also includes a distributed cluster management module, which includes a node management unit, a storage management unit, and a network management unit, which are respectively used to perform node management, storage management, and network management on the distributed cluster. The nodes of the distributed cluster are added and deleted through the node management unit, the storage capacity of the distributed cluster is expanded and reduced through the storage management unit, and the IP network segment, gateway address, etc. of the distributed cluster are managed through the network management unit.
[0060] A computer-readable storage medium storing a computer program, wherein the computer program implements the above method when executed by a processor.
[0061] Compared with the prior art, the advantages of the present invention are:
[0062] 1. The present invention installs a deployment agent in the cluster local area network, and uses the deployment agent to intelligently install / uninstall, update and upgrade distributed software using a unified processing logic, so that resource reuse can be achieved between each process, and the logic of user use of the system is simplified. It can not only improve the management efficiency and deployment efficiency of large-scale clusters, but also reduce the complexity of user use and the probability of user misoperation. At the same time, a centralized configuration center is used to perform data verification on installation and update, and cluster configuration updates during the upgrade process. It can also efficiently send configuration data matching different role nodes to their roles during the installation process, conveniently handle the problem of missing / wrong configuration data during the deployment process, effectively synchronize configuration data during the update process to resolve configuration conflicts, and resolve cluster node status dependency during the upgrade process.
[0063] 2. The present invention installs a deployment agent in the cluster LAN, creates deployment tasks through the deployment agent, and automatically executes deployment tasks on each node in the distributed cluster. It can manage cluster hosts in batches and automatically initialize and debug the cluster hosts. The whole process is highly automated and does not require manual installation and debugging of each host, which greatly reduces the process of manual intervention. It can not only improve the management efficiency and deployment efficiency of large-scale clusters, but also reduce the risk of errors caused by human operations, while improving the success rate of distributed software deployment.
[0064] 3. The present invention further automates and encapsulates the distributed software deployment process and abstracts it into a reusable task template. The configuration parameters are centrally managed and automatically distributed in the form of files through the configuration center. There is no need to manually modify the deployment parameters, debug the software, or modify the distributed software. This can greatly improve the deployment and upgrade efficiency of distributed software. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is a system architecture applicable to the embodiments of the present invention.
[0066] Figure 2 The figure is a schematic diagram of the implementation flow of distributed software installation and uninstallation in a specific application embodiment of the present invention.
[0067] Figure 3 The figure is a schematic diagram of the implementation process of the distributed software update configuration in the embodiment of the present invention.
[0068] Figure 4 The figure is a schematic diagram of the distributed software upgrade implementation process in an embodiment of the present invention.
[0069] Figure 5 It is a schematic diagram of the system architecture principle in a specific application embodiment of the present invention. DETAILED DESCRIPTION
[0070] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0071] Since installation / uninstallation, updating and upgrading are different tasks, they are usually executed independently in the traditional distributed software deployment process, and the processes of installation / uninstallation, updating and upgrading are quite different. The various execution processes cannot reuse resources. For example, installation and uninstallation do not need to consider retaining historical data, but updating and upgrading must retain historical data. In addition, the task processes and task scripts of installation / uninstallation, updating and upgrading cannot be directly reused. Therefore, it is not only complicated to implement, but also requires more resources and high costs.
[0072] For the deployment of large-scale distributed software, since the distributed software is logically integrated but physically divided into different parts, the maintenance of configuration data is a difficult problem during the installation, deployment, update, and upgrade process. For example, during the installation process, it is difficult to issue configuration data that matches the roles of different role nodes; during the deployment process, it is difficult to deal with the problems of missing and incorrect configuration data; during the update process, it is difficult to synchronize configuration data, which will lead to configuration conflicts; during the upgrade process, it is difficult to solve the problem of cluster node status dependency.
[0073] The present invention comprehensively considers the above-mentioned problems, installs a deployment agent in the cluster local area network, and uses the deployment agent to intelligently install / uninstall, update and upgrade distributed software with a unified processing logic, so that resource reuse can be achieved between each process, and the logic of user use of the system is simplified. It can not only improve the management efficiency and deployment efficiency of large-scale clusters, but also reduce the complexity of user use and the probability of user misoperation. At the same time, a centralized configuration center is used to perform data verification on installation and update, and cluster configuration updates during the upgrade process. It can also efficiently send configuration data matching the roles of different role nodes during the installation process, conveniently handle the problem of missing / wrong configuration data during the deployment process, effectively synchronize configuration data during the update process to resolve configuration conflicts, and resolve cluster node status dependency during the upgrade process.
[0074] Figure 1The system architecture applicable to this embodiment may include: a client, a deployment agent, and a distributed cluster. The client is used to provide an interface with the deployment agent for data input and output; the deployment agent is deployed on any node in the cluster LAN and is used to perform distributed cluster management and deployment task agent; the distributed cluster includes multiple physical machines or virtual machines; the client communicates with the deployment agent through HTTP connection, and the deployment agent and the distributed cluster are deployed on different computers and connected through HTTP. In the initialization phase, the deployment agent is started to automatically scan the IP addresses of each host in the cluster and generate SSH public keys for each host in the cluster. When it is necessary to perform distributed software installation and uninstallation, the user logs in to the deployment agent through the client, creates a deployment task if there is installation permission, selects the deployment template, obtains the deployment task parameters and the task type (installation or uninstallation), and then executes the deployment task on each node in the distributed cluster according to the deployment task parameters; when it is necessary to perform distributed software update configuration, the user logs in to the deployment agent through the client, and the deployment agent batch imports or registers the configuration parameters one by one and then sends them to the target distributed cluster to perform distributed software update configuration.
[0075] In this embodiment, the communication link between the client and the deployment agent can be reinforced by using a security reinforcement method. Specifically, the following methods can be used for security reinforcement:
[0076] 1. Deploy a firewall between the client and the deployment agent, enable a whitelist on the firewall, and only allow clients on the whitelist to pass through the firewall. Clients outside the whitelist will be blocked by the firewall.
[0077] 2. The client must use the correct identity credentials to log in to the deployment agent. The identity credentials can be passwords, digital signature certificates, hardware key cards, etc.
[0078] 3. The communication between the client and the deployment agent uses the TLS1.3 / HTTPS security protocol.
[0079] The communication link between the deployment agent and the distributed cluster can also be hardened. For example, the same hardening method as the communication link from the client to the deployment agent can be used, except that a firewall is not set.
[0080] Based on the above system, the steps of the distributed software deployment method for large-scale clusters in this embodiment include:
[0081] Step 1: Installation and initialization of the deployment agent and distributed cluster: Install the deployment agent on any node in the LAN of the cluster to be deployed, establish communication connections between the deployment agent and the client and distributed cluster respectively, start the deployment agent to automatically scan the IP addresses of each host in the cluster, and generate SSH public keys for each host in the cluster.
[0082] The deployment agent can be deployed on any machine in the cluster LAN. The deployment agent and the distributed cluster can be deployed on different computers respectively and communicate with the deployment agent through network devices. In the case of limited resources, the client and the deployment agent can also be deployed on the same computer.
[0083] As an optional implementation, Figure 2 As shown, the installation and initialization of the deployment agent and distributed cluster can be done in the following steps:
[0084] Step 101. Deploy a firewall between the client and the deployment agent, and enable a client IP address whitelist on the firewall to control that only clients on the whitelist are allowed to pass through the firewall;
[0085] Step 102. After the deployment agent is installed in the cluster LAN to be deployed, the host scanning tool of the deployment agent service is started to automatically scan the IP addresses of the cluster hosts;
[0086] Step 103. Group the cluster host IP addresses and add the SSH public key for each host. If the host does not have a public key, generate one using the command.
[0087] Step 104.6. Create the user and password required by the client on the deployment agent and set permissions, and generate a digital certificate for the client.
[0088] Specifically, during the system installation and initialization process, first determine the scale of the distributed cluster and its environment, and the cluster is located in the same LAN; install the deployment agent on any machine in the cluster LAN; then start the host scanning tool in the distributed cluster management module of the deployment agent service, enter the network segment of the distributed cluster, and automatically scan the IP of the cluster host, for example, scan all hosts in the 192.168.10.0 / 24 network segment: nmap-sn 192.168.10.0 / 24; then group the cluster host IPs, add an SSH public key to each host, if the host does not have a public key, use a command to generate it, for example, command: ssh-keygen-t rsa-b 4096, to complete the installation and initialization of the deployment agent and distributed cluster.
[0089] The process of installing the deployment agent also includes creating the user and password required by the client and setting permissions, and finally generating a digital certificate for the client. During the installation and initialization of the client, you need to install a digital certificate on the client and add the client IP address to the whitelist on the firewall to complete the installation and initialization of the client. This completes the installation and initialization of the deployment agent, client, and distributed cluster.
[0090] Step 2: Distributed software installation and uninstallation: The user logs in to the deployment agent through the client to check whether the user has installation permissions. If yes, a deployment task is created to obtain deployment task parameters and task types. The configuration center sends basic configuration data including node roles to each node in the cluster, and verifies whether the configuration data of each node in the target distributed cluster is missing or wrong. If the verification fails, the missing or required correct configuration data is obtained from the configuration center, and the deployment task is executed on each node in the distributed cluster according to the obtained deployment task parameters, task type and configuration data. The task types include installation and uninstallation.
[0091] As an optional implementation, Figure 3 As shown, the distributed software installation and uninstallation can be done in the following steps:
[0092] Step 201: The user logs in to the deployment agent through the client using a pre-created user name and password;
[0093] Specifically, on the client, the user logs in to the deployment agent using a pre-created user and password. If a hardware key card is configured, the key card needs to be inserted.
[0094] Step 202: The deployment agent checks whether the user has the installation permission (INSTALL_PRIL). If yes, the process goes to step 203. Otherwise, if the user is not granted the installation permission, the current process ends.
[0095] Step 203: Enter the deployment task management phase and create a deployment task;
[0096] Step 204: Select whether to import from a template. If yes, select a deployment template. Otherwise, directly create a task template to create a task flow as needed.
[0097] Step 205: Obtain task parameters and task type according to the current task template. Task parameters include task number, task remarks, task executor, script path, script parameters, execution order, etc. If it is an installation task, the script path is the installation script path, and the execution order is the installation order. If it is an uninstallation task, the script path is the uninstallation script path, and the execution order is the uninstallation order.
[0098] Step 206: Determine the current task type. If it is an installation task, upload the software package to be installed through the client and load it to the deployment agent, and then proceed to step 207. If it is an uninstallation task, then proceed directly to step 207.
[0099] Step 207: The configuration center sends basic configuration data including node roles to each node in the cluster;
[0100] Step 208: The configuration center verifies whether the configuration data of each node in the target distributed cluster is missing or wrong. If the verification fails, the missing or required correct configuration data is obtained from the configuration center.
[0101] Step 209. Execute tasks on each node in the distributed cluster according to the acquired task parameters and configuration data until the deployment tasks on all selected nodes are completed. If it is an installation task, install the software packages one by one on the distributed cluster until the software packages on all selected nodes are installed. If it is an uninstallation task, execute the uninstallation command on each node in the distributed cluster until the software on all selected nodes has been safely removed.
[0102] Step 210: Check whether the deployment tasks of each node in the distributed cluster are successfully executed. If not, return to step 207 and try to execute the task again.
[0103] The above task template is specifically a structured data structure, including task number, task executor, task authority, cluster configuration data, task process, task script, task parameters and other data. After all tasks are successfully created, a task template will be automatically generated and persisted in storage systems such as file systems and databases. Based on task templates, the task creation process can be simplified, the task success rate can be improved, and task debugging and task auditing can be facilitated.
[0104] Step 3: Distributed software update configuration: The user logs in to the deployment agent through the client to detect whether the user has configuration permissions. If yes, enter the distributed software update configuration, obtain a set of configuration parameters by batch importing or registering configuration parameters one by one, and send the obtained configuration parameters to the target distributed cluster to control the target distributed cluster to update parameters.
[0105] As an optional implementation, Figure 4 As shown, the distributed software update configuration can be implemented in the following steps:
[0106] Step 301: The user logs in to the deployment agent through the client using the pre-created user name and password. If a hardware key card is configured, the key card needs to be inserted;
[0107] Step 302: The deployment agent checks whether the user has configuration permission (CONFIG_PRIL). If yes, it goes to step 303, otherwise, the current process ends;
[0108] Step 303: determine whether the configuration parameter input mode is batch import, if yes, obtain a group of configuration parameters in the batch import configuration file, otherwise register the configuration parameters one by one to obtain a group of configuration parameters;
[0109] Step 304: Send the configuration parameters acquired in step 303 to the target cluster to control the target distributed cluster to update the parameters;
[0110] Step 305: Verify the local data of each node in the target distributed cluster with the configuration data sent by the configuration center. If there is conflicting data, update the conflicting node with the configuration data of the configuration center, obtain the status of the remaining nodes in the target distributed cluster, and calculate the latest synchronization data.
[0111] Step 306: Determine whether the cluster needs to be restarted. If yes, restart the cluster nodes one by one in a rolling restart manner, such as until all nodes are restarted. Otherwise, exit the current process.
[0112] Step 307: Check whether the current configuration update is successful. If not, return to step 304 to re-send the configuration parameters.
[0113] For example, in the above step 305, a consensus algorithm can be used to calculate synchronization data based on the status of each node, that is, the local data of each node in the cluster is compared with the configuration data issued by the configuration center. If there is conflicting data, the data of the configuration center shall prevail. Then, communication with other nodes is performed to obtain the status of each node, and the latest synchronization data is calculated by the consensus algorithm to confirm that the data status of the entire cluster is consistent.
[0114] In a specific application embodiment, a configuration file sample is as follows:
[0115] cluster1.database.master=192.168.10.1
[0116] cluster1.database.slaves=192.168.10.2,192.168.10.3,192.168.10.4
[0117] cluster1.name=Cassandra_Cluster
[0118] nginx.vip=192.168.10.100
[0119] …
[0120] Optionally, configuration parameters can be issued in two different ways, such as by writing the registered configuration parameters obtained in step 303 to a specified file of the target cluster, or by directly writing the registered configuration parameters obtained in step 303 through the cluster interface (such as the JMX interface) to achieve the issuance of configuration parameters.
[0121] This embodiment uses a rolling restart method during the distributed software update configuration process to ensure that the functions provided by the distributed cluster are not interrupted and improve the stability and reliability of the system.
[0122] Step 4: Distributed software upgrade: The user logs in to the deployment agent through the client to check whether the user has upgrade permissions. If the user has permissions, the distributed software upgrade configuration is entered. The current upgrade task is associated with the historical installation task, and the task template corresponding to the historical installation task is selected as the task template of the current upgrade task to obtain the upgrade task parameters. After uploading the software package required for the upgrade, the target distributed cluster is upgraded.
[0123] like Figure 4 As shown, the steps include:
[0124] Step 401: The user logs in to the deployment agent through the client using the pre-created user name and password. If a hardware key card is configured, the key card needs to be inserted;
[0125] Step 402: The deployment agent checks whether the user has the upgrade privilege (UPDATE_PRIL). If yes, the process proceeds to step 403. Otherwise, the current process ends.
[0126] Step 403: Select a historical installation task and associate it with the current upgrade task, and use the task template of the selected historical installation task as the task template of the current upgrade task to achieve template reuse, that is, directly reuse the historical task template;
[0127] Step 404: Obtain upgrade task parameters according to the task template obtained in step 403. The upgrade task parameters include upgrade script, upgrade configuration file path, task responsible person, task description, rollback script, etc.;
[0128] Step 405: Upload a full or incremental software package to the deployment agent, wherein the full software package is all software package data, and the incremental software package is the software package data updated before and after the upgrade. Uploading the incremental software package can reduce the amount of data transmission;
[0129] Step 405: Upload a full or incremental software package to the deployment agent to execute the upgrade task, wherein the full software package is all software package data, and the incremental software package is the software package data updated before and after the upgrade;
[0130] Step 406: The configuration center communicates with each node in the target distributed cluster to collect the status of each node in the cluster, and calculates the upgrade order of each node according to the status of each node;
[0131] Step 407: Send the data including the upgrade sequence of each node to each node in the target distributed cluster to update the cluster configuration;
[0132] Step 408: Execute the upgrade script on each node of the target distributed cluster in a rolling upgrade mode until the upgrade of all cluster nodes is completed;
[0133] Step 409: Check whether each node in the cluster is upgraded successfully. If there is a cluster node upgrade failure, return to step 406 to retry the upgrade, or perform a rollback operation to cancel the upgrade task.
[0134] In the above step 403, the historical installation task can be associated with the current upgrade task in the following two ways:
[0135] 1. Select association: The system lists all historical installation tasks and provides them to the user for selection. After receiving the user's selection, the historical installation task selected by the user is associated with the current upgrade task.
[0136] 2. Automatic association: The system selects the most recent installation task from historical tasks based on user role, task name and other information and associates it with the current upgrade task.
[0137] The above two modes can also be switched to each other, and the user can select the association mode.
[0138] After the association is successful, the current upgrade task reuses the data in the task template of the historical installation task, such as cluster configuration, task parameters, task script, etc., so that the current upgrade task can be quickly executed using the data of the historical installation task.
[0139] It can be understood that this embodiment does not limit the order of the above steps. The execution order of the above installation / uninstallation, update and upgrade steps can be determined according to actual needs. For example, the software update can be performed first and then the software upgrade, or the software upgrade can be performed first and then the software update. The upgrade and update can be performed periodically or dynamically according to actual needs.
[0140] This embodiment can ensure that the functions of the distributed cluster are not interrupted during the upgrade process and improve the stability and reliability of the system by executing the upgrade tasks in a rolling upgrade mode during the distributed software upgrade process; by reusing historical task templates, the upgrade process can be simplified and the upgrade efficiency can be further improved.
[0141] This embodiment automates and encapsulates the distributed software deployment process and abstracts it into a reusable task template. The configuration parameters are centrally managed and automatically distributed in the form of files through the configuration center. There is no need to manually modify deployment parameters, debug software, or modify distributed software, which can greatly improve the deployment and upgrade efficiency of distributed software.
[0142] Furthermore, during the deployment process, all deployment tasks can be automatically recorded: including operators, operation time, software version, parameter files, log files, etc., to facilitate user auditing and review, which can further improve the success rate of distributed software deployment.
[0143] In a specific application embodiment, first, according to Figure 1 The system composition shown installs and debugs the software and hardware systems, prepares the software package and configuration files, and performs the initial configuration. Then, according to the installation / uninstallation, parameter update or upgrade tasks to be performed, the deployment tasks are performed according to the above process to confirm whether the software is successfully deployed in the distributed cluster. If unsuccessful, follow the retry or rollback process.
[0144] In a specific application embodiment, Figure 5 As shown, the client provides a graphical interface as the interface for human-computer interaction, and provides data input and output functions through IO devices, such as the import and export functions of software packages. It communicates with the deployment agent through network devices. In the case of limited resources, the client and the deployment agent can also be deployed on the same computer. The distributed cluster consists of multiple physical machines or virtual machines, and can provide node management, storage management, and network management functions. The nodes of the distributed cluster are added and deleted through the node management unit, the storage capacity of the distributed cluster is expanded and reduced through the storage management unit, and the IP network segment, gateway address, etc. of the distributed cluster are managed through the network management unit.
[0145] In a specific application embodiment, Figure 5 As shown, the deployment agent may include:
[0146] Distributed cluster management unit, used to implement distributed cluster host addition, batch import, host grouping and cluster information management;
[0147] The deployment task management unit is used to implement three types of deployment tasks: installation, upgrade, and update provided by the distributed cluster, and to implement any one or more of task editing, task execution, task rollback, and task retry;
[0148] The configuration center unit is used to centrally manage the configuration parameter management function of the distributed cluster and provide the corresponding configuration parameters to the distributed cluster during the execution of the deployment task;
[0149] A software package management unit, used to implement software package management;
[0150] Role and authority management unit, used to implement user management, user authority management and user role management, so as to control different users to access and operate the system according to different authorities;
[0151] A system configuration unit, used to implement system configuration, wherein the configuration includes any one or more of the startup memory size, data storage path, and user blacklist and whitelist;
[0152] Template management unit, used to manage task templates
[0153] According to the above structure, the distributed cluster management unit can provide the distributed cluster with functions such as manual host addition, batch import, host grouping, and cluster information management; the deployment task management unit can provide the distributed cluster with three types of deployment tasks: installation, upgrade, and update, and provide functions such as task editing, task execution, task rollback, and task retry; the configuration center unit can provide a centralized configuration parameter management function for the distributed cluster, and when executing the deployment task, the distributed cluster can obtain the corresponding configuration parameters from the configuration center; the software package management unit can provide functions such as software package import and export, version management, and signature verification; the role and permission management unit can provide user management, user permission management, and user role management functions, so that different users can access and operate the system according to different permissions; the system configuration unit can provide the configuration functions of the system, such as startup memory size, data storage path, user black and white lists, etc.; the template management unit can provide the functions of saving, editing, importing, and exporting task templates, so as to facilitate the rapid reuse of deployment tasks.
[0154] Optionally, the deployment agent can also be configured with a remote terminal to provide users with the function of remotely connecting to the distributed cluster host, and the user can directly operate the host through the remote terminal. The deployment agent can also be configured with an operation and maintenance help unit to provide user help, fault handling, use wizards and other functions, so that users can use the system more friendly.
[0155] This embodiment further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above method is implemented.
[0156] Those skilled in the art will appreciate that the above-mentioned embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0157] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A distributed software deployment method for large-scale clusters, characterized in that: The following steps are involved: Step 1: Installation and initialization of the deployment agent and distributed cluster: Install the deployment agent on any node in the LAN of the cluster to be deployed, establish communication connections between the deployment agent and the client and distributed cluster respectively, start the deployment agent to automatically scan the IP addresses of each host in the cluster, and generate SSH public keys for each host in the cluster; Step 2: Distributed software installation and uninstallation: The user logs in to the deployment agent through the client to check whether the user has installation permissions. If yes, a deployment task is created, and the deployment task parameters and task type are obtained. The configuration center sends basic configuration data including node roles to each node in the cluster, and the configuration center verifies whether the configuration data of each node in the target distributed cluster is missing or wrong. If the verification fails, the missing or required correct configuration data is obtained from the configuration center, and the deployment task is executed on each node in the distributed cluster according to the obtained deployment task parameters, task type and configuration data. The task types include installation and uninstallation. Step 3: Distributed software update configuration: The user logs in to the deployment agent through the client to check whether the user has configuration permissions. If yes, the user enters the distributed software update configuration, obtains the configuration parameters and sends them to the target distributed cluster to control the target distributed cluster to update the parameters, and verifies the local data of each node in the target distributed cluster with the configuration data sent by the configuration center. If there is conflicting data, the data is synchronized according to the status of each node; Step 4: Distributed software upgrade: The user logs in to the deployment agent through the client to check whether the user has upgrade permissions. If yes, the distributed software upgrade configuration is entered. The current upgrade task is associated with the historical installation task, and the task template corresponding to the historical installation task is selected as the task template of the current upgrade task to obtain the upgrade task parameters. After uploading the software package required for the upgrade, the target distributed cluster is upgraded. The status of each node in the target distributed cluster is obtained through the configuration center to calculate the upgrade order of each node, and the data containing the upgrade order is sent to each node to update the cluster configuration.
2. The distributed software deployment method for large-scale clusters according to claim 1, characterized in that: Step 1 includes: Step 101. Deploy a firewall between the client and the deployment agent, and enable a client IP address whitelist on the firewall to control that only clients on the whitelist are allowed to pass through the firewall; Step 102. After the deployment agent is installed in the cluster LAN to be deployed, the host scanning tool of the deployment agent service is started to automatically scan the IP addresses of the cluster hosts; Step 103. Group the cluster host IP addresses and add an SSH public key to each host. If the host does not have a public key, generate one using the command. Step 104.
6. Create the user and password required by the client on the deployment agent and set permissions, and generate a digital certificate for the client.
3. The distributed software deployment method for large-scale clusters according to claim 1, characterized in that: The step 2 comprises: Step 201: The user logs in to the deployment agent through the client using a pre-created user name and password; Step 202: The deployment agent checks whether the user has installation authority. If yes, the process goes to step 203. Otherwise, the current process ends. Step 203: Enter the deployment task management phase and create a deployment task; Step 204: Select whether to import from a template. If yes, select a deployment template. Otherwise, directly create a task template. Step 205: Obtain task parameters and task type according to the current task template, wherein the task parameters include any of task number, task remarks, task executor, script path, script parameters, and execution order; Step 206: Determine the current task type. If it is an installation task, upload the software package to be installed through the client and load it to the deployment agent, and then proceed to step 207. If it is an uninstallation task, then proceed directly to step 207. Step 207: The configuration center sends basic configuration data including node roles to each node in the cluster; Step 208: The configuration center verifies whether the configuration data of each node in the target distributed cluster is missing or wrong. If the verification fails, the missing or required correct configuration data is obtained from the configuration center. Step 209. Execute tasks on each node in the distributed cluster according to the acquired task parameters and configuration data until the deployment tasks on all selected nodes are completed. If it is an installation task, install the software packages one by one on the distributed cluster until the software packages on all selected nodes are installed. If it is an uninstallation task, execute the uninstallation command on each node in the distributed cluster until the software on all selected nodes has been safely removed. Step 210: Check whether the deployment tasks of each node in the distributed cluster are successfully executed. If not, return to step 207 and try to execute the task again.
4. The distributed software deployment method for large-scale clusters according to claim 1, characterized in that: The step 3 comprises: Step 301: The user logs in to the deployment agent through the client using the pre-created user name and password; Step 302: The deployment agent checks whether the user has the configuration permission. If yes, it goes to step 303, otherwise, the current process ends; Step 303: determine whether the configuration parameter input mode is batch import, if yes, obtain a group of configuration parameters in the batch import configuration file, otherwise register the configuration parameters one by one to obtain a group of configuration parameters; Step 304: Send the configuration parameters acquired in step 303 to the target cluster to control the target distributed cluster to update the parameters; Step 305: Verify the local data of each node in the target distributed cluster with the configuration data sent by the configuration center. If there is conflicting data, update the conflicting node with the configuration data of the configuration center, obtain the status of the remaining nodes in the target distributed cluster, and calculate the latest synchronization data; Step 306: Determine whether the cluster needs to be restarted. If yes, restart the cluster nodes one by one in a rolling restart manner, such as until all nodes are restarted. Otherwise, exit the current process. Step 307: Check whether the current configuration update is successful. If not, return to step 304 to re-send the configuration parameters.
5. The distributed software deployment method for large-scale clusters according to claim 4, characterized in that: In step 304, the configuration parameters are sent down by writing the configuration parameters obtained in step 303 into a designated file of the target cluster or directly writing the configuration parameters obtained in step 303 through an interface of the cluster.
6. The distributed software deployment method for large-scale clusters according to any one of claims 1 to 5, characterized in that: Step 4 includes: Step 401: The user logs in to the deployment agent through the client using a pre-created user name and password; Step 402: The deployment agent checks whether the user has the upgrade permission. If yes, the process goes to step 403. Otherwise, the current process ends. Step 403: Select a historical installation task and associate it with the current upgrade task, and use the task template of the selected historical installation task as the task template of the current upgrade task to achieve template reuse; Step 404: Obtain upgrade task parameters according to the task template obtained in step 403, wherein the upgrade task parameters include any one or more of an upgrade script, an upgrade configuration file path, a task responsible person, a task description, and a rollback script; Step 405: Upload a full or incremental software package to the deployment agent to execute the upgrade task, wherein the full software package is all software package data, and the incremental software package is the software package data updated before and after the upgrade; Step 406: The configuration center communicates with each node in the target distributed cluster to collect the status of each node in the cluster, and calculates the upgrade order of each node according to the status of each node; Step 407: Send the data including the upgrade sequence of each node to each node in the target distributed cluster to update the cluster configuration; Step 408: Execute the upgrade script on each node of the target distributed cluster in a rolling upgrade mode until the upgrade of all cluster nodes is completed; Step 409: Check whether each node in the cluster is upgraded successfully. If there is a cluster node upgrade failure, return to step 406 to retry the upgrade, or perform a rollback operation to cancel the upgrade task.
7. A system for implementing the distributed software deployment method for large-scale clusters as described in any one of claims 1 to 6, characterized in that: include: The client is used to provide an interface with the deployment agent for data input and output; Deployment agent, deployed on any node in the cluster LAN, used to perform distributed cluster management and deployment task agent; Distributed clusters, including multiple physical or virtual machines; The client and the distributed cluster communicate with the deployment agent respectively through HTTP connection.
8. The system according to claim 7, characterized in that The deployment agent includes: Distributed cluster management unit, used to implement distributed cluster host addition, batch import, host grouping and cluster information management; The deployment task management unit is used to implement three types of deployment tasks: installation, upgrade, and update provided by the distributed cluster, and to implement any one or more of task editing, task execution, task rollback, and task retry; The configuration center unit is used to centrally manage the configuration parameter management function of the distributed cluster and provide the corresponding configuration parameters to the distributed cluster during the execution of the deployment task; A software package management unit, used to implement software package management; Role and authority management unit, used to implement user management, user authority management and user role management, so as to control different users to access and operate the system according to different authorities; A system configuration unit, used to implement system configuration, wherein the configuration includes any one or more of the startup memory size, data storage path, and user blacklist and whitelist; The template management unit is used to manage task templates.
9. The system according to claim 7, characterized in that It also includes a distributed cluster management module, which includes a node management unit, a storage management unit, and a network management unit, which are respectively used to perform node management, storage management, and network management on the distributed cluster. The nodes of the distributed cluster are added and deleted through the node management unit, the storage capacity of the distributed cluster is expanded and reduced through the storage management unit, and the IP network segment, gateway address, etc. of the distributed cluster are managed through the network management unit.
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 6 is implemented.
Citation Information
Patent Citations
Multi-super-computing-center software system deployment and incremental updating method in wide-area environment
CN111131146A
Cluster security check method, apparatus and device, and storage medium
CN116962260A
Agent-based distributed application dynamic deployment and upgrade method
CN117850812A
Constraint-based upgrade and deployment
US20190369980A1