Service deployment method, device, electronic device and medium
The service deployment method addresses complex configuration and maintenance challenges by creating queues and using HTTP/RPC for efficient, stable, and automated deployment and monitoring of system services.
Patent Information
- Application Number
- CN202111527548.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-12-14
AI Technical Summary
Existing automated deployment and monitoring solutions for system services face issues such as complex configuration, high maintenance costs, and high machine resource consumption, leading to configuration errors.
A service deployment method that creates a queue based on device-related information and deployment information, determines changes in deployment information, and generates a deployment service command to execute tasks efficiently, using protocols like HTTP and RPC to manage deployment and health checks, thereby reducing complex configurations.
Improves configuration efficiency by mastering deployment destination information without manual configurations, optimizing deployment processes, and ensuring operation stability through self-healing and health status monitoring.
Smart Images

Figure CN114201181B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology and can be applied to the field of financial technology, and more specifically to a service deployment method, apparatus, device, medium and program product. Background Art
[0002] For system services developed by modern Internet companies, remote service deployment and monitoring are required. Existing automated deployment solutions generally use third-party open source tools such as Ansible and Jenkins for simple packaging. For existing automated monitoring solutions, third-party open source tools such as Zabbix, Nagios, and Ganglia are generally used for real-time monitoring and reporting real-time monitoring data to the server.
[0003] However, when there are many system services, the existing automated deployment solutions and automated monitoring solutions have problems such as complex configuration, easy configuration errors, high maintenance costs for operation and maintenance personnel, and high machine resource consumption. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a service deployment method, apparatus, device, medium and program product for improving configuration efficiency.
[0005] According to a first aspect of the present disclosure, a service deployment method is provided, which is applied to a first server, and includes: in response to receiving device-related information from a second server, creating a queue corresponding to a target service according to the device-related information and deployment information of the target service; determining, according to the deployment information of the target service, whether the deployment information of the target service has changed within a predetermined period of time; in the case of determining that the deployment information of the target service has changed, generating a deployment service command according to the queue corresponding to the target service; and sending the deployment service command to the second server so that the second server executes the deployment task corresponding to the deployment service command.
[0006] According to an embodiment of the present disclosure, when it is determined that the deployment information of the target service has changed, a deployment service command is generated according to the queue corresponding to the target service, including: when it is determined that the deployment information of the target service has changed, copying the queue corresponding to the target service as a task queue; based on the task queue, determining a predetermined number of device-related information; and generating a deployment service command according to the predetermined number of device-related information.
[0007] According to an embodiment of the present disclosure, the method also includes: establishing a first queue and a second queue corresponding to the task queue according to the task queue; in a case where the execution result received from the second server is a successful execution, recording the device-related information in the first queue; in a case where the execution result received from the second server is a failed execution, recording the device-related information in the second queue; when it is determined that all device-related information in the task queue is popped up and the second queue is empty, recording that the target service is deployed successfully; when it is determined that device-related information exists in the second queue, generating a deployment service command according to the device-related information existing in the second queue, and sending the deployment service command.
[0008] According to an embodiment of the present disclosure, sending the deployment service command to the second server so that the second server executes the deployment task corresponding to the deployment service command includes: sending the deployment service command to the second server via the Hypertext Transfer Protocol and / or the Remote Procedure Call Protocol so that the second server executes the deployment task corresponding to the deployment service command.
[0009] According to an embodiment of the present disclosure, the deployment information of the target service includes a health check script address and a health check execution time period; the method also includes: sending a health check command to a second server based on the health check script address and the health check execution time period; and in response to receiving a health check result from the second server, storing the health check result.
[0010] According to an embodiment of the present disclosure, the method further includes: determining the unhealthy second server based on the health check result, and sending a start command or a restart command to the unhealthy second server.
[0011] According to an embodiment of the present disclosure, the deployment information of the target service includes: service name, host name of the deployment server, Internet Protocol address, port number, stop script address, start script address, restart script address, health check script address, health check execution time period, self-healing instructions, deployment method, and at least one of the failure retry count threshold.
[0012] According to a second aspect of the present disclosure, a service deployment method is provided, which is applied to a second server and includes: sending device-related information corresponding to the second server; receiving a deployment service command from a first server, and executing a deployment task corresponding to the deployment service command; wherein the deployment service command includes: when the first server determines that the deployment information of the target service has changed, the first server generates a deployment service command according to the queue corresponding to the target service.
[0013] According to an embodiment of the present disclosure, the executing the deployment task corresponding to the deployment service command includes: acquiring program package information corresponding to the deployment service command; and executing the program package information to complete the deployment service task.
[0014] According to an embodiment of the present disclosure, the method further includes: receiving a health check command; executing the health check command, and sending a health check result.
[0015] The third aspect of the present disclosure provides a service deployment device, which is applied to a first server, and includes: a first creation module, which is used to create a queue corresponding to a target service in response to receiving device-related information from a second server, according to the device-related information and the deployment information of the target service; a first determination module, which is used to determine whether the deployment information of the target service has changed within a predetermined time period according to the deployment information of the target service; a first generation module, which is used to generate a deployment service command according to the queue corresponding to the target service when it is determined that the deployment information of the target service has changed; and a first sending module, which is used to send the deployment service command to the second server, so that the second server executes the deployment task corresponding to the deployment service command.
[0016] The fourth aspect of the present disclosure provides a service deployment device, which is applied to a second server, including: a first sending module, used to send device-related information corresponding to the second server; and a first execution module, used to receive a deployment service command from the first server and execute a deployment task corresponding to the deployment service command; wherein the deployment service command includes: when the first server determines that the deployment information of the target service has changed, the deployment service command is generated according to the queue corresponding to the target service.
[0017] The fifth aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned service deployment method.
[0018] The sixth aspect of the present disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned service deployment method.
[0019] The seventh aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned service deployment method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0021] Figure 1 The application scenario diagram of the service deployment method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown;
[0022] Figure 2 A flowchart of a service deployment method according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 3 A schematic diagram of a queue according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 4 A flowchart of a service deployment method according to another embodiment of the present disclosure is schematically shown;
[0025] Figure 5 A schematic diagram of a service deployment system according to an embodiment of the present disclosure is schematically shown;
[0026] Figure 6 The structure block diagram of the service deployment device according to the embodiment of the present disclosure is schematically shown;
[0027] Figure 7 A structural block diagram schematically shows a service deployment device according to another embodiment of the present disclosure; and
[0028] Figure 8 A block diagram of an electronic device suitable for implementing a service deployment method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0029] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0030] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0031] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0032] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0033] The embodiment of the present disclosure provides a service deployment method and device, which creates a queue corresponding to a target service according to the device-related information and the deployment information of the target service in response to receiving device-related information from a second server; determines whether the deployment information of the target service has changed within a predetermined period according to the deployment information of the target service; generates a deployment service command according to the queue corresponding to the target service when it is determined that the deployment information of the target service has changed; and sends the deployment service command to the second server so that the second server executes the deployment task corresponding to the deployment service command. This embodiment does not require complex configuration deployment, and the deployment destination information of all target services can be mastered only through the device-related information reported by the second server, thereby improving the configuration efficiency, thereby solving the problems of low configuration efficiency and easy configuration errors.
[0034] Figure 1 The application scenario diagram of the service deployment method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown.
[0035] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first server 101, a network 102, and a second server 103. The network 102 is used to provide a medium for a communication link between the first server 101 and the second server 103. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0036] The first server 101 interacts with the second server 103 via the network 102 to receive or send messages, etc.
[0037] It should be noted that the service deployment method provided in the embodiment of the present disclosure can generally be executed by the first server 101 or the second server 103. Accordingly, the service deployment device provided in the embodiment of the present disclosure can generally be set in the first server 101 or the second server 103.
[0038] It should be understood that Figure 1 The number of networks and servers in the embodiment is only for illustration. Any number of networks and servers may be provided as required.
[0039] The following will be based on Figure 1 The scene described by Figure 2 The service deployment method of the disclosed embodiment is described in detail.
[0040] Figure 2 The flowchart of the service deployment method according to the embodiment of the present disclosure is schematically shown.
[0041] like Figure 2 As shown, this embodiment includes operations S210 to S240, and the service deployment method can be executed by a server in a service deployment system.
[0042] In operation S210, in response to receiving the device-related information from the second server, a queue corresponding to the target service is created according to the device-related information and deployment information of the target service.
[0043] In operation S210, the deployment information of the target service is the deployment information of the related service entered into the server by the system administrator in advance, and the service deployment information is used as the deployment information of the target service. For example, the deployment information of the target service is such as the service name, the host name of the deployment server, the Internet Protocol IP address, the port number, etc.; further, the deployment information of the target service may include: the service name, the host name of the deployment server, the Internet Protocol address (IP address), the port number (such as the PORT port number), the stop script address, the stop command, the start script address, the start command, the restart script address, the restart command, the health check script address, the health check command, the health check execution time period, the self-healing instruction (the command for whether to perform self-healing for unhealthy services), the deployment mode (such as fully automatic deployment, deployment concurrency, custom deployment, etc.), and at least one of the threshold value of the number of failed retries.
[0044] In operation S210, after the second server is started, it sends its own device related information to the first server. For example, if an agent program is pre-configured on the second server, the agent program stored in the second server obtains its own device related information and sends it to the first server.
[0045] In operation S210, the device-related information of the second server may be its own machine hostname information, its own IP address, PORT port information, etc., and may also be its own deployment process, its own survival status, and so on.
[0046] In operation S210, by matching the device-related information with the deployment information of the target service, the deployed status and the status to be deployed of the second server can be known. The queue stores one or more device-related information, and the second servers corresponding to the device-related information are all to be deployed with the target service.
[0047] Therefore, based on the queue, the deployment destination information can be mastered without adding various manual configurations, such as adding targets and their authorized accounts, passwords or other login information. When deploying services, problems such as scattered monitoring scripts, inconsistent formats, and error-prone configurations can be avoided.
[0048] In operation S220, it is determined whether the deployment information of the target service changes within a predetermined period of time according to the deployment information of the target service.
[0049] In operation S220 , after entering the deployment information, the server monitors the deployment information of the target service in real time or periodically to monitor whether the deployment information of the target service changes within a predetermined period of time.
[0050] In operation S220, the change in the deployment information of the target service may be a change in the deployment information, such as a version update, or an addition of new deployment information, and so on.
[0051] In operation S230 , when it is determined that the deployment information of the target service has changed, a deployment service command is generated according to a queue corresponding to the target service.
[0052] In operation S230 , a deploy service command can be generated based on the queue corresponding to the target service.
[0053] In operation S240, a deployment service command is sent to the second server, so that the second server executes a deployment task corresponding to the deployment service command.
[0054] In operation S240, a deployment service command is sent to the second server, so that the second server can execute the deployment task after receiving the deployment service command, such as remotely acquiring the process package information of the target service and deploying it.
[0055] In this embodiment, in response to receiving device-related information from the second server, a queue corresponding to the target service is created according to the device-related information and the deployment information of the target service. Then, according to the deployment information of the target service, it is determined whether the deployment information of the target service has changed within a predetermined period of time. In the case where it is determined that the deployment information of the target service has changed, a deployment service command is generated according to the queue corresponding to the target service. Afterwards, a deployment service command is sent to the second server so that the second server executes the deployment task corresponding to the deployment service command. In this embodiment, there is no need for complex configuration deployment. The deployment destination information of all target services can be mastered only through the device-related information reported by the second server. It can be seen that this embodiment improves the configuration efficiency.
[0056] When it is determined that the deployment information of the target service has changed, a deployment service command is generated according to the queue corresponding to the target service, including: when it is determined that the deployment information of the target service has changed, copying the queue corresponding to the target service as a task queue; based on the task queue, determining a predetermined number of device-related information; and generating a deployment service command according to the predetermined number of device-related information.
[0057] In this embodiment, the queue corresponding to the target service is copied as the task queue, so that the queue corresponding to the target service always records the device-related information and the deployment information of the target service, and the device-related information is popped out based on the task queue, such as popping out one or more device-related information at the head of the queue. The deployment concurrency can also be configured to determine the number of device-related information for executing the target service deployment. If the deployment concurrency determines that the number of second servers executing the deployment at the same time is n, then the n device-related information at the head of the queue is popped out from the task queue each time, and n is a positive integer.
[0058] Figure 3 A schematic diagram of a queue according to an embodiment of the present disclosure is shown schematically. Figure 3 , the task queue corresponding to time T1 stores ten pieces of device-related information, from 1 to 10. If the number of device-related information currently determined to execute the target service deployment is 2, the task queue pops up device-related information 1 and 2, and the task queue corresponding to time T2 includes eight pieces of device-related information, from 3 to 10. Afterwards, the task queue pops up device-related information 3 and 4, and the task queue corresponding to time T2 includes six pieces of device-related information, from 5 to 10, and continues to run until time Tn, when the number of device-related information in the task queue is zero.
[0059] By copying the queue corresponding to the target service as the task queue, the original queue corresponding to the target service remains unchanged; using the task queue to pop up device related information can realize the storage and recording of the deployment process of the entire service, which is conducive to real-time grasp of all deployment situations.
[0060] The service deployment method also includes: establishing a first queue and a second queue corresponding to the task queue according to the task queue; when the execution result received from the second server is a successful execution, recording device-related information in the first queue; when the execution result received from the second server is a failed execution, recording device-related information in the second queue; when it is determined that all device-related information in the task queue is popped up and the second queue is empty, recording that the target service is deployed successfully; when it is determined that device-related information exists in the second queue, generating a deployment service command according to the device-related information in the second queue, and sending the deployment service command.
[0061] For example, the first queue and the second queue are established, and the current state is an empty queue. The first queue is used as a success queue and the second queue is used as a failure queue; wait for the execution result, and in the case of successful execution, the corresponding device-related information is recorded in the first queue, and in the case of failed execution, the corresponding device-related information is recorded in the second queue. After a round of deployment, check the task queue, the first queue, and the second queue for storing device-related information. When it is determined that the device-related information in the task queue is popped up and the second queue (failure queue) is empty, record the target service deployment success; when it is determined that the device-related information exists in the second queue (failure queue), it means that the current deployment is not successful, then generate a deployment service command according to the device-related information in the second queue, send the deployment service command, perform the next round of service deployment tasks, and wait for the execution result until the number of device-related information in the first queue (successful queue) is equal to the number of device-related information in the task queue, or the number of device-related information in the second queue is zero, determine that the current deployment service task will no longer be executed. Further, the maximum number of retries for deployment failures, that is, the failure retry threshold, can be configured, and each failure is recorded once until the failure retry threshold is reached, stop executing the current deployment service task, and no longer generate a deployment service command.
[0062] This embodiment, by establishing a success queue and a failure queue with the task queue, and corresponding execution records, is conducive to fully understanding the deployment status of the target service on the one hand, and can optimize each round of deployment tasks on the other hand, ensure operation efficiency, and provide operation stability.
[0063] Sending a deployment service command to the second server so that the second server executes a deployment task corresponding to the deployment service command includes: sending a deployment service command to the second server via a hypertext transfer protocol and / or a remote procedure call protocol so that the second server executes a deployment task corresponding to the deployment service command.
[0064] In this embodiment, instructions are sent to the second server via the Hypertext Transfer Protocol (HTTP) and / or the Remote Procedure Call Protocol (RPC), which can avoid writing scripts in many target second servers, as well as configuration and restart work, and is conducive to improving operating efficiency.
[0065] The deployment information of the target service includes a health check script address and a health check execution time period; the method also includes: sending a health check command to the second server based on the health check script address and the health check execution time period; and storing the health check result in response to receiving the health check result from the second server.
[0066] In this embodiment, by sending a health check command, and in response to receiving a health check result from the second server, storing the health check result, the health status of the second server can be grasped, thereby optimizing the entire service deployment system and ensuring continuous operation, such as eliminating the execution agent program in the second server that is no longer alive, such as determining an unhealthy second server based on the health check result, and sending a start command or restart command to the unhealthy second server, so that the service deployment system has the ability of self-checking and self-retry, thereby realizing health status monitoring.
[0067] The deployment information of the target service includes: service name, host name of the deployment server, Internet Protocol address, port number, stop script address, start script address, restart script address, health check script address, health check execution time period, self-healing instructions, deployment method, and at least one of the failure retry count threshold.
[0068] Through one or more of the service name, host name of the deployment server, Internet Protocol address, port number, stop script address, start script address, restart script address, health check script address, health check execution time period, self-healing instructions, deployment method, and failure retry number threshold, it is possible to provide a variety of deployment services to meet diverse user needs.
[0069] Figure 4 The following schematically shows a flow chart of a service deployment method according to another embodiment of the present disclosure.
[0070] like Figure 4 As shown, this embodiment includes operations S410 to S420, and the service deployment method can be executed by the second server in the service deployment system.
[0071] In operation S410, device related information corresponding to a second server is sent.
[0072] In this embodiment, after the second server is started, it will send its own device related information to the server. For example, if an agent program is pre-configured on the second server, the agent program stored in the second server obtains its own device related information and sends it to the server.
[0073] In operation S420, a deployment service command is received from the first server, and a deployment task corresponding to the deployment service command is executed; wherein the deployment service command includes: when the first server determines that the deployment information of the target service has changed, the deployment service command is generated according to the queue corresponding to the target service.
[0074] In this embodiment, after receiving the deployment service command, the second server can execute the deployment task, such as remotely acquiring the process package information of the target service and deploying it.
[0075] Executing a deployment task corresponding to the deployment service command includes: obtaining program package information corresponding to the deployment service command; and executing the program package information to complete the deployment service task.
[0076] In this embodiment, for example, the second server may remotely obtain the program package information corresponding to the deployment service command from a pre-configured shared storage system, and complete the deployment service task after obtaining the program package information.
[0077] In this embodiment, for example, the system can monitor in real time whether a new program package is successfully uploaded, thereby obtaining new program package information and executing a new deployment task.
[0078] The service deployment method also includes: receiving a health check command; executing the health check command, and sending a health check result.
[0079] In this embodiment, the second server reports its own health check result, such as target service system a is alive, or target service system b is not alive, and so on.
[0080] Figure 5 The schematic diagram of the service deployment system according to the embodiment of the present disclosure is schematically shown. Figure 5 In order to better understand the present disclosure, the contents of the present disclosure are further described below in conjunction with the embodiments, but the present disclosure is not limited to the following embodiments.
[0081] The service deployment system 500 includes a first server 501 and second servers 502, 503, 504. The first server 501 sends a command, such as a deployment service command, a health check command, etc., and at least one of the second servers 502, 503, 504 sends an execution result, such as execution success, a health check result, etc.
[0082] For example, in response to the problem of service deployment and health status monitoring, this embodiment combines the preset CMDB enterprise asset management platform, the preset shared storage system, the HTTP protocol and the shell command to realize the full-process automated service deployment, as follows.
[0083] Step 1: The system service administrator enters the deployment information of the relevant system services (i.e., the deployment information of the target service) in the CMDB, including: service name, hostname of the deployment server, IP address, PORT number, stop script address, stop command, start script address, start command, restart script address, restart command, health check script address, health check command, health check execution time period, whether the unhealthy service performs self-healing, automated deployment method (such as fully automatic deployment and deployment concurrency, manually specified deployment), and maximum number of failed retries.
[0084] Step 2: After the system service administrator configures the service deployment information in CMDB, execute the service information publishing command.
[0085] Step 3: The service master control system regularly monitors the changes in the deployment information of the CMDB system service, reads the latest deployment information, adjusts the expired information in the memory, and always maintains the latest system service deployment information. It can also send an execution start command to the second server when it is determined that the deployment information of the target service has changed, such as Figure 5 As shown in the schematic diagram, the first server 501 sends a command to the second servers 502, 503, and 504, and the current command is an execution start command.
[0086] Step 4: See Figure 5 , the second servers 502, 503, and 504 send the execution results, i.e., the device related information, to the first server 501. For example, the client service execution agent is started on the deployed client server, and the client service agent reports its own machine hostname information, its own IP address, PORT port and other information to the service master control system. The service master control system establishes a queue for each system service to uniformly manage the information of the client service execution agent. At the same time, the client service execution agent periodically reports its own survival status. The service master control system periodically checks the recorded survival status of the client service execution agent, and removes and records the client service execution agent that is no longer alive;
[0087] Step 5: The service master control system determines the deployment mode entered by the system service administrator through step 1 and performs different actions, namely: the fully automatic mode in step 6 and / or the manually specified mode in step 7 for deployment;
[0088] Step 6: Fully automatic deployment method: The master control system will monitor the package information of the shared storage service in real time. When it is monitored that the latest package of the system has been successfully uploaded, the client service execution agent queue corresponding to the system maintained in step 4 is obtained, and a copy is made as the task queue. Two empty queues are established respectively as the success queue and the failure queue. The number of clients to be deployed simultaneously is determined according to the deployment concurrency set by the system administrator in step 1 (for example, n, where n is a positive integer). That is, the n client service execution agent information at the head of the queue is popped out from the task queue each time, and the corresponding execution command is sent to the client execution agent through the HTTP protocol. According to the health check time period set in step 1, a health check execution command is sent to the n client service execution agents taken out. The client service execution agent checks whether the system service of the machine where it is located has changed, and the status Whether it is healthy, if healthy, send health information to the service master control system, the service master control system pushes the information of these n client service execution agents into the success queue, if the system service process cannot check, send failure information to the service master control program, the service master control program pushes the client service execution agent information into the failure queue, the service master control program takes out n client service execution agents from the task queue and performs the same action until the task queue is empty; when the task queue is empty, check whether the number in the success queue is the same as the client service execution agent queue size, if the same, record all deployments successfully; if different, push the client service execution agents in the failure queue (if it is empty, wait for the health check command to be executed periodically, and then re-check the success queue and failure queue) back into the task queue and re-execute until all deployments are successful or the maximum number of retries for deployment failure is reached.
[0089] Step 7: Manually specify the method, manually send the system service deployment information and actions, deployment concurrency, and maximum retry times to the service master control system. The service master control system sends the corresponding command to the client service execution agent through the HTTP protocol according to the client service execution agent queue maintained in step 4. The internal state maintenance and scheduling are the same as the fully automatic deployment method.
[0090] Step 8: The service master control system sends health check commands to all client service execution agents of the system according to the health check execution time period set in step 1, obtains the health check results (normal, disappeared, abnormal) and records them for query use. At the same time, according to whether the unhealthy service is self-healing configured, a restart command is sent to the corresponding client service execution agent;
[0091] Step 9: See Figure 5In the schematic diagram shown, the first server 501 sends a command to the second servers 502, 503, and 504, and the current command is a service restart command. Afterwards, the second servers 502, 503, and 504 execute the agent program to check the process information of the service deployed by the client where they are located, and execute the restart command provided in the command to perform the restart action. The second servers 502, 503, and 504 send the execution result to the first server 501, such as the restart is completed.
[0092] Step 10: See Figure 5 In the schematic diagram shown, the first server 501 sends a command to the second servers 502, 503, and 504, and the current command is a deployment service command. After that, it checks whether the client where it is located has the latest program package of the required deployment program. If not, it backs up the existing program package of the deployment program, and pulls the latest software package of the program from the shared storage according to the information in the command and puts it into the deployment directory, and executes the restart command (startup command) provided in the command (or corresponding script), etc.;
[0093] Step 11: See Figure 5 In the schematic diagram shown, the first server 501 sends a command to the second servers 502, 503, and 504, and the current command is a stop service command. After that, the process information of the service deployed by the client where the server is located is checked, and the stop command provided in the command is executed to perform the stop action. The second servers 502, 503, and 504 send the execution result to the first server 501, such as the stop.
[0094] Based on the above service deployment method, the present disclosure also provides a service deployment device. Figure 6 The device is described in detail.
[0095] Figure 6 The structural block diagram of the service deployment device according to an embodiment of the present disclosure is schematically shown.
[0096] like Figure 6 As shown, the service deployment device 600 of this embodiment includes a first creation module 610, a first determination module 620, a first generation module 630 and a first sending module 640. The first creation module 610 is used to create a queue corresponding to the target service according to the device-related information and the deployment information of the target service in response to receiving the device-related information from the second server. The first determination module 620 is used to determine whether the deployment information of the target service has changed within a predetermined period of time according to the deployment information of the target service. The first generation module 630 is used to generate a deployment service command according to the queue corresponding to the target service when it is determined that the deployment information of the target service has changed. And the first sending module 640 is used to send a deployment service command to the second server so that the second server executes the deployment task corresponding to the deployment service command.
[0097] According to an embodiment of the present disclosure, any multiple modules of the first creation module 610, the first determination module 620, the first generation module 630 and the first sending module 640 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first creation module 610, the first determination module 620, the first generation module 630 and the first sending module 640 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the first creation module 610 , the first determination module 620 , the first generation module 630 , and the first sending module 640 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0098] Based on the above service deployment method, the present disclosure also provides a service deployment device, which is applied to a server. Figure 7 The device is described in detail.
[0099] Figure 7 The structural block diagram of the service deployment device according to an embodiment of the present disclosure is schematically shown.
[0100] like Figure 7 As shown, the service deployment device 700 of this embodiment includes a first sending module 710 and a first execution module 720 .
[0101] The first sending module 710 is used to send device related information corresponding to the second server. And the first execution module 720 is used to receive the deployment service command from the first server and execute the deployment task corresponding to the deployment service command; wherein the deployment service command includes: the first server generates a deployment service command according to the queue corresponding to the target service when determining that the deployment information of the target service has changed.
[0102] According to an embodiment of the present disclosure, any multiple modules in the first sending module 710 and the first execution module 720 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first sending module 710 and the first execution module 720 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the first sending module 710 and the first execution module 720 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0103] Figure 8 A block diagram of an electronic device suitable for implementing a service deployment method according to an embodiment of the present disclosure is schematically shown.
[0104] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0105] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0106] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.
[0107] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0108] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.
[0109] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the item recommendation method provided by the embodiment of the present disclosure.
[0110] The above functions defined in the system / device of the embodiment of the present disclosure are executed when the computer program is executed by the processor 801. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0111] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0112] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0113] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should be noted that in some implementations as replacements, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0116] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A service deployment method, applied to a first server, comprising: In response to receiving the device related information from the second server, creating a queue corresponding to the target service according to the device related information and deployment information of the target service; Determining, according to the deployment information of the target service, whether the deployment information of the target service changes within a predetermined period of time; When it is determined that the deployment information of the target service has changed, copying the queue corresponding to the target service as the task queue; Determining a predetermined number of device related information based on the task queue; Generate a deployment service command according to the predetermined number of device-related information; as well as Sending the deployment service command to the second server, so that the second server executes the deployment task corresponding to the deployment service command; The method further comprises: establishing a first queue and a second queue corresponding to the task queue according to the task queue; When the execution result received from the second server is that the execution is successful, recording the device related information in the first queue; When the execution result received from the second server is that the execution fails, recording the device related information in the second queue; When it is determined that all device related information in the task queue is popped out and the second queue is empty, recording that the target service is deployed successfully; When it is determined that there is device related information in the second queue, a deployment service command is generated according to the device related information in the second queue, and the deployment service command is sent.
2. The method according to claim 1, wherein: The sending the deployment service command to the second server so that the second server executes the deployment task corresponding to the deployment service command includes: The deployment service command is sent to the second server via the Hypertext Transfer Protocol and / or the Remote Procedure Call Protocol, so that the second server executes the deployment task corresponding to the deployment service command.
3. The method according to claim 1, wherein: The deployment information of the target service includes a health check script address and a health check execution time period; the method further includes: Sending a health check command to the second server based on the health check script address and the health check execution time period; In response to receiving the health check result from the second server, the health check result is stored.
4. The method according to claim 3, further comprising: An unhealthy second server is determined based on the health check result, and a start command or a restart command is sent to the unhealthy second server.
5. The method according to any one of claims 1 to 4, wherein: The deployment information of the target service includes: service name, host name of the deployment server, Internet Protocol address, port number, stop script address, start script address, restart script address, health check script address, health check execution time period, self-healing instructions, deployment method, and at least one of the failure retry count threshold.
6. A service deployment method, applied to a second server, comprising: Sending device related information corresponding to the second server so that the first server generates a deployment service command; receiving a deployment service command from the first server, and executing a deployment task corresponding to the deployment service command; The deployment service command is generated in the following way: In the case of determining that the deployment information of the target service has changed, copying the queue corresponding to the target service as a task queue; determining a predetermined number of device-related information based on the task queue; and generating a deployment service command according to the predetermined number of device-related information; According to the task queue, a first queue and a second queue corresponding to the task queue are established; when the execution result received from the second server is a successful execution, the device related information is recorded in the first queue; when the execution result received from the second server is a failed execution, the device related information is recorded in the second queue; when it is determined that all device related information in the task queue is popped out and the second queue is empty, the target service is recorded to be deployed successfully; when it is determined that device related information exists in the second queue, a deployment service command is generated according to the device related information existing in the second queue.
7. The method according to claim 6, wherein: The executing the deployment task corresponding to the deployment service command includes: Obtaining program package information corresponding to the deployment service command; Execute the program package information to complete the deployment service task.
8. The method according to claim 6, further comprising: Receive health check commands; Execute the health check command and send the health check result.
9. A service deployment device, applied to a first server, comprising: A first creation module, configured to, in response to receiving device related information from the second server, create a queue corresponding to the target service according to the device related information and deployment information of the target service; A first determining module, configured to determine, based on the deployment information of the target service, whether the deployment information of the target service changes within a predetermined period of time; A first generating module is used to copy the queue corresponding to the target service as a task queue when it is determined that the deployment information of the target service has changed; A second determining module, configured to determine a predetermined number of device-related information based on the task queue; A second generating module, configured to generate a deployment service command according to the predetermined number of device related information; as well as A first sending module, configured to send the deployment service command to the second server, so that the second server executes a deployment task corresponding to the deployment service command; Wherein, the device further comprises: An establishing module, used for establishing a first queue and a second queue corresponding to the task queue according to the task queue; A first recording module is used to record the device related information in the first queue when the execution result received from the second server is that the execution is successful; A second recording module is used to record the device related information in the second queue when the execution result received from the second server is that the execution fails; A third recording module, configured to record that the target service is successfully deployed when it is determined that all device related information in the task queue is popped out and the second queue is empty; The third generating module is used to generate a deployment service command according to the device related information in the second queue when it is determined that the second queue contains device related information, and send the deployment service command.
10. A service deployment device, applied to a second server, comprising: A first sending module, configured to send device related information corresponding to the second server so that the first server generates a deployment service command; A first execution module, configured to receive a deployment service command from a first server and execute a deployment task corresponding to the deployment service command; The deployment service command is generated in the following way: In the case of determining that the deployment information of the target service has changed, copying the queue corresponding to the target service as a task queue; determining a predetermined number of device-related information based on the task queue; and generating a deployment service command according to the predetermined number of device-related information; According to the task queue, a first queue and a second queue corresponding to the task queue are established; when the execution result received from the second server is a successful execution, the device related information is recorded in the first queue; when the execution result received from the second server is a failed execution, the device related information is recorded in the second queue; when it is determined that all device related information in the task queue is popped out and the second queue is empty, the target service is recorded to be deployed successfully; when it is determined that device related information exists in the second queue, a deployment service command is generated according to the device related information existing in the second queue.
11. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 8.
12. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 8.
13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Automatic version deployment method and device, computer equipment and storage medium
CN110275872A
Data transmission method and device, computer system and readable storage medium
CN112953769A
