CN115220737A - Mirror image deployment method and device, computer equipment and storage medium - Google Patents

Mirror image deployment method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115220737A
CN115220737A CN202110418581.0A CN202110418581A CN115220737A CN 115220737 A CN115220737 A CN 115220737A CN 202110418581 A CN202110418581 A CN 202110418581A CN 115220737 A CN115220737 A CN 115220737A
Authority
CN
China
Prior art keywords
cluster
logistics
mirror image
deployed
management server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110418581.0A
Other languages
Chinese (zh)
Inventor
陶科成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SF Technology Co Ltd
Original Assignee
SF Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SF Technology Co Ltd filed Critical SF Technology Co Ltd
Priority to CN202110418581.0A priority Critical patent/CN115220737A/en
Publication of CN115220737A publication Critical patent/CN115220737A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application relates to a mirror image deployment method, a mirror image deployment device, computer equipment and a storage medium. The method comprises the following steps: the logistics cluster management server responds to the mirror image deployment request and acquires the mirror image to be deployed from a logistics integrated delivery platform storing the mirror image to be deployed; determining at least one associated logistics cluster which is in advance established with a logistics cluster management server; and sending the mirror image to be deployed to a mirror image warehouse corresponding to the associated logistics cluster, so that the associated logistics cluster extracts the mirror image to be deployed from the mirror image warehouse and deploys the mirror image to be deployed. By adopting the method, the plurality of logistics clusters can be uniformly deployed through the logistics cluster management server, so that the situation that developers need to manually deploy the application packages to the logistics clusters is avoided, and the mirror image deployment efficiency is improved.

Description

