The application deployment system proposed by the present invention has a structural composition such as figure 1 Shown, including client, server and database; to solve the problem of application version deployment and application version rollback in application deployment management. The system deployment of the present invention is as Figure 7 As shown, the specific implementation and deployment methods are as follows:
 You can choose to deploy PostgreSQL9.0.18 as the system database.
 Deploy the client to at least one host node as a client.
 Deploy the server to a host node as the server.
 The database can be based on the open source database system PostgreSQL 9.0.18, which is mainly used to store the system's host resources, application information, operator information, and logs and monitoring data generated during system operation. It can be configured through the master-slave mechanism of the PostgreSQL database Database and deploy slave nodes on the server side to ensure the availability of the database.
 The client can be based on the Python Tornado open-source web server framework to design a program for controlling client host resources and applications. Tornado makes effective use of the characteristics of non-blocking servers. It can quickly receive and process service requests and meet certain concurrency requirements, while the overall amount of client code can also be controlled within a certain range.
 The client is divided into four modules according to its purpose: deployment module, interface module, log module, and monitoring module. among them:
 Deploy the module, the operation process is as image 3 As shown, the specific process is as follows: The server sends a request to the client interface module. According to the requested operation, the request is divided into query status, start service, close service, etc. After the client receives the request, the deployment module is called to complete the functions of querying, starting, and shutting down the corresponding services. Special functions are provided for special services. For example, middleware provides querying the application list and status of the current service deployment. After the deployment module completes its function, it notifies the server of the deployment result.
 The log module is used to record the log records of the host resource operation process. It is divided into two parts: one part is recorded in the local log file, and the other part is asynchronously pushed to the server interface. The server log module receives the log and stores it in the database. Logs are mainly used for diagnosis, tracking and troubleshooting during application deployment.
 The interface module is used to verify and receive external service requests; the main difference between the verification service is that the non-management end node sends a service call request through the interface module, and the verification is achieved by rejecting the request of the non-management end node Ip; the interface module receives the service request , Call the deployment module to complete the function. Generally, the interface module responds to the front-end request in real time. When the operation is very time-consuming, and the HTTP request has a timeout mechanism, in order to avoid the problem of the server calling failure due to timeout, it is really not a short time. For returned operations, such as update operations, the interface module first returns the received service request, and then runs tasks in the background by creating a new process in the background. The tasks running in the background periodically send the running status to the server through the log system, so that the server can understand The current running state of the client side enables the client system to have a certain concurrency capability and simultaneously receive multiple service requests.
 The monitoring module is used to check the status of the host resource service and submit the status to the server. Generally, the monitoring module checks the status of the applications deployed on the client through the client interface module every 5 minutes, and stores the collected information in the local and server databases through the log module.
 The server is divided into six modules according to functions: operator management module, deployment definition module, interface module, task module, message module, and monitoring module; among them:
 Operator management module, used for operator authentication, adding, querying, freezing, and deleting; based on security considerations, double-layer password authentication is used when the operator logs in. The first layer is based on HTTP Basic Authentication, and each user A unique user and password are issued. The second layer is based on the user password stored in the database for verification. The two verification methods are independent to ensure the safety of the operator.
 The deployment definition module is used to define physical hosts and application resources. Under normal circumstances, the deployed application is related to the specific deployed host. When the host where the application is deployed fails, the deployed application will not be able to provide services, which will affect the business; in order to avoid this situation, design When processing by separating physical host resources and running container resources, all physical machine resources are managed through the server. When resources are needed for running applications, according to whether the application has high availability and other factors, from the available physical machine resources Extraction: When a running container fails, extract a physical host that can be used to clone the configuration of the failed container to replace the failed container node, thereby avoiding a single point of failure. The definition of a physical host is that after the operator installs the client on the physical host, the server discovers and connects to the client's resources. The definition of an application refers to the operating environment required by the application, related applications, and high-availability configuration information. After the application definition requirement information is submitted, the server application definition is the source of information for subsequent deployment operations. Deployment definition module uses such as image 3 , Through the functions provided by the deployment module, the application deployment management system combines the physical host and the application. The application layer depends on the resources provided by the physical layer, but does not depend on a specific host, in a host.
 The interface module is used to provide external services, including two parts: client access and operator access; the api interface provides client service calls; the operator interface uses web pages.
 The task module is used to call the function of the client interface module to realize the scheduling of host resources; the dependency relationship between applications and host resources obtained by the deployment definition module are used to obtain the update sequence of the application content, and the update sequence Each host resource realizes scheduling management. For example, when deploying a service-providing WEB website, you need to provide the HTTP distribution service of the service, the middleware container service for running the application service, and the running application package. Generally, in order to ensure availability, two middleware containers are arranged to provide the service. At this time, the HTTP distribution service, middleware container and application package form a logical unit for externally providing services. When the service adjustment needs to be adjusted, the components of each service can be quickly found according to this unit. When the application package of this service is updated, First, in the distribution service, close the distribution of the middleware to a node, update the application package, then start the middleware service, and then start the distribution of the distribution to the update node, and complete the update of the application package through this alternate update and replacement method. Allows external services to be updated without interruption.
 The message module is used to complete the functions of email notification and short message notification. When the system needs to complete an external notification, it is sent through the message module.
 The monitoring module is used to analyze the performance data submitted by the client, such as the CPU usage rate. If the values obtained by continuous sampling exceed the set threshold (80% by default), an alarm will be sent through the message module; the performance data will also be According to 5 minutes as a unit every day, calculate the average, minimum, and maximum values of cpu usage, memory usage, disk IO usage within 5 minutes, and store them in the database for the operator to query, which can be based on operational requirements. Time and the system generate a graph. When the monitoring module finds an abnormality in the container that affects the operation of the client, it will notify the operator through the message module to handle it.
 The application deployment management system provided by the present invention manages the application deployment environment, deployment process, and deployment results. Environment management is completed through the deployment definition module. The deployment process management mainly includes application deployment update, application version rollback, application status monitoring, etc.; application deployment update includes detecting update content, generating deployment queue tasks based on application deployment content, Deployment execution, etc.; application version rollback is to automatically generate deployment queue tasks after confirming the rollback content, and automatically update the application; application status monitoring is to periodically obtain application status data and form a chart to provide to the operator . among them:
 Application deployment process such as Figure 4 As shown, the specific process is as follows:
 1. The operator submits the application program to the designated internal version control system through this system, and currently uses the independent open source subversion;
 2. The server detects the submitted content: whether the submitted content exists as a resource without a deployment definition, if there is a resource without a deployment definition, the deployment process is terminated;
 3. The system displays the updated content, and the operator confirms the updated content; if there is no confirmation, the deployment process ends;
 4. The operator obtains the deployment resource definition involved in the deployment submission content, and generates an operation task queue according to the resource dependency of the deployment content. The queue content includes the node that needs to perform the deployment operation, the specific execution action, and the resource name of the operation, such as [ Serial number, node10, start, channelService];
 5. After deployment, the deployment management system records the deployment node and deployment content as deployment snapshots in the database;
 6. The deployment management system sends a call request to the nodes in the queue according to the order of the queue. After the client node receives the instruction, it executes the specific operation asynchronously, and returns the operation result to the server interface after the operation is completed. If the queue still has content, continue to execute the next queue task, if the queue is empty, the loop ends;
 7. The deployment management system sends a message to notify the online result.
 Application rollback process such as Figure 5 As shown, the specific process is as follows:
 1. The operator selects the specific application version that needs to be rolled back and the scope that needs to be rolled back;
 2. According to the version submitted by the operator, the server finds the corresponding deployment node and the range node that submitted the rollback to do the intersection to get the node range that needs to be rolled back, find the corresponding deployment version to get the deployment content of the node, and form the deployment node and deployment content List
 3. Same as deployment process 4 to form an operation queue;
 4. Same as deployment process 5. For the node, the configuration generates a snapshot and saves it in the database;
 5. Same as deployment process 6. The client executes the deployment process;
 6. Send a message to notify the online result.
 Application monitoring process such as Image 6 As shown, it is divided into two parts: data collection and monitoring data analysis:
 Data collection is to collect information from the client to the server. The data to be collected consists of two parts: one part is the information data that appears during operation, including output and abnormal information, and the operation information is transmitted to the server in real time through filtering rules; the other part It is the data collected by the regular operation of the monitoring module, including the operating system cpu usage, memory usage, disk IO usage, as well as the performance of the application container, and the collected data. This part of the data is transmitted to the server in an asynchronous manner.
 Monitoring data analysis is used to analyze and warn the collected data. After the monitoring module of the server obtains the data, it is divided into operating system data, network data, and database data according to different data types, and sent to different designated mailing lists, and Regularly notify the designated operator of the filtering result through the message module according to the designated message channel; for the report data, it will be sent to the designated mailing list regularly by email.