CN114764379A - Access switching method and device for application software and computer readable storage medium - Google Patents
Access switching method and device for application software and computer readable storage medium Download PDFInfo
- Publication number
- CN114764379A CN114764379A CN202110040628.4A CN202110040628A CN114764379A CN 114764379 A CN114764379 A CN 114764379A CN 202110040628 A CN202110040628 A CN 202110040628A CN 114764379 A CN114764379 A CN 114764379A
- Authority
- CN
- China
- Prior art keywords
- deployment unit
- disaster recovery
- deployment
- target
- application software
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/20—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
- G06F11/2053—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
- G06F11/2056—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant by mirroring
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/20—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
- G06F11/202—Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
- G06F11/2023—Failover techniques
- G06F11/2033—Failover techniques switching over of hardware resources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention discloses an access switching method, equipment and a computer readable storage medium of application software, aiming at solving the problem that the access switching time in the prior art is more and abnormal time is increased; in the application, if the target deployment unit is abnormal, the running state of the disaster recovery deployment unit corresponding to the target deployment unit is inquired; if the operation state of the disaster recovery deployment unit is normal, switching the access request to a target network address corresponding to the disaster recovery deployment unit; according to the method and the device, the operating state of the disaster recovery deployment unit is inquired to determine whether to execute access switching of the application software, so that switching operation is simplified, abnormal time is reduced, and normal access of the application can be recovered by the switching operation; and by judging whether the target deployment unit has deployed the corresponding disaster recovery deployment unit or not, only providing the access switching service of the application software for the target deployment unit deployed with the corresponding disaster recovery deployment unit, and providing guarantee for the access switching of the application software.
Description
Technical Field
The invention relates to the technical field of service cluster containers, in particular to an access switching method and device of application software and a computer readable storage medium.
Background
In large-scale internet applications, applications are stored in a server cluster, and users obtain application services by accessing the applications in the server cluster.
When a server in a server cluster fails, the application cannot be accessed, and if the failure time is long, the application cannot provide corresponding application service, so that the service related to the application is abnormal, and huge loss is brought to a company, and therefore a disaster recovery system needs to be established to ensure normal access of the application; in the existing disaster recovery establishment technology, a cloud platform component container is generally deployed through a kubernets container arrangement framework for data backup, after a server cluster is crashed, a new kubernets container is started, backup data is read, an application program is rebuilt on site, and after the application program is rebuilt, an access request of a user is switched to the rebuilt application program, so that the application response time is long due to the fact that the application program is rebuilt for a long time.
Disclosure of Invention
Embodiments of the present invention provide an access switching method and device for application software, and a computer-readable storage medium, which have solved the technical problems of long application recovery time and slow access request response speed when a service cluster fails in the prior art.
In one aspect, the present application provides an access switching method for application software, where the method includes:
receiving an access request, and acquiring an initial access address associated with the access request;
if the target deployment unit corresponding to the initial access address is abnormal, judging whether the target deployment unit deploys the corresponding disaster recovery deployment unit;
if the target deployment unit has deployed the corresponding disaster recovery deployment unit, inquiring the running state of the disaster recovery deployment unit;
and if the running state of the disaster recovery deployment unit is normal, switching the access request to a target network address corresponding to the disaster recovery deployment unit.
In some embodiments of the present application, before receiving an access request and acquiring an initial access address associated with the access request, the method includes:
receiving a disaster recovery deployment request, and determining application software corresponding to the disaster recovery deployment request and a deployment unit set associated with the application software;
acquiring deployment unit identifiers to be deployed in the deployment unit set and operation information of deployment units corresponding to the deployment unit identifiers;
and deploying the disaster recovery deployment units of the deployment units according to the operation information of the deployment units, and taking the equipment corresponding to the disaster recovery deployment units as the disaster recovery clusters corresponding to the application software.
In some embodiments of the present application, the deploying, according to the operation information of each deployment unit, the disaster recovery deployment unit of each deployment unit, and using a device corresponding to each disaster recovery deployment unit as a disaster recovery cluster corresponding to the application software includes:
acquiring configuration information associated with each deployment unit according to the operation information of each deployment unit;
extracting dependency items and environment variables corresponding to the deployment units from the configuration information associated with the deployment units, and judging whether the dependency items corresponding to the deployment units contain disaster tolerance dependency items;
if the dependency item corresponding to each deployment unit comprises a disaster tolerance dependency item, creating a disaster tolerance deployment unit of each deployment unit according to the disaster tolerance dependency item corresponding to each deployment unit, and taking the device corresponding to each disaster tolerance deployment unit as a disaster tolerance cluster corresponding to the application software;
if the dependency item corresponding to each deployment unit does not contain a disaster tolerance dependency item, configuring the disaster tolerance dependency item corresponding to the dependency item through the environment variable corresponding to each deployment unit, creating a disaster tolerance deployment unit of each deployment unit according to each disaster tolerance dependency item, and taking the device corresponding to each disaster tolerance deployment unit as a disaster tolerance cluster corresponding to the application software.
In some embodiments of the present application, after deploying the disaster recovery deployment unit of each deployment unit according to the operation information of each deployment unit, and taking a device corresponding to each disaster recovery deployment unit as a disaster recovery cluster corresponding to the application software, the method includes:
detecting the operation information of each deployment unit, and determining a target deployment unit updated by the operation information;
and updating the operation information of the disaster recovery deployment unit corresponding to the target deployment unit according to the operation information of the target deployment unit.
In some embodiments of the present application, if the target deployment unit corresponding to the initial access address is abnormal, determining whether the target deployment unit has deployed the corresponding disaster recovery deployment unit includes:
if the target deployment unit corresponding to the initial access address is abnormal, judging whether the target deployment unit has a corresponding disaster recovery deployment unit;
if the target deployment unit has a corresponding disaster recovery deployment unit, comparing the dependency item of the target deployment unit with the disaster recovery dependency item of the disaster recovery deployment unit;
if the dependency item of the target deployment unit is matched with the disaster recovery dependency item of the disaster recovery deployment unit, determining that the target deployment unit has deployed the corresponding disaster recovery deployment unit;
And if the target deployment unit does not have the corresponding disaster recovery deployment unit and/or the dependency item of the target deployment unit is not matched with the disaster recovery dependency item of the disaster recovery deployment unit, determining that the target deployment unit does not deploy the corresponding disaster recovery deployment unit.
In some embodiments of the present application, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, querying the operating state of the disaster recovery deployment unit includes:
if the target deployment unit has deployed the corresponding disaster recovery deployment unit, querying the state of the disaster recovery deployment unit corresponding to the target deployment unit;
if the state of the disaster recovery deployment unit is started, inquiring the operation state of the disaster recovery deployment unit according to the operation information of the disaster recovery deployment unit;
and if the state of the disaster recovery deployment unit is not started, starting the disaster recovery deployment unit and updating the operation information of the disaster recovery deployment unit.
In some embodiments of the present application, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, querying the starting state of the disaster recovery deployment unit corresponding to the target deployment unit includes:
if the target deployment unit has deployed the corresponding disaster recovery deployment unit, inquiring whether the disaster recovery deployment unit corresponding to the target deployment unit completes scheduling and determining a starting state of the disaster recovery deployment unit;
If the target deployment unit corresponds to the disaster recovery deployment unit and completes scheduling, judging that the starting state of the disaster recovery deployment unit is started;
if the target deployment unit corresponding to the disaster recovery deployment unit does not complete scheduling, judging that the starting state of the disaster recovery deployment unit is not started;
if the starting state of the disaster recovery deployment unit is started, querying the running state of the disaster recovery deployment unit according to the running information of the disaster recovery deployment unit includes:
if the state of the disaster recovery deployment unit is started, acquiring the operation information of the disaster recovery deployment unit;
performing health check on the operation information through a probe, and inquiring the operation state of the disaster recovery deployment unit;
if the health check of the operation information passes, judging that the operation state of the disaster recovery deployment unit is normal;
and if the health check of the operation information does not pass, judging that the operation state of the disaster recovery deployment unit is abnormal.
In some embodiments of the present application, before the receiving an access request and acquiring an initial access address associated with the access request, the method includes;
receiving an application program deployment request, defining an environment variable of the application program according to the deployment request, and manufacturing a mirror image based on the environment variable;
And manufacturing a dependent item based on the image, and deploying a deployment unit of the application program according to the dependent item.
In another aspect, the present application provides an access switching device for application software, including:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement an access switching method of application software.
In another aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is loaded by a processor to execute the steps in the access switching method of the application software.
In the technical scheme of the application, an access request is received, and an initial access address associated with the access request is obtained; if the target deployment unit corresponding to the initial access address is abnormal, whether the target deployment unit deploys the corresponding disaster recovery deployment unit is judged, if the target deployment unit deploys the corresponding disaster recovery deployment unit, the operation state of the disaster recovery deployment unit is inquired, and if the operation state of the disaster recovery deployment unit is normal, the access request is switched to the target network address corresponding to the disaster recovery deployment unit, so that the access request of the application software is quickly switched from the target deployment unit to the disaster recovery deployment unit, the switching operation is simplified, the abnormal time is reduced, and the normal access of the application can be recovered after the switching operation, so that the access request can be quickly responded.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic view of a scenario of access switching of application software provided in an embodiment of the present invention;
fig. 2 is a flowchart illustrating an embodiment of an access switching method for application software according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of an embodiment of establishing a disaster recovery cluster in a handover access method of application software according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating an embodiment of deploying a disaster recovery deployment unit in access switching of application software according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of an embodiment of determining whether a corresponding disaster recovery deployment unit has been deployed in the access switching method for application software according to the embodiment of the present invention;
fig. 6 is a schematic flowchart of an embodiment of querying an operating state of the disaster recovery deployment unit in the access switching method for application software according to the embodiment of the present invention;
Fig. 7 is a flowchart illustrating an embodiment of deployment unit deployment in an access switching method for application software according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an embodiment of an access switching apparatus for application software according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present application, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience of description and for simplicity of description, and do not indicate or imply that the referenced device or element must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be considered as limiting the present application. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
In this application, the word "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes are not set forth in detail in order to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The embodiment of the invention provides an access switching method and device of application software and a computer readable storage medium.
The access switching method of the application software is applied to access switching equipment of the application software, the access switching equipment of the application software is provided with a memory and a processor, the memory stores the application program, and the processor is used for operating the application program stored in the memory so as to realize access switching of the application software; the access switching device of the application software may be a server, such as a single server or a server cluster composed of a plurality of servers.
As shown in fig. 1, fig. 1 is a schematic view of a scenario of access switching of application software provided in an embodiment of the present application, where the scenario of access switching of application software in the embodiment of the present application includes an access switching device of application software, and the access switching device of application software runs a computer-readable storage medium corresponding to the access switching of application software, so as to execute a step of access switching of application software.
It can be understood that the access switching device for application software in the access switching of application software shown in fig. 1, or the apparatus included in the access switching device for application software, does not limit the embodiments of the present application, that is, the number of apparatuses and the type of apparatuses included in the scenario of access switching of application software, or the number of apparatuses and the type of apparatuses included in each apparatus do not affect the overall implementation of the technical solution of the embodiments of the present application, and may be calculated as equivalent replacements or derivatives of the technical solution claimed in the embodiments of the present application.
The access switching equipment of the application software in the embodiment of the application software is mainly used for:
receiving an access request, and acquiring an initial access address associated with the access request;
if the target deployment unit corresponding to the initial access address is abnormal, judging whether the target deployment unit deploys the corresponding disaster recovery deployment unit;
If the target deployment unit has deployed the corresponding disaster recovery deployment unit, inquiring the running state of the disaster recovery deployment unit;
and if the running state of the disaster recovery deployment unit is normal, switching the access request to a target network address corresponding to the disaster recovery deployment unit.
The access switching device of the application software in this embodiment of the application software may be an access switching device of the application software alone, or may be an access switching device network of the application software composed of the access switching devices of the application software or an access switching device cluster of the application software, for example, the access switching device of the application software described in this embodiment of the application software includes, but is not limited to, a computer, a server cluster composed of a plurality of servers, an access switching device of a single network application software, an access switching device set of a plurality of application software, or an access switching device of cloud application software composed of the access switching devices of a plurality of application software. Wherein the access switching device of the cloud application software is composed of access switching devices of a large number of computers, servers or network application software based on cloud computing.
Those skilled in the art can understand that the application scenario shown in fig. 1 is only one application scenario of the present application, and does not constitute a limitation on the application scenario of the present application, and other application scenarios may further include more or less access switching devices of the application software than that shown in fig. 1, or a network connection relationship of the access switching devices of the application software, for example, only 1 access switching device of the application software is shown in fig. 1, and it can be understood that the access switching scenario of the application software may further include one or more access switching devices of the application software, which is not limited herein specifically; the access switching device of the application software may further include a memory for storing data, such as operation information of the target deployment unit.
In addition, the access switching device of the application software for switching the access of the application software may be provided with the display device 200, or the access switching device 100 of the application software is not provided with the display device 200 to be in communication connection with an external display device, and the display device 200 is used for outputting a result executed by the access switching method of the application software in the access switching device 100 of the application software. The access switching device 100 for the application software may access the background database 300 (the background database 300 may be a local storage of the access switching device 100 for the application software), and the background database 300 stores information related to access switching of the application software, for example, the background database stores running information of a target deployment unit, running status of a disaster recovery deployment unit, and a dependency of the target deployment unit.
It should be noted that the scene diagram of the access switching of the application software shown in fig. 1 is only an embodiment, and the scene of the access switching of the application software described in the embodiment of the present application is for more clearly explaining the technical solution of the embodiment of the present application, and does not limit the technical solution provided in the embodiment of the present application.
As shown in fig. 2, fig. 2 is a schematic flowchart of an embodiment of an access switching method for application software according to an embodiment of the present application, where the access switching method for application software includes:
101, receiving an access request, and acquiring an initial access address associated with the access request.
The access switching method of the application software in the embodiment of the application software is applied to the access switching equipment of the application software, and the equipment type and the equipment number in the access switching equipment of the application software are not limited. The access switching device of the application software of the present embodiment is described by taking a production available area as an example (wherein, the production available area is a set of one or more physical data centers, has redundant power supplies, networking and connection, and contains application software which is daily accessed by a user). The method comprises the steps that a production available area receives an access request of a client through a port, a domain name requesting access in the access request is obtained, a load balancer is used for analyzing the domain name to obtain an initial access address associated with the access request, a target deployment unit corresponding to the initial access address is inquired through the initial access address (wherein the target deployment unit is the minimum application unit of production application in the production available area), communication connection between the target deployment unit and the client is established based on the initial access address, if the communication connection is failed to be established, the target deployment unit is overtime in access, and the target deployment unit corresponding to the initial access address is judged to be abnormal.
In this embodiment, the production available area may be established based on a kubernets (chinese: an open source container arrangement engine) container management platform, a node port (chinese: a node port), a LoadBalancer (chinese: a load balancer) or a kubernets Ingress (chinese: an entry of an access cluster outside a kubernets cluster) container may be set so that a client may access application software through a port or Ingress, and an initial access address associated with an access request may be obtained by analyzing a Domain Name through a DNS (full Name: Domain Name Server, chinese: a Domain Name system). Containers are combined into individual deployment units with dependency relationships based on a Kubernetes container management platform, and the relevant containers are jointly deployed and scheduled after being combined into the deployment units, so that services are formed, and the complexity of deploying and scheduling the deployment units is simplified.
102, if the target deployment unit corresponding to the initial access address is abnormal, determining whether the target deployment unit has deployed the corresponding disaster recovery deployment unit.
In the embodiment of the application, if a target deployment unit corresponding to an initial access address is abnormal, querying a disaster recovery available area corresponding to a production available area, determining whether the target deployment unit has deployed a corresponding disaster recovery deployment unit (where the disaster recovery deployment unit is a minimum application unit of disaster recovery application of the disaster recovery available area, and the disaster recovery available area is a standby area of the production available area established based on a Kubernetes container management platform), and if the target deployment unit has not deployed the corresponding disaster recovery deployment unit, outputting a prompt message that access switching of application software cannot be performed; and if the target deployment unit has deployed the corresponding disaster recovery deployment unit, executing operation for querying the running state of the disaster recovery deployment unit if the target deployment unit has deployed the corresponding disaster recovery deployment unit.
103, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, querying the running state of the disaster recovery deployment unit.
In the embodiment of the application, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, the production available area queries the operation information of the disaster recovery deployment unit corresponding to the target deployment unit in the disaster recovery available area (wherein the operation information includes configuration information, operation state and the like of the disaster recovery deployment unit), obtains the operation state of the disaster recovery deployment unit through the operation information, analyzes the operation state and judges whether the operation state is normal; if the running state of the disaster recovery deployment unit is abnormal, the disaster recovery deployment unit cannot be switched, and a prompt message of access switching failure of the application software is output in the available production area; if the operation state of the disaster recovery deployment unit is normal, it indicates that the switching of the disaster recovery deployment unit can be performed, and the production available area performs the operation of switching the access request to the target network address corresponding to the disaster recovery deployment unit.
And 104, if the operation state of the disaster recovery deployment unit is normal, switching the access request to a target network address corresponding to the disaster recovery deployment unit.
In the embodiment of the application, if the operation state of the disaster recovery deployment unit is normal, the production available area stops the operation of the target deployment unit, the access request is switched to the target network address corresponding to the disaster recovery deployment unit, the data of the application software in the production available area is migrated to the disaster recovery available area, the application service is provided by the corresponding disaster recovery application in the disaster recovery available area, and the access switching of the application software is realized.
In this embodiment, the stopping the operation of the target deployment unit in the production available area includes: inquiring the running information of the target deployment unit, analyzing whether the target deployment unit is in a starting state or not according to the running information, inquiring the state of the target deployment unit (wherein the state of the target deployment unit comprises suspension, successful termination, failed termination, unknown and the like) if the target deployment unit is in an un-starting state, and if the target deployment unit is successfully terminated, indicating that the target deployment unit is in a normal stop state and outputting prompt information of successful stop; if the target deployment unit is failed to terminate, indicating that the stop state of the target deployment unit is abnormal, outputting prompt information for stopping the operation failure of the target deployment unit, and prompting the access switching failure of the application software; if the target deployment unit is in the started state, the target deployment unit is marked as 'terminating', the access request is switched to a target network address corresponding to the disaster recovery deployment unit, the running process of the target deployment unit is stopped, and whether the stopped state of the target deployment unit is normal or not is checked by inquiring the state of the target deployment unit.
In this embodiment, after stopping the operation of the target deployment unit, the production available area checks the abnormal reason of the production application in the production available area, and performs fault repair on the production available area, after detecting that the operation of the production application is resumed, the production available area queries the disaster recovery available area to obtain a disaster recovery deployment unit of the disaster recovery application corresponding to the production application, and queries whether the state of the target deployment unit corresponding to the production available area in the production available area is a failed termination according to the disaster recovery deployment unit, and if the state of the target deployment unit is a failed termination, the production available area restarts the target deployment unit; if the state of the target deployment unit is not the failure termination, the production available area creates the target deployment unit according to the disaster recovery deployment unit and starts the target deployment unit; after the target deployment unit is restarted/started, the running state of the target deployment unit is inquired, if the running state is normal, the production available area sends an access switching request of the application software to the disaster recovery available area, receives the access request of the client, switches the access request to the corresponding network address of the target deployment unit, and completes the access switching of the application software.
In this embodiment, after stopping the operation of the target deployment unit, the production available area queries the disaster recovery available area to obtain the operation information of the corresponding disaster recovery deployment unit, updates the operation information of the target deployment unit according to the operation information of the disaster recovery deployment unit, and restarts/starts the target deployment unit by using the updated operation information of the target deployment unit.
In the embodiment of the application, by inquiring the running state of the disaster recovery deployment unit, if the running state of the disaster recovery deployment unit is normal, the access request is switched to the target network address corresponding to the disaster recovery deployment unit, so that the access switching of the application software is realized, the target deployment unit is quickly switched to the disaster recovery deployment unit, the switching operation is simplified, the abnormal time is reduced, and the normal access of the application can be recovered by the switching operation; and after receiving the access switching request, the access switching service of the application software is provided only for the target deployment unit which has deployed the corresponding disaster recovery deployment unit by judging whether the target deployment unit has deployed the corresponding disaster recovery deployment unit, so that the access switching of the application software is guaranteed.
As shown in fig. 3, fig. 3 is a schematic flowchart of an embodiment of establishing a disaster recovery cluster in a method for switching access of application software according to the embodiment of the present application.
In some embodiments of the present application, a method for establishing a disaster recovery cluster in a handover access method of application software is described in detail, including:
201, receiving a disaster recovery deployment request, and determining application software corresponding to the disaster recovery deployment request and a deployment unit set associated with the application software.
In the embodiment of the application, before the production available area receives the client access request, the production available area needs to deploy, in the deployed corresponding disaster recovery available area, a disaster recovery deployment unit that provides an operation service for the application software, so as to establish a disaster recovery cluster. Specifically, the production available area receives a disaster recovery deployment request of the disaster recovery available area, acquires an application software identifier included in the disaster recovery deployment request according to the disaster recovery deployment request, acquires detailed information of the application software (the detailed information of the application software includes service information required by running the application software) according to the application software identifier, acquires a plurality of deployment units providing services for running the application software according to the detailed information of the application software, and forms a deployment unit set according to the plurality of deployment units.
202, obtain deployment unit identifiers to be deployed in the deployment unit set, and operation information of deployment units corresponding to each deployment unit identifier.
In the embodiment of the application, the production available area obtains deployment unit identifiers to be deployed from a deployment unit set (where the deployment unit identifiers include names and IP addresses of deployment units (the name is Internet Protocol, chinese: Internet Protocol)), obtains operation information of the deployment units according to the deployment unit identifiers to be deployed, traverses the entire deployment unit set, and obtains the operation information of the deployment units corresponding to the deployment unit identifiers in the deployment unit set one by one (where the operation information includes configuration information, health information, mirror image information, and the like).
And 203, deploying the disaster recovery deployment units of the deployment units according to the operation information of the deployment units, and taking the devices corresponding to the disaster recovery deployment units as the disaster recovery clusters corresponding to the application software.
After the operation information of the deployment units corresponding to the deployment unit identifications in the deployment unit set is acquired one by one, the disaster recovery deployment units corresponding to the deployment units are deployed one by one in the disaster recovery available area according to the operation information of the deployment units, after the deployment of the disaster recovery deployment units corresponding to the deployment units in the deployment unit set is completed, the production available area determines the association relation between the units to be deployed in the deployment unit set according to the detailed information of the application software, establishes the disaster recovery deployment unit set based on the association relation and uses the equipment corresponding to the disaster recovery deployment unit set in the disaster recovery available area as a disaster recovery cluster, and provides service for the operation of the application software through the disaster recovery cluster.
In the embodiment of the application, before the production available area receives the disaster recovery deployment request, the deployment unit set is obtained by using the detailed information of the application software, and the disaster recovery deployment unit set corresponding to the deployment disaster recovery unit set is used to obtain the disaster recovery cluster supporting the operation of the application software, so that data guarantee is provided for the access switching of the application software.
As shown in fig. 4, fig. 4 is a schematic flowchart of an embodiment that deploys a disaster recovery deployment unit in access switching of application software according to the embodiment of the present application.
In some embodiments of the present application, a method for deploying a disaster recovery deployment unit in access switching of application software is described in detail, including:
301, obtaining configuration information associated with each deployment unit according to the operation information of each deployment unit.
302, extracting a dependency item and an environment variable corresponding to each deployment unit from the configuration information associated with each deployment unit, and determining whether the dependency item corresponding to each deployment unit includes a disaster recovery dependency item.
In the embodiment of the application, the production available area acquires configuration information associated with deployment unit identifiers according to operation information of each deployment unit (wherein the configuration information may be configuration data used when the deployment unit is created and includes configuration files, environment variables and the like), extracts the configuration files associated with the deployment unit identifiers from the configuration information, determines dependency items of the deployment units according to the configuration files (wherein the configuration files are data files generated when the deployment unit dependency items are created, and the dependency items provide support for starting and operating the deployment units and include configuration items, storage volumes, service items and the like), and determines whether the dependency items corresponding to the deployment units include disaster tolerance dependency items by judging whether the configuration files exist in the disaster tolerance available area after obtaining the dependency items of the deployment units; if the configuration file exists in the disaster recovery available area, it is indicated that the dependency item corresponding to the configuration file has a disaster recovery dependency item, and a corresponding disaster recovery dependency item is already established in the disaster recovery available area, that is, the dependency item corresponding to the deployment unit includes the disaster recovery dependency item; if the configuration file does not exist in the disaster recovery available area, it is indicated that the dependency item corresponding to the configuration file does not have the disaster recovery dependency item, and the disaster recovery dependency item is not established in the disaster recovery available area, that is, the dependency item corresponding to the deployment unit does not include the disaster recovery dependency item.
303, if the dependency item corresponding to each deployment unit includes a disaster recovery dependency item, creating a disaster recovery deployment unit of each deployment unit according to the disaster recovery dependency item corresponding to each deployment unit, and taking the device corresponding to each disaster recovery deployment unit as a disaster recovery cluster corresponding to the application software.
And if the dependency item corresponding to the deployment unit comprises the disaster tolerance dependency item, creating the disaster tolerance deployment unit through a Kubernetes container management platform according to the disaster tolerance dependency item and by combining the operation information of the deployment unit, and after the creation of the disaster tolerance deployment unit corresponding to each deployment unit in the deployment unit set is completed, taking the equipment of each disaster tolerance deployment unit as a disaster tolerance cluster supporting the application software operation service.
304, if the dependency item corresponding to each deployment unit does not include a disaster tolerance dependency item, configuring the disaster tolerance dependency item corresponding to the dependency item by using the environment variable corresponding to each deployment unit, creating a disaster tolerance deployment unit of each deployment unit according to each disaster tolerance dependency item, and taking the device corresponding to each disaster tolerance deployment unit as a disaster tolerance cluster corresponding to the application software.
If the dependency item corresponding to the deployment unit does not include the disaster tolerance dependency item, configuring the disaster tolerance dependency item corresponding to the dependency item according to an environment variable (where the environment variable includes basic information such as a deployment unit name, a namespace, an IP address, and a computing resource limit of a container, and information of a service created before the deployment unit runs), and creating the disaster tolerance deployment unit according to the disaster tolerance dependency item, thereby obtaining the disaster tolerance cluster, specifically, including:
Dividing the dependency items into a front dependency item and a rear dependency item according to the configuration file, wherein the front dependency item comprises a configuration item (ConfigMap, Chinese: application configuration management) and a storage Volume (Volume, Chinese: Volume hanging) (wherein the configuration item is used for deploying configuration information required by the operation of the application software, and the storage Volume is used for storing data generated in the creation and operation processes of the deployment unit), and the rear dependency item comprises a service item (service, Chinese: service, wherein the service item is mainly used for an external access interface of the deployment unit set);
if the data file of the ConfigMap pre-dependency item corresponding to the deployment unit does not exist in the disaster tolerance available area, namely the dependency item corresponding to the deployment unit does not contain the disaster tolerance ConfigMap pre-dependency item, a configuration file required by the ConfigMap dependency item is created through environment variable configuration, a ConfigMap is created in the disaster tolerance available area according to the configuration file, and the data file generated by deploying the ConfigMap dependency item in the disaster tolerance available area is recorded through disaster tolerance environment variables; if the disaster tolerance available area does not have the data file of the Volume pre-dependency corresponding to the deployment unit; if the disaster tolerance available area does not have the data file of the Volume pre-dependency item corresponding to the deployment unit, namely the dependency item corresponding to the deployment unit does not contain the disaster tolerance Volume pre-dependency item, a configuration file required by the Volume pre-dependency item is created through environment variable configuration, the Volume is created in the disaster tolerance available area according to the configuration file, and after the creation of the Volume pre-dependency item is completed, the disaster tolerance environment variable is stored in the Volume;
If the data file of the prepositive dependency item corresponding to the deployment unit exists in the disaster tolerance available area, the disaster tolerance deployment unit is created through a Kubernets container management platform, after the creation of the disaster tolerance deployment unit corresponding to each deployment unit in the deployment unit set is completed, the disaster tolerance service postpositive dependency item is created through an environment variable and a service postpositive dependency item, whether the disaster tolerance deployment unit can be accessed through the disaster tolerance service postpositive dependency item is judged, and whether the disaster tolerance service postpositive dependency item is successfully constructed is determined; if the disaster tolerance deployment unit can be accessed through the disaster tolerance post-dependent item, the disaster tolerance post-dependent item is successfully established; and if the disaster recovery post-dependent item cannot access the disaster recovery deployment unit, the disaster recovery post-dependent item is failed to create. In this embodiment, if creation of the disaster tolerant post-dependent item fails, the created disaster tolerant deployment unit is deleted.
In this embodiment, the ConfigMap may be created by either programming a configuration file in YAML (Chinese: format for expressing data serialization) or directly using the kubecect create ConfigMap (Chinese: create application configuration management, kubecect, Chinese: command line interface for running commands to Kubernets clusters) command line; the disaster-tolerant Volume pre-dependency item can be established in a shared storage mode, data in the Volume pre-dependency item are synchronized into the disaster-tolerant Volume pre-dependency item, and the disaster-tolerant Volume pre-dependency item and the Volume pre-dependency item are guaranteed to be named the same; the service creation can be either by an expose command (basic command in kubernets for disclosing a resource as a new kubernets service) or by YAML file creation service.
In this embodiment, before the operation of obtaining the configuration information associated with each deployment unit according to the operation information of each deployment unit is performed, the production available area may query whether the disaster recovery deployment units with the same name exist in the corresponding disaster recovery available area according to the deployment unit identifiers of each deployment unit, and if the disaster recovery deployment units with the same name exist, output retry prompt information to prompt deletion of the prompt information of the disaster recovery deployment units with the same name originally deployed, and then re-deploy the disaster recovery deployment units; and if the disaster recovery deployment units with the same name do not exist, executing operation of acquiring configuration information associated with each deployment unit according to the operation information of each deployment unit, and finishing the creation of the disaster recovery deployment units. In this embodiment, before creating the corresponding disaster recovery deployment unit according to the operation information of each deployment unit, the production available area needs to query whether the disaster recovery deployment unit with the same name exists in the corresponding disaster recovery available area, so as to ensure that the created disaster recovery deployment unit is created according to the operation information of the deployment unit, and ensure the consistency between the disaster recovery deployment unit and the deployment unit.
According to the embodiment of the application, the disaster recovery deployment units of the deployment units are deployed according to the operation information of the deployment units, the equipment corresponding to the disaster recovery deployment units is used as the disaster recovery clusters corresponding to the application software, the operation information of the deployment units in the usable area detection deployment unit set is produced, the target deployment unit with updated operation information is determined, and the operation information of the disaster recovery deployment units corresponding to the target deployment units is updated according to the operation information of the target deployment units.
In the embodiment of the application, the production available area acquires configuration information associated with the deployment unit identifier according to the operation information of each deployment unit, creates the disaster recovery deployment unit according to the configuration information, ensures the consistency between the deployment unit and the corresponding disaster recovery deployment unit, and updates the operation information of the corresponding disaster recovery deployment unit according to the operation information of the target disaster recovery deployment unit after the disaster recovery cluster is established, thereby further ensuring the consistency between the deployment unit and the corresponding disaster recovery deployment unit.
As shown in fig. 5, fig. 5 is a schematic flowchart of an embodiment of determining whether a corresponding disaster recovery deployment unit has been deployed in an access switching method of application software according to an embodiment of the present application.
In some embodiments of the present application, a method for determining whether a corresponding disaster recovery deployment unit has been deployed in an access switching method of application software is specifically described, which specifically includes:
401, if the target deployment unit corresponding to the initial access address is abnormal, determining whether the target deployment unit has a corresponding disaster recovery deployment unit.
In the embodiment of the application, if the target deployment unit corresponding to the initial access address is abnormal, the production available area queries whether a disaster recovery deployment unit with the same deployment unit identifier exists in the disaster recovery available area according to the deployment unit identifier of the target deployment unit, and judges whether the target deployment unit has a corresponding disaster recovery deployment unit; if the disaster recovery deployment units with the same deployment unit identification exist in the disaster recovery available area, the fact that the target deployment unit has the corresponding disaster recovery deployment unit is explained; and if the disaster recovery deployment units with the same deployment unit identification do not exist in the disaster recovery available area, indicating that the target deployment unit does not have the corresponding disaster recovery deployment unit.
402, if the target deployment unit has a corresponding disaster recovery deployment unit, comparing the dependency item of the target deployment unit with the disaster recovery dependency item of the disaster recovery deployment unit.
If the target deployment unit has the corresponding disaster recovery deployment unit, the production available area obtains the configuration information of the target deployment unit according to the deployment unit identifier, and obtains the dependency item associated with the target deployment unit according to the configuration information; obtaining disaster tolerance dependency items of the disaster tolerance deployment units in the same way, and matching the dependency items of the target deployment units with the disaster tolerance dependency items of the disaster tolerance deployment units; if the configuration files of the dependency items of the target deployment unit are different from the configuration files of the disaster recovery dependency items of the disaster recovery deployment unit, it indicates that the configuration of the dependency items of the target deployment unit is inconsistent with the configuration of the disaster recovery dependency items of the disaster recovery deployment unit, and the dependency items of the target deployment unit are not matched with the disaster recovery dependency items of the disaster recovery deployment unit; if the configuration file of the dependency item of the target deployment unit is the same as the data information in the configuration file of the disaster recovery dependency item of the disaster recovery deployment unit, it indicates that the configuration of the dependency item of the target deployment unit is consistent with the configuration of the disaster recovery dependency item of the disaster recovery deployment unit, and the dependency item of the target deployment unit is matched with the disaster recovery dependency item of the disaster recovery deployment unit.
403, if the dependency item of the target deployment unit matches the disaster recovery dependency item of the disaster recovery deployment unit, determining that the target deployment unit has deployed the corresponding disaster recovery deployment unit.
And if the dependency item of the target deployment unit is matched with the disaster recovery dependency item of the disaster recovery deployment unit, producing an available area, judging that the target deployment unit has deployed the corresponding disaster recovery deployment unit, and executing operation for inquiring the running state of the disaster recovery deployment unit.
404, if the target deployment unit does not have a corresponding disaster recovery deployment unit, or the dependency item of the target deployment unit is not matched with the disaster recovery dependency item of the disaster recovery deployment unit, determining that the target deployment unit does not deploy the corresponding disaster recovery deployment unit.
In the embodiment of the application, if the target deployment unit does not have the corresponding disaster recovery deployment unit, or the dependency item of the target deployment unit is not matched with the disaster recovery dependency item of the disaster recovery deployment unit, the production available area determines that the target deployment unit does not deploy the corresponding disaster recovery deployment unit, and outputs the prompt information that the access switching of the application software cannot be performed.
In the embodiment of the application, the production available area determines whether the target deployment unit has the corresponding disaster recovery deployment unit by using the uniqueness of the deployment unit identifier, determines whether the dependency configuration of the target deployment unit and the corresponding disaster recovery deployment unit is consistent, determines whether the target deployment unit has deployed the corresponding disaster recovery deployment unit by two-round determination, and provides data guarantee for access switching of application software.
As shown in fig. 6, fig. 6 is a schematic flowchart of an embodiment of querying an operating state of the disaster recovery deployment unit in the access switching method of application software provided in the embodiment of the present application.
In some embodiments of the present application, a method for querying an operating state of a disaster recovery deployment unit in an access switching method of application software is described in detail, and specifically includes:
501, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, querying a state of the disaster recovery deployment unit corresponding to the target deployment unit.
In the embodiment of the application, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, the production available area inquires the state of the disaster recovery deployment unit in the corresponding disaster recovery available area, and judges whether the corresponding disaster recovery deployment unit is started or not according to the state of the disaster recovery deployment unit; if the state of the disaster recovery deployment unit is suspended, the disaster recovery deployment unit is not started, and the state of the disaster recovery deployment unit is judged to be not started; and if the state of the disaster recovery deployment unit is in operation, indicating that the disaster recovery deployment unit is started, and judging that the state of the disaster recovery deployment unit is started.
502, if the state of the disaster recovery deployment unit is started, querying the operation state of the disaster recovery deployment unit according to the operation information of the disaster recovery deployment unit.
If the disaster recovery deployment unit is started, the production available area acquires the running information of the corresponding disaster recovery deployment unit, performs health check on the running information, checks the running state of the disaster recovery deployment unit according to the health check result, and determines whether the running state of the disaster recovery deployment unit is normal; if the result of the health check shows that the disaster recovery deployment unit passes the health check, the running state of the disaster recovery deployment unit is normal; and if the result of the health check shows that the disaster recovery deployment unit does not pass the health check or the result of the health check is unknown, the abnormal operation state of the disaster recovery deployment unit is indicated.
503, if the state of the disaster recovery deployment unit is not started, starting the disaster recovery deployment unit, and updating the operation information of the disaster recovery deployment unit.
If the disaster recovery deployment unit is not started, the production available area sends a request for starting the disaster recovery deployment unit to the corresponding disaster recovery available area, so that the disaster recovery available area starts the disaster recovery deployment unit, the scheduling of the disaster recovery deployment unit is completed, the operation information of the disaster recovery deployment unit is updated, and the operation of inquiring the operation state of the disaster recovery deployment unit according to the operation information of the disaster recovery deployment unit is executed.
In the embodiment of the application, the state of the disaster recovery deployment unit can be determined by querying whether the disaster recovery deployment unit corresponding to the target deployment unit completes scheduling, and specifically, by checking the phase of the corresponding disaster recovery deployment unit (where the phase is a simple macro summary of the life cycle of the deployment unit, and the value of the phase includes suspend (Pending, in chinese), run (Running, in chinese: Running), success (successful termination, in chinese: Failed termination), failure (Failed, in chinese: Failed termination) and Unknown (Unknown, in chinese: Unknown)), whether the corresponding disaster recovery deployment unit completes scheduling is determined according to the value of the phase; if the value of the phase is suspended, the corresponding disaster recovery deployment unit does not finish scheduling, and the state of the disaster recovery deployment unit is judged to be not started; if the phase value is in operation, the disaster recovery deployment unit completes scheduling, and the state of the disaster recovery deployment unit is judged to be started.
In the embodiment of the application, the health check can be performed on the operation information through the container probe to obtain the health state, and whether the operation state of the disaster recovery deployment unit is normal or not is determined according to the health state, specifically, a TCP (Transmission Control Protocol) check can be performed through an IP address and a port number of the disaster recovery deployment unit; if the TCP connection can be established with the disaster recovery deployment unit through the port, outputting prompt information that the health check passes, and indicating that the disaster recovery deployment unit passes the health check; if the TCP connection can not be established, outputting prompt information that the health check fails, and indicating that the health check of the disaster recovery deployment unit fails; and if the disaster recovery deployment unit cannot be found through the IP address and the port number of the disaster recovery deployment unit, outputting prompt information of failure of health check, and indicating that the result of the health check of the disaster recovery deployment unit is unknown. In the embodiment of the application, the health check of the running information can be carried out through a liveness probe (Chinese: survivability detection) and a readness probe (Chinese: readiness detection) container probe.
In the embodiment of the application, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, the operating information of the disaster recovery deployment unit is used to query the operating state of the disaster recovery deployment unit, so as to ensure that the application software can be normally accessed after the access of the application software is switched to the corresponding disaster recovery available area.
As shown in fig. 7, fig. 7 is a schematic flowchart of an embodiment of deployment unit deployment in an access switching method of application software according to the embodiment of the present application.
In some embodiments of the present application, a method for deploying a deployment unit in an access switching method of application software is described in detail, and specifically includes:
601, receiving an application program deployment request, defining environment variables of the application program according to the deployment request, and manufacturing a mirror image based on the environment variables.
In the embodiment of the application, a production available area receives an application program deployment request, and determines a basic mirror image, an installation package, a configuration file and a related script file required by the preparation of the deployment of the application program according to the deployment request, wherein the configuration file can quantify a configuration item required to be customized in the deployment of the application program; defining environment variables of the application program, and quantizing one or more configuration items needing to be modified in the configuration file and the related script file; and making a mirror image based on the environment variable, the installation package, the configuration file and the related script file.
And 602, making a dependent item based on the image, and deploying a deployment unit of the application program according to the dependent item.
The method comprises the steps of associating according to an environment variable and a configuration file development warehouse in an image, manufacturing template files supporting application program operation service according to an application program (wherein the template files comprise a front dependency template file and a rear dependency template file), manufacturing dependency items by modifying corresponding configuration items in the template files according to the application program through the environment variable on a Kubernets container management platform, determining data files required by deployment units for deploying the application program through the dependency items, and completing deployment of the deployment units of the application program through the environment variable configuration data files.
According to the deployment unit deployment method and device, the deployment unit deployment can be completed according to the application program by making the mirror image and the configuration file, the dependent item is made by modifying the corresponding configuration item in the template file according to the application program through the environment variable, and efficient and convenient deployment of the deployment unit is provided.
Fig. 8 is a schematic structural diagram of an embodiment of the access switching device for application software provided in the embodiment of the present application, where fig. 8 is a schematic structural diagram of an embodiment of the access switching device for application software provided in the embodiment of the present application.
The access switching device of the application software runs a computer-readable storage medium corresponding to the access switching of the application software to perform a step of the access switching of the application software, the access switching device of the application software comprising: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor as steps in the access switching method for application software in any of the above embodiments of the access switching method for application software.
Specifically, the method comprises the following steps: the access switching device of the application software includes components such as a processor 801 of one or more cores, a memory 802 of one or more computer-readable storage media, a power supply 803, and an input unit 804. Those skilled in the art will appreciate that the access switching device configuration of the application software illustrated in fig. 8 does not constitute a limitation of the access switching device of the application software, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. Wherein:
the processor 801 is a control center of the access switching device of the application software, connects various parts of the access switching device of the application software by using various interfaces and lines, calls data stored in the memory 802 by operating or executing software programs and/or modules in the memory 802, executes various functions of the access switching device of the application software and processes the data, and thereby performs overall monitoring of the access switching device of the application software. Alternatively, processor 801 may include one or more processing cores; preferably, the processor 802 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 801.
The memory 802 may be used to store software programs and modules, and the processor 801 executes various functional applications and data processing by operating the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, an application program required by at least one function (such as an access request receiving function, an operation state query function of the disaster recovery deployment unit, an access request switching function, and the like); the storage data area may store data created according to use of the access switching device of the application software, and the like. Further, the memory 802 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 access to the memory 802.
The access switching device for application software further comprises a power supply 803 for supplying power to each component, and preferably, the power supply 803 can be logically connected with the processor 801 through a power management system, so that functions of charging, discharging, power consumption management and the like can be managed through the power management system. The power supply 802 may also include one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and any other components.
The access switching device of the order application may further include an input unit 804, and the input unit 804 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the access switching device of the application software may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 801 in the access switching device of the application software loads the executable file corresponding to the process of one or more application programs into the memory 802 according to the following instructions, and the processor 801 runs the application program stored in the memory 1002, thereby implementing various functions as follows: receiving an access request, and acquiring an initial access address associated with the access request; if the target deployment unit corresponding to the initial access address is abnormal, judging whether the target deployment unit deploys the corresponding disaster recovery deployment unit; if the target deployment unit has deployed the corresponding disaster recovery deployment unit, inquiring the running state of the disaster recovery deployment unit; and if the running state of the disaster recovery deployment unit is normal, switching the access request to a target network address corresponding to the disaster recovery deployment unit.
It will be understood by those skilled in the art that all or part of the steps of the methods in the above embodiments may be performed by instructions or by instructions controlling associated hardware, and the instructions may be stored in a computer readable storage medium and loaded or executed by a processor.
To this end, an embodiment of the present invention provides a computer-readable storage medium, which may include: Read-Only Memory (ROM, Chinese: ROM), Random Access Memory (RAM, Chinese: RAM), magnetic or optical disk, etc. The access switching method comprises a step of switching access of application software, and a step of executing the step of switching access of application software. For example, the computer program may be loaded by a processor to perform the steps of: receiving an access request, and acquiring an initial access address associated with the access request; if the target deployment unit corresponding to the initial access address is abnormal, judging whether the target deployment unit deploys the corresponding disaster recovery deployment unit; if the target deployment unit has deployed the corresponding disaster recovery deployment unit, inquiring the running state of the disaster recovery deployment unit; and if the running state of the disaster recovery deployment unit is normal, switching the access request to a target network address corresponding to the disaster recovery deployment unit. In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed descriptions of other embodiments, and are not described herein again.
In a specific implementation, each unit or structure may be implemented as an independent entity, or may be combined arbitrarily to be implemented as one or several entities, and the specific implementation of each unit or structure may refer to the foregoing method embodiment, which is not described herein again.
The foregoing describes in detail an access switching method, device and computer-readable storage medium for application software according to an embodiment of the present invention, and a specific example is applied in the present disclosure to explain the principle and implementation of the present invention, and the description of the foregoing embodiment is only used to help understand the method and core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. An access switching method for application software, the method comprising:
receiving an access request, and acquiring an initial access address associated with the access request;
if the target deployment unit corresponding to the initial access address is abnormal, judging whether the target deployment unit deploys the corresponding disaster recovery deployment unit;
If the target deployment unit has deployed the corresponding disaster recovery deployment unit, inquiring the running state of the disaster recovery deployment unit;
and if the running state of the disaster recovery deployment unit is normal, switching the access request to a target network address corresponding to the disaster recovery deployment unit.
2. The method for switching access to application software according to claim 1, wherein before receiving an access request and obtaining an initial access address associated with the access request, the method includes:
receiving a disaster recovery deployment request, and determining application software corresponding to the disaster recovery deployment request and a deployment unit set associated with the application software;
acquiring deployment unit identifiers to be deployed in the deployment unit set and operation information of deployment units corresponding to the deployment unit identifiers;
and deploying the disaster recovery deployment units of the deployment units according to the operation information of the deployment units, and taking the equipment corresponding to the disaster recovery deployment units as the disaster recovery clusters corresponding to the application software.
3. The method according to claim 2, wherein the deploying the disaster recovery deployment units of the deployment units according to the operation information of the deployment units, and using the devices corresponding to the disaster recovery deployment units as the disaster recovery clusters corresponding to the application software, comprises:
Acquiring configuration information associated with each deployment unit according to the operation information of each deployment unit;
extracting dependency items and environment variables corresponding to the deployment units from the configuration information associated with the deployment units, and judging whether the dependency items corresponding to the deployment units contain disaster tolerance dependency items;
if the dependency item corresponding to each deployment unit contains a disaster tolerance dependency item, creating a disaster tolerance deployment unit of each deployment unit according to the disaster tolerance dependency item corresponding to each deployment unit, and taking the device corresponding to each disaster tolerance deployment unit as a disaster tolerance cluster corresponding to the application software;
if the dependency item corresponding to each deployment unit does not contain a disaster tolerance dependency item, configuring the disaster tolerance dependency item corresponding to the dependency item through the environment variable corresponding to each deployment unit, creating a disaster tolerance deployment unit of each deployment unit according to each disaster tolerance dependency item, and taking the device corresponding to each disaster tolerance deployment unit as a disaster tolerance cluster corresponding to the application software.
4. The method according to claim 2, wherein after deploying the disaster recovery deployment unit of each deployment unit according to the operation information of each deployment unit and taking the device corresponding to each disaster recovery deployment unit as the disaster recovery cluster corresponding to the application software, the method includes:
Detecting the operation information of each deployment unit, and determining a target deployment unit updated by the operation information;
and updating the operation information of the disaster recovery deployment unit corresponding to the target deployment unit according to the operation information of the target deployment unit.
5. The method for switching access to application software according to claim 1, wherein, if the target deployment unit corresponding to the initial access address is abnormal, determining whether the target deployment unit has deployed the corresponding disaster recovery deployment unit includes:
if the target deployment unit corresponding to the initial access address is abnormal, judging whether the target deployment unit has a corresponding disaster recovery deployment unit;
if the target deployment unit has a corresponding disaster recovery deployment unit, comparing the dependency item of the target deployment unit with the disaster recovery dependency item of the disaster recovery deployment unit;
if the dependency item of the target deployment unit is matched with the disaster recovery dependency item of the disaster recovery deployment unit, determining that the target deployment unit has deployed the corresponding disaster recovery deployment unit;
and if the target deployment unit does not have the corresponding disaster recovery deployment unit and/or the dependency item of the target deployment unit is not matched with the disaster recovery dependency item of the disaster recovery deployment unit, determining that the target deployment unit does not deploy the corresponding disaster recovery deployment unit.
6. The method for switching access to application software according to claim 1, wherein, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, querying the operating state of the disaster recovery deployment unit includes:
if the target deployment unit has deployed the corresponding disaster recovery deployment unit, querying the state of the disaster recovery deployment unit corresponding to the target deployment unit;
if the state of the disaster recovery deployment unit is started, inquiring the operation state of the disaster recovery deployment unit according to the operation information of the disaster recovery deployment unit;
and if the state of the disaster recovery deployment unit is not started, starting the disaster recovery deployment unit and updating the operation information of the disaster recovery deployment unit.
7. The method for switching access to application software according to claim 6, wherein, if the target deployment unit has deployed the corresponding disaster recovery deployment unit, querying the start state of the disaster recovery deployment unit corresponding to the target deployment unit includes:
if the target deployment unit has deployed the corresponding disaster recovery deployment unit, inquiring whether the disaster recovery deployment unit corresponding to the target deployment unit completes scheduling to determine a starting state of the disaster recovery deployment unit;
If the target deployment unit corresponds to the disaster recovery deployment unit and completes scheduling, judging that the starting state of the disaster recovery deployment unit is started;
if the target deployment unit corresponding to the disaster recovery deployment unit does not complete scheduling, judging that the starting state of the disaster recovery deployment unit is not started;
if the starting state of the disaster recovery deployment unit is started, querying the running state of the disaster recovery deployment unit according to the running information of the disaster recovery deployment unit includes:
if the state of the disaster recovery deployment unit is started, acquiring the operation information of the disaster recovery deployment unit;
performing health check on the operation information through a probe, and inquiring the operation state of the disaster recovery deployment unit;
if the health check of the operation information passes, judging that the operation state of the disaster recovery deployment unit is normal;
and if the health check of the operation information does not pass, judging that the operation state of the disaster recovery deployment unit is abnormal.
8. The method for switching access to application software according to any one of claims 1 to 7, wherein before receiving an access request and obtaining an initial access address associated with the access request, the method comprises;
Receiving an application program deployment request, defining an environment variable of the application program according to the deployment request, and manufacturing a mirror image based on the environment variable;
and manufacturing a dependent item based on the image, and deploying a deployment unit of the application program according to the dependent item.
9. An access switching device for application software, the device comprising:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the access switching method of application software of any of claims 1 to 8.
10. A computer-readable storage medium, having stored thereon a computer program which is loaded by a processor to perform the steps in the access switching method of application software according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110040628.4A CN114764379A (en) | 2021-01-13 | 2021-01-13 | Access switching method and device for application software and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110040628.4A CN114764379A (en) | 2021-01-13 | 2021-01-13 | Access switching method and device for application software and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114764379A true CN114764379A (en) | 2022-07-19 |
Family
ID=82364274
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110040628.4A Pending CN114764379A (en) | 2021-01-13 | 2021-01-13 | Access switching method and device for application software and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114764379A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115344327A (en) * | 2022-08-19 | 2022-11-15 | 中电金信软件有限公司 | Application module switching method and device, electronic equipment and readable storage medium |
-
2021
- 2021-01-13 CN CN202110040628.4A patent/CN114764379A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115344327A (en) * | 2022-08-19 | 2022-11-15 | 中电金信软件有限公司 | Application module switching method and device, electronic equipment and readable storage medium |
CN115344327B (en) * | 2022-08-19 | 2023-07-28 | 中电金信软件有限公司 | Application module switching method and device, electronic equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP4095678A1 (en) | Method and apparatus of deploying a cluster, device and storage medium | |
CN112860282B (en) | Cluster plug-in upgrading method, device and server | |
CN106960060B (en) | Database cluster management method and device | |
US10230567B2 (en) | Management of a plurality of system control networks | |
WO2018192478A1 (en) | Cloud management platform, virtual machine management method, system thereof | |
EP3442201B1 (en) | Cloud platform construction method and cloud platform | |
CN111897558A (en) | Kubernets upgrading method and device for container cluster management system | |
CN110716787A (en) | Container address setting method, apparatus, and computer-readable storage medium | |
CN113805969A (en) | Parameter configuration acquisition method and device, storage medium and electronic equipment | |
CN113315754A (en) | Intelligent linkage method, device, equipment and medium for firewall of container visit | |
CN114640709B (en) | Edge node processing method, device and medium | |
CN110365524B (en) | Mirror image upgrading method and system for server node firmware | |
CN114764379A (en) | Access switching method and device for application software and computer readable storage medium | |
CN112631727B (en) | Monitoring method and device for pod group pod | |
CN114221985A (en) | Device control method, device, electronic device and computer-readable storage medium | |
CN113535262A (en) | Method, device, equipment and storage medium for controlling starting of proxy node | |
CN113835834A (en) | K8S container cluster-based computing node capacity expansion method and system | |
CN112261097A (en) | Object positioning method for distributed storage system and electronic equipment | |
CN114116671A (en) | Database migration method, system, server and storage medium | |
CN113407403B (en) | Cloud host management method and device, computer equipment and storage medium | |
CN114995762A (en) | Thick backup roll capacity expansion method, device, equipment and storage medium | |
CN114564530A (en) | Database access method, device, equipment and storage medium | |
CN115993979A (en) | Configuration conversion method, smooth upgrading method, device, equipment and storage medium | |
CN109257221B (en) | Data management control method, network controller and system | |
CN108650320B (en) | Method for synchronizing configuration files of isomorphic cascading equipment in cluster environment |
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 |