Mirror image deployment method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of mirror image deployment technologies, and in particular, to a mirror image deployment method and apparatus, a computer device, and a storage medium.
Background
With the development of the mirror image deployment technology, a technology for realizing mirror image deployment by using a container engine appears, and developers deploy the manufactured applications to each field cluster, then form mirror images according to application packages, and store the mirror images in a mirror image warehouse of each field cluster. Each site cluster can download the manufactured mirror image from the mirror image warehouse, so that mirror image configuration can be realized.
At present, developers need to manually deploy application packages to each site cluster in the mirror image deployment of the logistics industry, that is, mirror images are formed after each logistics cluster, and since hundreds of logistics clusters may exist in the logistics industry, the mirror image deployment efficiency is low in the mirror image deployment method of the logistics industry at present.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an image deployment method, apparatus, computer device and storage medium.
A mirror image deployment method is applied to a logistics cluster management server, and comprises the following steps:
responding to a mirror image deployment request, and acquiring a mirror image to be deployed from a logistics integrated delivery platform storing the mirror image to be deployed;
determining at least one associated logistics cluster which is in association with the logistics cluster management server in advance;
and sending the mirror image to be deployed to a mirror image warehouse corresponding to the associated logistics cluster, so that the associated logistics cluster extracts the mirror image to be deployed from the mirror image warehouse and deploys the mirror image to be deployed.
In one embodiment, before determining at least one associated logistics cluster that establishes an association relationship with the logistics cluster management server in advance, the method further includes: responding to an incidence relation construction request, and determining a logistics cluster to be associated corresponding to the incidence relation construction request; acquiring an installation script used for constructing the association relationship, and sending the installation script to the logistics cluster to be associated so that the logistics cluster to be associated can execute the installation script; and after the installation script is executed, inputting the logistics cluster to be associated, and establishing an association relation with the logistics cluster to be associated.
In one embodiment, after the establishing the association relationship with the logistics cluster to be associated, the method further includes: responding to an operation request aiming at an application program installed in an associated logistics cluster, and determining a target application program corresponding to the operation request and a first associated logistics cluster corresponding to the operation request; acquiring an operation instruction corresponding to the operation request, and sending the operation instruction to the first associated logistics cluster; the operation instruction is used for instructing the first associated logistics cluster to operate the target application program.
In one embodiment, after the establishing the association relationship with the logistics cluster to be associated, the method further includes: in response to a query request for a container log of an associated logistics cluster, determining a second associated logistics cluster corresponding to the query request; and acquiring a container log of the second associated logistics cluster and displaying the container log.
In one embodiment, the method further comprises: when detecting that a cluster host of the associated logistics cluster breaks down, determining whether the associated logistics cluster is in a single machine mode; if not, setting the dispatching state of the cluster host as a dispatching prohibition state, and checking the fault of the cluster host; and after the completion of troubleshooting of the cluster host is detected, canceling the scheduling prohibition state of the cluster host.
In one embodiment, after determining whether the associated logistics cluster changes to the stand-alone mode, the method further comprises: if yes, a single-node cluster is newly established, and the cluster host is switched from the cluster mode to the single-machine mode; migrating the smallest deployable unit of the cluster master to the single-node cluster; and after the completion of troubleshooting of the cluster host is detected, restoring the associated logistics cluster to a cluster mode.
In one embodiment, before the newly establishing a single-node cluster, the method further includes: backing up cluster data stored by the associated logistics cluster in the cluster mode; before the recovering the associated logistics cluster into the cluster mode, the method further includes: and deleting cluster data generated by the associated logistics cluster in the stand-alone mode, and restoring the cluster data of the associated logistics cluster into the cluster data stored in the cluster mode.
A mirror image deployment device is applied to a logistics cluster management server, and comprises:
the deployment mirror image acquisition module is used for responding to a mirror image deployment request and acquiring the mirror image to be deployed from a logistics integrated delivery platform storing the mirror image to be deployed;
the association cluster determining module is used for determining at least one association logistics cluster which establishes an association relation with the logistics cluster management server in advance;
and the deployment mirror image sending module is used for sending the mirror image to be deployed to the mirror image warehouse corresponding to the associated logistics cluster so that the associated logistics cluster can extract the mirror image to be deployed from the mirror image warehouse and deploy the mirror image to be deployed.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the above method when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.
According to the mirror image deployment method, the mirror image deployment device, the computer equipment and the storage medium, the logistics cluster management server responds to the mirror image deployment request and obtains the mirror image to be deployed from the logistics integrated delivery platform storing the mirror image to be deployed; determining at least one associated logistics cluster which is in advance established with a logistics cluster management server; and sending the mirror image to be deployed to a mirror image warehouse corresponding to the associated logistics cluster, so that the associated logistics cluster extracts the mirror image to be deployed from the mirror image warehouse and deploys the mirror image to be deployed. According to the method and the system, the plurality of logistics clusters can be uniformly deployed through the logistics cluster management server, the situation that developers need to manually deploy the application packages to the logistics clusters is avoided, and therefore the mirror image deployment efficiency is improved.
Drawings
FIG. 1 is a diagram of an application environment for a mirror deployment method in one embodiment;
FIG. 2 is a flowchart illustrating a mirror deployment method according to an embodiment;
FIG. 3 is a flow diagram illustrating the establishment of associations according to one embodiment;
FIG. 4 is a flowchart illustrating troubleshooting a cluster master in one embodiment;
FIG. 5 is a flow chart illustrating troubleshooting a cluster master in another embodiment;
fig. 6 is a schematic flow chart of a centralized management method for site cloud clusters in an application example;
FIG. 7 is a diagram of a deployment architecture for site clusters in an application example;
FIG. 8 is a schematic flow chart illustrating cluster change of site relocation or machine failure in an application example;
FIG. 9 is a block diagram of the architecture of a mirror deployment apparatus in one embodiment;
FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The mirror image deployment method provided by the application can be applied to the application environment shown in fig. 1. The logistics cluster management server 102 communicates with the logistics integrated delivery platform 103 and the associated logistics cluster 101 with the established association relationship through a network, the logistics cluster management server 102 may be a K8S server for implementing cluster centralized management, and the logistics integrated delivery platform 103 may be a CICD platform for storing compiled containers. Specifically, when a user needs to deploy a mirror image for the associated logistics cluster 101, the constructed mirror image to be deployed may be uploaded to the operation logistics integrated delivery platform 103 to trigger a corresponding mirror image deployment request, and after the logistics integrated delivery platform 103 obtains the mirror image deployment request, the mirror image deployment request may be sent to the logistics cluster management server 102, so that the logistics cluster management server 102 may respond to the request, read the mirror image to be deployed from the logistics integrated delivery platform 103, and send the mirror image to be deployed to a mirror image warehouse of the associated logistics cluster 101 with an association relationship established in advance, so that the associated logistics cluster 101 may obtain the mirror image to be deployed from the mirror image warehouse and perform mirror image deployment. The related logistics cluster 101, the logistics cluster management server 102 and the logistics integrated delivery platform 103 can be implemented by using an independent server or a server cluster formed by a plurality of servers.
In an embodiment, as shown in fig. 2, a mirror image deployment method is provided, which is described by taking the method as an example applied to the logistics cluster management server 102 in fig. 1, and includes the following steps:
step S201, in response to the mirror image deployment request, the logistics cluster management server 102 acquires the mirror image to be deployed from the logistics integrated delivery platform 103 storing the mirror image to be deployed.
The mirror image deployment request is a request initiated by mirror image deployment on a certain logistics cluster triggered by a user, and the mirror image to be deployed is a mirror image to be deployed corresponding to the mirror image deployment request triggered by the user. Specifically, after the user completes the construction of the image to be deployed, the image after the construction may be sent to the logistics integrated delivery platform 103 to trigger an image deployment request for the image to be deployed. Then, the logistics integrated delivery platform 103 may send a mirror deployment request triggered by a user to the logistics cluster management server 102 by calling the logistics cluster management server 102. Then, the logistics cluster management server 102 may respond to the request, and read the image to be deployed corresponding to the image deployment request from the logistics integrated delivery platform 103.
Step S202, the logistics cluster management server 102 determines at least one associated logistics cluster that establishes an association relationship with the logistics cluster management server in advance.
The associated logistics cluster refers to a logistics cluster which establishes an association relationship with the logistics cluster management server 102 in advance, the logistics cluster may refer to different express nodes, such as a transit node, a delivery point, a receiving point, and the like, and the logistics cluster management server 102 is a server for performing unified management on the logistics cluster. In order to realize the unified management of the logistics clusters, the logistics cluster management server 102 needs to establish an association relationship with the logistics clusters to be managed as an associated logistics cluster. In this step, the logistics cluster management server 102 may determine at least one associated logistics cluster 101 that is associated with the logistics cluster management server 102 in advance from the plurality of logistics clusters.
Step S203, the logistics cluster management server 102 sends the mirror image to be deployed to a mirror image warehouse corresponding to the associated logistics cluster 101, so that the associated logistics cluster 101 extracts the mirror image to be deployed from the mirror image warehouse and deploys the mirror image to be deployed.
Finally, the logistics cluster management server 102 may send the mirror image to be deployed obtained from the logistics integrated delivery platform 103 to a mirror image warehouse of the associated logistics cluster 101 with which the association relationship is established in advance, so that the associated logistics cluster 101 may read the mirror image to be deployed from the mirror image warehouse and perform deployment processing of the mirror image to be deployed.
In the mirror image deployment method, the logistics cluster management server 102 responds to a mirror image deployment request and acquires a mirror image to be deployed from the logistics integrated delivery platform 103 storing the mirror image to be deployed; determining at least one associated logistics cluster 101 which is in association with a logistics cluster management server 102 in advance; and sending the mirror image to be deployed to a mirror image warehouse corresponding to the associated logistics cluster 101, so that the associated logistics cluster 101 extracts the mirror image to be deployed from the mirror image warehouse and deploys the mirror image to be deployed. According to the method and the system, the logistics clusters can be uniformly deployed through the logistics cluster management server 102, the situation that developers need to manually deploy the application packages to the logistics clusters is avoided, and therefore the mirror image deployment efficiency is improved.
In one embodiment, as shown in fig. 3, before step S202, the method may further include:
step S301, in response to the association relationship construction request, the logistics cluster management server 102 determines a to-be-associated logistics cluster corresponding to the association relationship construction request.
The association relationship establishing request is triggered by a user and is used for establishing an association relationship between the logistics cluster management server 102 and a certain logistics cluster, that is, a logistics cluster to be associated. Specifically, when a user needs to establish an association relationship between the logistics cluster management server 102 and a logistics cluster to be associated, the association relationship establishment request may be triggered to the logistics cluster management server 102, and the logistics cluster management server 102 may respond to the association relationship establishment request triggered by the user, and find a logistics cluster corresponding to the association relationship establishment request from a plurality of logistics clusters, as a logistics cluster to be associated, for which an association relationship needs to be established.
Step S302, the logistics cluster management server 102 obtains an installation script for constructing an association relationship, and sends the installation script to the logistics cluster to be associated, so that the logistics cluster to be associated executes the installation script.
The installation script is mainly used for performing system installation on the logistics cluster to be associated, so as to construct a script file of an association relation with the logistics cluster management server 102, and the script file may be stored in the logistics cluster management server 102 in advance, or may be read by the logistics cluster management server 102 from a server or a user terminal in which the installation script is stored in advance. Specifically, after the logistics cluster management server 102 determines the logistics cluster to be associated, the installation script may be obtained and directly sent to the logistics cluster to be associated through the network, or the logistics cluster management server 102 may enter the installation script into a terminal of a user initiating an association relationship construction request, and the user enters the installation script into the logistics cluster to be associated through the terminal. And after the associated logistics cluster obtains the installation script, executing installation processing of the installation script.
Step S303, after the installation script is executed, the logistics cluster management server 102 enters the logistics cluster to be associated, and establishes an association relationship with the logistics cluster to be associated.
And if the to-be-associated logistics cluster is already installed with the installation script, the logistics cluster management server 102 can record the to-be-associated logistics cluster installed with the installation script, so as to establish an association relationship with the to-be-associated logistics cluster.
In addition, after step S303, the method may further include: the logistics cluster management server 102 responds to an operation request aiming at an application program installed in the associated logistics cluster, and determines a target application program corresponding to the operation request and a first associated logistics cluster corresponding to the operation request; acquiring an operation instruction corresponding to the operation request, and sending the operation instruction to the first associated logistics cluster; the operation instruction is used for instructing the first associated logistics cluster to operate the target application program.
The operation request is triggered by a user and is used to operate an application installed in the associated logistics cluster 101, which establishes an association relationship with the logistics cluster management server 102 in advance, that is, an operation request of a target application. After an association relationship is established between a certain logistics cluster and the logistics cluster management server 102, that is, after the certain logistics cluster is used as the associated logistics cluster 101 of the logistics cluster management server 102, a user can directly operate an application program installed in the associated logistics cluster 101 through the logistics cluster management server 102.
Specifically, when a user needs to operate an application program installed in the associated logistics cluster 101, a corresponding operation request may be triggered to the logistics cluster management server 102, where the operation request may carry a cluster identifier of the associated logistics cluster 101 that needs to be operated, that is, a first associated logistics cluster, and a program identifier of an application program that needs to be operated, that is, a target application program. After receiving the operation request, the logistics cluster management server 102 may respond to the operation request, and first, based on the obtained operation request, determine a first associated logistics cluster matching the operation request from the multiple associated logistics clusters 101, and obtain an operation instruction of the user for the application program to be operated, as an operation instruction corresponding to the operation request, send the operation instruction to the first associated logistics cluster, so that the first associated logistics cluster may execute a program operation of the target application program installed to the first associated logistics cluster according to the received operation instruction.
After step S303, the method may further include: the logistics cluster management server 102 responds to a query request aiming at the container logs of the related logistics clusters, and determines a second related logistics cluster corresponding to the query request; and acquiring a container log of the second associated logistics cluster and displaying the container log.
Meanwhile, after an association relationship is established between a certain logistics cluster and the logistics cluster management server 102, a user can also directly query the container log of the logistics cluster through the logistics cluster management server 102, the related logistics cluster of the queried container log can be used as a second related logistics cluster, and the query request refers to a request triggered by the user and used for querying the container log of the second related logistics cluster. When a user needs to query the container log of the second associated logistics cluster, the query request may also be directly triggered to the logistics cluster management server 102, and the logistics cluster management server 102 may determine the associated logistics cluster 101 corresponding to the query request as the second associated logistics cluster, and read the container log of the second associated logistics cluster, and display the container log on the display device of the logistics cluster management server 102.
In the above embodiment, the logistics cluster to be associated may establish an association relationship with the logistics cluster management server 102 by executing the installation script, so that convenience in establishing the association relationship is improved. Meanwhile, after the association relationship is established, the user can directly execute the operation on the application program installed in the associated logistics cluster 101 through the logistics cluster management server 102 and query the container log of the associated logistics cluster 101, so that the convenience of logistics cluster management is improved.
In one embodiment, as shown in fig. 4, the mirror image deployment method may further include:
step S401, when the logistics cluster management server 102 detects that the cluster host associated with the logistics cluster 101 fails, it determines whether the associated logistics cluster 101 is in the standalone mode.
The cluster hosts may be master nodes corresponding to the associated logistics clusters 101, and when a cluster host of a certain associated logistics cluster 101 fails, the logistics cluster management server 102 may determine whether the currently failed associated logistics cluster 101 needs to be switched from the cluster mode to the standalone mode.
Step S402, if not, the logistics cluster management server 102 sets the dispatching state of the cluster host machine as a dispatching prohibition state, and checks the fault of the cluster host machine;
step S403, after the logistics cluster management server 102 detects that troubleshooting of the cluster host is completed, the scheduling prohibition state of the cluster host is cancelled.
If the logistics cluster management server 102 determines that the cluster host associated with the logistics cluster 101 may still be in the cluster mode after the cluster host fails, the logistics cluster management server 102 may set the scheduling state of the abnormal cluster host as a scheduling prohibition state, and then perform troubleshooting on the failure of the abnormal host until the failure of the abnormal host is handled, that is, after the troubleshooting of the cluster host is completed, the logistics cluster management server 102 may cancel the scheduling prohibition state of the cluster host and restore the abnormal host to a normal operation state.
Further, after step S401, as shown in fig. 5, the method may further include:
step S501, if yes, the logistics cluster management server 102 newly establishes a single-node cluster, and switches the cluster host from the cluster mode to the single-machine mode.
If the logistics cluster management server 102 determines that the currently failed associated logistics cluster 101 needs to be switched from the cluster mode to the single-machine mode, the failure of the failed cluster host is checked, specifically, the logistics cluster management server 102 needs to newly establish a single-node cluster at first, and the newly established single-node cluster may be a certain newly established initialization etcd cluster. Specifically, if the logistics cluster management server 102 determines that the cluster mode of the associated logistics cluster 101 needs to be switched to the stand-alone mode, the logistics cluster management server 102 may force to newly establish an etcd cluster as a single-node cluster, and then switch the cluster host from the cluster mode to the stand-alone mode.
Step S502, the logistics cluster management server 102 migrates the minimum deployable unit of the cluster host to the single-node cluster.
The minimum deployable unit of the cluster host may be a Pod of the cluster host, and after the logistics cluster management server 102 completes establishment of the single-node cluster, the Pod of the cluster host with the abnormality may be migrated to the newly-built single-node cluster. The logistics cluster management server 102 may delete Pod of the abnormal cluster host from the abnormal host, and migrate the Pod to the newly established etcd cluster, so as to migrate the minimum deployable unit of the cluster host from the abnormal host to the newly established single-node cluster.
Step S503, after the logistics cluster management server 102 detects that the troubleshooting of the cluster host is completed, the associated logistics cluster 101 is restored to the cluster mode.
After step S502, the failure of the cluster host in which the failure occurs may be checked while the associated logistics cluster 101 operates in the single machine mode, and when the failure of the abnormal host is handled, that is, the cluster host completes the failure check, the working mode of the associated logistics cluster may be restored from the current single machine mode to the cluster mode before the failure occurs.
Further, before step S501, the method may further include: the logistics cluster management server 102 backups cluster data stored by the associated logistics cluster 101 in a cluster mode; before step S503, the method may further include: the logistics cluster management server 102 deletes cluster data associated with the logistics cluster 101 generated in the standalone mode, and restores the cluster data associated with the logistics cluster 101 to cluster data stored in the cluster mode.
In order to ensure that the data stored by the cluster host in the cluster mode is not lost after troubleshooting, in this embodiment, before the single-node cluster is newly created, the logistics cluster management server 102 needs to back up the cluster data stored by the failed associated logistics cluster 101 in the cluster mode, for example, the etcd data stored by the failed associated logistics cluster 101, and when the single-node cluster mode needs to be restored to the cluster mode after troubleshooting is completed, the cluster data generated by the associated logistics cluster 101 in the single-node cluster mode may be deleted at this time, and the cluster data is restored to the cluster mode after being restored to the cluster data stored in the backup cluster mode.
In the above embodiment, when a cluster host associated with the logistics cluster 101 fails, the logistics cluster management server 102 may perform troubleshooting on the cluster host, so as to solve the problem that the cluster host fails and improve the efficiency of failure processing. Meanwhile, the cluster host can also ensure that the service is not interrupted while fault troubleshooting of the cluster host is realized by newly establishing a single-node cluster and switching the cluster host from the cluster mode to the single-machine mode. In addition, in this embodiment, by backing up the cluster data stored by the associated logistics cluster 101 in the cluster mode, when the associated logistics cluster 101 is restored from the stand-alone mode to the cluster mode, the stored cluster data can be ensured not to be lost, and the integrity of the cluster data can be ensured.
In an application example, the system also provides a field cloud cluster centralized management system, the system realizes the automatic deployment of a single-computer cluster and a multi-computer cluster by introducing K8S arrangement and combining field machines, and because each field is independent, the field also needs to build an independent warehouse for storing mirror images, and after the structure is adjusted, the field cloud cluster centralized management system can help users to provide the functions of self-healing of faults, elastic expansion, expansion migration, load balancing and the like, so that the operation and maintenance workload is reduced. Meanwhile, the application example uniformly guides the clusters into the cluster management platform, so that CICD assembly line deployment can be performed, the problem that deployment is complicated and time-consuming is solved, meanwhile, the page can provide log checking and log pod logging for problem positioning and troubleshooting, and a user is helped to solve the problem that positioning is time-consuming. In addition, the application example customizes the site OS standard by combining with the service requirement, simultaneously stores the components such as K8S and the like in the OS, provides a one-key initial cluster and a node capacity expansion script, and can rapidly deliver cluster resources to help a user solve the environmental problem.
Specifically, the present application example may be implemented by a flowchart as shown in fig. 6, and the method may include the following steps:
step S1: the area IT installation system executes the script to initialize the cluster;
step S2: recording the installed cluster into a cluster management platform;
and step S3: and operating each field on the cluster management platform.
Specifically, the application example adjusts the K8S deployment architecture according to regional characteristics, a script can deploy a cluster of 1/2/3 Master nodes, a Master node also serves as a Worker node, data is stored on etcd, a plurality of etcds serve as the cluster, a single station serves as a stand-alone mode, and the stand-alone mode and the cluster mode can be switched. In addition, the field warehouse needs an independent warehouse, so a harbor warehouse is installed on a Mater, and a plurality of warehouses are configured with mutual backup modes.
In addition, the present application example further provides a method for site relocation or cluster change of machine failure, as shown in fig. 8, the method may include the following steps:
s1, cluster abnormality is caused by machine failure, under the condition that original cluster data are not lost, data are backed up, and a single-node cluster is forcibly initialized (at least 2 etcd can carry out election, and a single node needs to kick out an original abnormal node);
s2, the cluster is converted into the single node without interrupting service, original data are not lost after the single node is started, and abnormal node application can be automatically migrated to the single node;
s3, after the machine fault is recovered, the machine needs to be added into the cluster to be converted into a high-availability multi-node mode;
s4, short interruption is needed in conversion, and the data of a single node cannot be read by the etcd data of the cluster, so that the etcd data needs to be restored to the data in the failure, and the pod started in the single machine mode needs to be stopped firstly;
and S5, after the cluster is added, the old data needs to be deleted, and the K8S enables the new copy to run in the cluster and completes the switching.
In the application example, the same management is carried out on the field, the edition sending time consumption of the application is reduced, meanwhile, the adjustment of the infrastructure can provide functions such as fault self-healing, elastic expansion, expansion migration and load balancing for a user to reduce the operation and maintenance workload, the difficulty of application log investigation is reduced, a machine is moved, and the complexity of the initialization environment is reduced during system reinstallation.
It should be understood that, although the steps in the flowcharts of the present application are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in the figures may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of execution of the steps or stages is not necessarily sequential, but may be performed alternately or in alternation with other steps or at least some of the other steps or stages.
In an embodiment, as shown in fig. 9, there is provided an image deployment apparatus applied to a logistics cluster management server, including: a deployment image obtaining module 901, an association cluster determining module 902, and a deployment image sending module 903, where:
a deployed mirror image obtaining module 901, configured to, in response to a mirror image deployment request, obtain a mirror image to be deployed from a logistics integrated delivery platform storing the mirror image to be deployed;
an association cluster determining module 902, configured to determine at least one association logistics cluster that establishes an association relationship with a logistics cluster management server in advance;
the deployment mirror image sending module 903 is configured to send the mirror image to be deployed to a mirror image warehouse corresponding to the associated logistics cluster, so that the associated logistics cluster extracts the mirror image to be deployed from the mirror image warehouse and deploys the mirror image to be deployed.
In one embodiment, the mirror image deployment apparatus may further include: the incidence relation construction module is used for responding to the incidence relation construction request and determining the logistics cluster to be associated corresponding to the incidence relation construction request; acquiring an installation script for constructing an association relation, and sending the installation script to a logistics cluster to be associated so that the logistics cluster to be associated can execute the installation script; and after the installation script is executed, inputting the logistics cluster to be associated, and establishing an association relation with the logistics cluster to be associated.
In one embodiment, the mirror image deployment apparatus may further include: the application program operation module is used for responding to an operation request aiming at an application program installed in the related logistics cluster, and determining a target application program corresponding to the operation request and a first related logistics cluster corresponding to the operation request; acquiring an operation instruction corresponding to the operation request, and sending the operation instruction to the first associated logistics cluster; the operation instruction is used for indicating the first related logistics cluster to operate the target application program.
In one embodiment, the mirror image deployment apparatus may further include: the container log query module is used for responding to a query request aiming at the container logs of the related logistics clusters and determining a second related logistics cluster corresponding to the query request; and acquiring a container log of the second associated logistics cluster and displaying the container log.
In one embodiment, the mirror image deployment apparatus may further include: the host fault processing module is used for determining whether the associated logistics cluster is in a single machine mode or not when the cluster host of the associated logistics cluster is detected to be in fault; if not, setting the dispatching state of the cluster host as a dispatching prohibition state, and checking faults of the cluster host; and after the completion of troubleshooting of the cluster host is detected, canceling the scheduling prohibition state of the cluster host.
In an embodiment, the host failure processing module is further configured to, if yes, newly establish a single-node cluster, and switch the cluster host from the cluster mode to the single-machine mode; migrating the minimum deployable unit of the cluster host to the single-node cluster; and after the completion of troubleshooting of the cluster host is detected, restoring the associated logistics cluster into a cluster mode.
In one embodiment, the host failure processing module is further configured to backup cluster data stored by the associated logistics cluster in a cluster mode; and deleting cluster data generated by the associated logistics cluster in the single machine mode, and restoring the cluster data of the associated logistics cluster into cluster data stored in the cluster mode.
For specific definition of the mirror image deployment device, reference may be made to the definition of the mirror image deployment method in the foregoing, and details are not described here again. The various modules in the image deploying apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing mirror image data to be deployed. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a mirror deployment method.
Those skilled in the art will appreciate that the architecture shown in figure Y is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A mirror image deployment method is applied to a logistics cluster management server, and comprises the following steps:
responding to a mirror image deployment request, and acquiring a mirror image to be deployed from a logistics integrated delivery platform storing the mirror image to be deployed;
determining at least one associated logistics cluster which is in association with the logistics cluster management server in advance;
and sending the mirror image to be deployed to a mirror image warehouse corresponding to the associated logistics cluster, so that the associated logistics cluster extracts the mirror image to be deployed from the mirror image warehouse and deploys the mirror image to be deployed.
2. The method of claim 1, wherein before determining at least one associated logistics cluster that has previously established an association relationship with the logistics cluster management server, further comprising:
responding to an incidence relation construction request, and determining a logistics cluster to be associated corresponding to the incidence relation construction request;
acquiring an installation script for constructing the association relation, and sending the installation script to the logistics cluster to be associated so that the logistics cluster to be associated can execute the installation script;
and after the installation script is executed, inputting the logistics cluster to be associated, and establishing an association relation with the logistics cluster to be associated.
3. The method according to claim 2, wherein after establishing the association relationship with the logistics cluster to be associated, further comprising:
responding to an operation request aiming at an application program installed in an associated logistics cluster, and determining a target application program corresponding to the operation request and a first associated logistics cluster corresponding to the operation request;
acquiring an operation instruction corresponding to the operation request, and sending the operation instruction to the first associated logistics cluster; the operation instruction is used for instructing the first associated logistics cluster to operate the target application program.
4. The method according to claim 2, wherein after establishing the association relationship with the logistics cluster to be associated, further comprising:
in response to a query request for a container log of an associated logistics cluster, determining a second associated logistics cluster corresponding to the query request;
and acquiring the container log of the second associated logistics cluster and displaying the container log.
5. The method of claim 1, further comprising:
when detecting that a cluster host of the associated logistics cluster breaks down, determining whether the associated logistics cluster changes into a single machine mode;
if not, setting the dispatching state of the cluster host as a dispatching prohibition state, and checking the fault of the cluster host;
and after the completion of troubleshooting of the cluster host is detected, canceling the scheduling prohibition state of the cluster host.
6. The method of claim 5, wherein after determining whether the associated logistics cluster is changed to stand-alone mode, further comprising:
if yes, a single-node cluster is newly established, and the cluster host is switched to a single-machine mode from a cluster mode;
migrating the smallest deployable unit of the cluster master to the single-node cluster;
and after the completion of the troubleshooting of the cluster host is detected, the associated logistics cluster is restored to a cluster mode.
7. The method of claim 6, wherein before said newly establishing a single-node cluster, further comprising:
backing up cluster data stored by the associated logistics cluster in the cluster mode;
before the recovering the associated logistics cluster into the cluster mode, the method further includes:
and deleting cluster data generated by the associated logistics cluster in the stand-alone mode, and restoring the cluster data of the associated logistics cluster into the cluster data stored in the cluster mode.
8. An image deployment device, applied to a logistics cluster management server, the device comprising:
the deployment mirror image acquisition module is used for responding to a mirror image deployment request and acquiring the mirror image to be deployed from a logistics integrated delivery platform storing the mirror image to be deployed;
the association cluster determining module is used for determining at least one association logistics cluster which establishes an association relation with the logistics cluster management server in advance;
and the deployment mirror image sending module is used for sending the mirror image to be deployed to the mirror image warehouse corresponding to the associated logistics cluster so that the associated logistics cluster can extract the mirror image to be deployed from the mirror image warehouse and deploy the mirror image to be deployed.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the steps of the method according to any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110418581.0A 2021-04-19 2021-04-19 Mirror image deployment method and device, computer equipment and storage medium Pending CN115220737A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110418581.0A CN115220737A (en) 2021-04-19 2021-04-19 Mirror image deployment method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110418581.0A CN115220737A (en) 2021-04-19 2021-04-19 Mirror image deployment method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115220737A true CN115220737A (en) 2022-10-21

Family

ID=83604970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110418581.0A Pending CN115220737A (en) 2021-04-19 2021-04-19 Mirror image deployment method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115220737A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115695453A (en) * 2022-10-31 2023-02-03 浪潮云信息技术股份公司 Method, device, equipment and medium for improving stability of mirror image warehouse

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115695453A (en) * 2022-10-31 2023-02-03 浪潮云信息技术股份公司 Method, device, equipment and medium for improving stability of mirror image warehouse

Similar Documents

Publication Publication Date Title
CN109669762B (en) Cloud computing resource management method, device, equipment and computer readable storage medium
CN107526659B (en) Method and apparatus for failover
US8843935B2 (en) Automatically changing a pre-selected datastore associated with a requested host for a virtual machine deployment based on resource availability during deployment of the virtual machine
US8856592B2 (en) Mechanism to provide assured recovery for distributed application
US11106556B2 (en) Data service failover in shared storage clusters
CN110286930B (en) Cloud platform upgrading method and device, terminal and storage medium
EP3200073A1 (en) Method, apparatus and system for migrating virtual machine backup information
CN111953566B (en) Distributed fault monitoring-based method and virtual machine high-availability system
CN104239548B (en) Database disaster tolerance system and data storage capacity disaster method
WO2018095414A1 (en) Method and apparatus for detecting and recovering fault of virtual machine
CN107453932B (en) Distributed storage system management method and device
CN109274537B (en) Continuous network virtualization platform system
CN111857998A (en) Configurable timing task scheduling method and system
US8990608B1 (en) Failover of applications between isolated user space instances on a single instance of an operating system
CN105049284A (en) Linux system-based network redundancy testing method and device
CN116089011A (en) Method and device for creating mirror warehouse, storage medium and electronic equipment
CN101877655A (en) Network management system, network management server and method
CN115220737A (en) Mirror image deployment method and device, computer equipment and storage medium
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
CN111917588B (en) Edge device management method, device, edge gateway device and storage medium
US9021481B2 (en) Computer-readable recording medium, migration control method and control device
CN113965576A (en) Container-based big data acquisition method and device, storage medium and equipment
US10664190B1 (en) Geographically dispersed data protection and replication
CN111240700A (en) Cross-network-segment server OS deployment system and method
CN103780433B (en) Self-healing type virtual resource configuration management data architecture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination