CN111277632B - Method and device for managing applications in system cluster - Google Patents

Method and device for managing applications in system cluster Download PDF

Info

Publication number
CN111277632B
CN111277632B CN202010032522.5A CN202010032522A CN111277632B CN 111277632 B CN111277632 B CN 111277632B CN 202010032522 A CN202010032522 A CN 202010032522A CN 111277632 B CN111277632 B CN 111277632B
Authority
CN
China
Prior art keywords
node
application
physical
application state
physical node
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.)
Active
Application number
CN202010032522.5A
Other languages
Chinese (zh)
Other versions
CN111277632A (en
Inventor
刘波
李国振
黄文宝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202010032522.5A priority Critical patent/CN111277632B/en
Publication of CN111277632A publication Critical patent/CN111277632A/en
Application granted granted Critical
Publication of CN111277632B publication Critical patent/CN111277632B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1051Group master selection mechanisms

Abstract

The invention discloses a method and a device for application management in a system cluster, and relates to the technical field of computers. One embodiment of the method comprises: after a physical node of the system cluster is started, updating the application state of each application recorded in the physical node; for each application, modifying the application state of the physical node according to the application state modification mechanism; and correspondingly processing the application according to the modified application state. The implementation mode can realize a high-availability and flexibly-configurable application management mode of the access cluster in a single-point access scene of the external integrated system; when physical nodes of the external connection integrated interface need to be added, a high-availability program does not need to be developed independently, and deployment and application management of the system cluster can be realized through configuration.

Description

Method and device for managing applications in system cluster
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for managing applications in a system cluster.
Background
During the system construction, it may be necessary to export a large number of external systems. Since external systems are very different, access modes have the characteristics of diversity and complexity, and higher requirements are provided for high availability of the external access system.
Since the external integrated system is limited by the only access point of the third-party system, most of the external integrated systems are deployed in a cold standby mode.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1. manual intervention is needed for cold standby mode switching, and configuration files need to be manually adjusted, so that errors are easy to occur;
2. due to the fact that time is needed for cold standby switching, continuity of service transaction cannot be guaranteed, and normal operation of the service is affected;
3. all applications in the cold standby mode run on the main node, and the other standby machine cannot provide services and is in an idle state, so that equipment resources are wasted.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for application management in a system cluster, which can implement a highly available and flexibly configurable application management mode of an access cluster in a single-point access scenario of an external integrated system; when physical nodes of the external connection integrated interface need to be added, a high-availability program does not need to be developed independently, and deployment and application management of the system cluster can be realized through configuration.
To achieve the above object, according to an aspect of the embodiments of the present invention, a method for application management in a system cluster is provided.
A method of application management in a system cluster, comprising: after a physical node of a system cluster is started, updating the application state of each application recorded in the physical node; for each application, modifying the application state of the physical node according to an application state modification mechanism; and correspondingly processing the application according to the modified application state.
Optionally, the type of the application state includes: start, master, slave, suspend, stop, and stateless.
Optionally, the application state modification mechanism includes: when the physical node is started, setting the application state of the physical node to be 'started'; setting the application state of the physical node to "stopped" when the physical node is stopped; and when the physical node does not acquire the application states of other physical nodes included in the system cluster, setting the application state of the physical node to be 'stateless'.
Optionally, the application state modification mechanism includes: if the application state of the physical node is 'start', the physical node is a preferred node of the application, and no physical node with the application state set as 'master node' exists in all the physical nodes of the system cluster, setting the application state of the physical node as 'master node'; if the application state of the physical node is 'start', the physical node is a preferred node of the application, and a physical node with an application state of 'master node' exists in all physical nodes of the system cluster, setting the application state of the physical node as a 'slave node'; and if the application state of the physical node is 'start' and the physical node is the alternative node of the application, setting the application state of the physical node to 'suspend'.
Optionally, the application state modification mechanism includes: and if the application state of the physical node is 'suspended' and the set waiting time is exceeded, setting the application state of the physical node as a 'slave node'.
Optionally, the application state modification mechanism includes: if the application state of the physical node is a slave node, the physical node is an alternative node of the application, the first-choice node of the application is down, and no physical node with the application state set as a master node is in the alternative nodes of the application, the application state of the physical node is set as the master node when the physical node meets a master node selection rule; if the application state of the physical node is a slave node, the physical node is a preferred node of the application, and the application has no alternative node in the system cluster, the application state of the physical node is set as a master node; and if the application state of the physical node is a slave node, the physical node is a preferred node of the application, and the application state of the physical node is set as a master node within the set switching-back time.
Optionally, the master node selection rule is: the temporary node name of the physical node has the smallest lexicographic ordering among all the candidate nodes.
Optionally, the application state modification mechanism includes: and if the application state of the physical node is the 'master node', the physical node is a candidate node of the application, and the preferred node of the application normally operates in the set back switching time, setting the application state of the physical node as a 'slave node'.
Optionally, the application state modification mechanism includes: and if the application state of the physical node is 'stop', the application state of the physical node does not need to be modified.
Optionally, performing corresponding processing on the application according to the modified application state includes: if the modified application state is the 'main node', starting the application; and if the modified application state is not the 'main node' and the application state before modification is the 'main node', stopping the application.
Optionally, data interaction is performed between the physical nodes through heartbeat monitoring to obtain application state information of all the physical nodes.
Optionally, the deployment manner of the physical nodes in the system cluster includes: registry-based hot standby deployment and non-registry-based hot standby deployment.
According to another aspect of the embodiments of the present invention, an apparatus for application management in a system cluster is provided.
An apparatus for application management in a system cluster, comprising: the state updating module is used for updating the application state of each application recorded in the physical node after the physical node of the system cluster is started; the state modification module is used for modifying the application state of the physical node according to an application state modification mechanism for each application; and the application processing module is used for carrying out corresponding processing on the application according to the modified application state.
According to another aspect of the embodiment of the invention, an electronic device for application management in a system cluster is provided.
An electronic device for application management in a system cluster, comprising: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for application management in the system cluster provided by the embodiment of the invention.
According to yet another aspect of embodiments of the present invention, a computer-readable medium is provided.
A computer readable medium, on which a computer program is stored, which when executed by a processor implements a method for application management in a system cluster as provided by an embodiment of the invention.
One embodiment of the above invention has the following advantages or benefits: after a physical node of a system cluster is started, updating the application state of each application recorded in the physical node; for each application, modifying the application state of the physical node according to the application state modification mechanism; the application is correspondingly processed according to the modified application state, so that a high-availability and flexibly-configurable application management mode of an access cluster in a single-point access scene of the external integrated system is realized; when physical nodes of the external connection integrated interface need to be added, a high-availability program does not need to be developed independently, and deployment and application management of the system cluster can be realized through configuration. In addition, the cluster deployment can be carried out on the basis of the registration center or not on the basis of the registration center aiming at the external integrated system cluster, so that the cluster deployment mode is flexible and the usability is high; in addition, in the operation process of the system cluster, when MASTER nodes MASTER of the application conflict, a dictionary sequence selection mechanism is adopted, and the uniqueness of the MASTER nodes can be ensured.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of application management in a system cluster according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a deployment structure of a system cluster according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an application state transition process according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a deployment architecture of a system cluster according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the main modules of an apparatus for application management in a system cluster according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to solve the problems in the prior art, the invention provides a method and a device for managing applications in a system cluster, which can solve the cold standby problem of an external integrated system and realize hot standby; the problem of automatic switching after single-point failure of the external integrated system is solved, and the service continuity is guaranteed; the mutual hot standby of multiple applications of the external connection integrated system is realized, and the resources of the standby machine are fully utilized; and the management of the external connection cluster is realized without the Zookeeper mode or based on the Zookeeper mode.
Fig. 1 is a schematic diagram of the main steps of a method for application management in a system cluster according to an embodiment of the present invention. As shown in fig. 1, the method for application management in a system cluster according to an embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: after a physical node of the system cluster is started, updating the application state of each application recorded in the physical node;
step S102: for each application, modifying the application state of the physical node according to the application state modification mechanism;
step S103: and correspondingly processing the application according to the modified application state.
In order to achieve high availability of the system cluster, the high-availability client of the physical node maintains an application state information table of the node (in the introduction of the embodiment of the present invention, the node and the physical node or the local machine both refer to the physical node corresponding to the machine deploying the application in the system cluster), and provides a uniform interface service to periodically exchange the application state information table with the high-availability clients of other physical nodes. In the embodiment of the invention, data interaction is carried out between the physical nodes of the system cluster through heartbeat monitoring so as to obtain the application state information of all the physical nodes. And the high-availability client of each physical node is responsible for judging whether the host node is the MASTER node applied by the host computer. And the high-availability client is responsible for pulling up the application program which is the MASTER node according to the application distribution information table.
The high-availability client of the physical node is responsible for maintaining an application state information table of the node, the information table comprises three parts, namely application information, physical information and node information, and main data items are shown in table 1. When the node is started, all data item information of the node is maintained to the memory according to the application dimension, and interface service is provided for other physical nodes to be synchronized.
Table 1 application state information table
Figure BDA0002364850690000071
Wherein, the application name is: the application program is published on the physical node and used for connecting an external system; deployment mode: two modes of hot standby support and active mode are configured; starting a script: the application starting script can be the script program itself started by the application and also can refer to the storage position of the script program started by the application; and (3) stopping the script: the application stopping script can be the script program itself of which the application is stopped, and can also refer to the storage position of the script program of which the application is stopped; and (4) checking the script: checking whether the application program runs a normal script or not; machine name: a physical node machine name; IP address: a physical node IP address; and (3) applying a registration path: a path registered at a registry (e.g., a Zookeeper cluster) for uniquely identifying an application; the application state is as follows: recording the running state of the application on the physical node; temporary node name: the temporary node names have a one-to-one correspondence with the physical nodes, and when the cluster has application state conflicts, the temporary node names are used for solving the conflicts according to the lexicographic ordering.
And after the high-availability client of the physical node is started, initializing and loading the application state information table to the memory according to the default configuration file. And initializing the application state of each application in each physical node according to a default configuration file by using the application state information table of the high-availability client of the physical node.
Fig. 2 is a schematic diagram of a deployment structure of a system cluster according to an embodiment of the present invention, as shown in fig. 2, it is assumed that there are 3 physical nodes of an external integrated system, which are respectively HostNode-001, HostNode-002, and HostNode-003, and it is assumed that there are 3 applications, which are respectively named as App1, App2, and App3, and the applications are used as major dimensions, and a preferred node and an alternative node are respectively set for each application, where the preferred node refers to a node that is preferred as a major node for the application, and the alternative node refers to a node that is selected as a major node for the application when the preferred node is down. After the system cluster is normally started, the high-availability client of the physical node firstly establishes a fixed application node of an application name for each physical node in a memory and maintains the running state information of each application at each physical node.
Taking App1 as an example, assume that the preferred node of App1 is physical node HostNode-001, and the candidate nodes are physical nodes HostNode-002 and HostNode-003. Then, when the system cluster normally operates, the MASTER node MASTER of App1 is physical node HostNode-001, and the SLAVE node SLAVE is physical node HostNode-002 and physical node HostNode-003.
By initializing the configuration file, the hot standby preferred node and the alternative node of the application are flexibly configured, so that one-to-one mutual standby, one standby and multiple scenes of the application program between the physical nodes can be realized.
In the embodiment of the present invention, the high-availability client of the physical node mainly can implement the following functions:
1. the heartbeat is regularly maintained with the high-availability client sides of other physical nodes so as to detect the running state of the physical nodes;
2. regularly acquiring the application states of other nodes and updating the application state information table to the local so as to update the running states of the physical nodes and the applications of the whole system cluster;
3. according to the application state modification mechanism, all application states of the physical nodes of the machine are modified, and service is provided for high-availability client query of other physical nodes;
4. and the application program on the physical node is started and stopped according to the application state information table.
Specifically, the high-availability client of each physical node only provides the states of all the applications of the local node for query, and periodically acquires the application state information on other physical nodes from the high-availability clients of other physical nodes and updates the application state information to the local memory.
Generally, an external system only provides one access point, an application of an external integrated system can only run on one physical node at the same time, the physical node is a MASTER node of the application, the application state is MASTER, other physical nodes are used as SLAVE nodes of the application (mainly used as backup nodes of the application), and the application state is SLAVE.
According to the embodiment of the invention, the high-availability client of each physical node expands the type of the application state for managing the external integrated system cluster, and the type of the application state mainly comprises the following steps: START, "START", MASTER ", SLAVE", HOLD ", STOP" and no state "NONE".
After the physical node starts to run, the application state of the physical node is set and modified according to the modification mechanism of the application state. Because each physical node may be deployed with a plurality of applications, and when the application state is modified, the application is used as a main dimension, for each application, the physical node modifies the application state according to an application state modification mechanism, and the applications do not interfere with each other. Wherein, the application state modification mechanism mainly comprises:
rule 1: when a physical node is started, setting the application state of the physical node to be 'START';
rule 2: when the physical node STOPs, setting the application state of the physical node as STOP, and if the application exists in the operation of the physical node, stopping the application;
rule 3: and when the physical node cannot acquire the application states of other physical nodes included in the system cluster, setting the application state of the physical node to be 'NONE' without state. At this time, the physical node may be down or disconnected from the network connection with other physical nodes, so that the application states of other physical nodes cannot be acquired;
rule 4: if the application state of the physical node is 'START', the physical node is a first-choice node of the application, and no physical node with the application state set as 'MASTER node MASTER' exists in all the physical nodes of the system cluster, the application state of the physical node is set as 'MASTER node MASTER';
rule 5: if the application state of the physical node is 'START', the physical node is a preferred node of the application, and the physical node with the application state of 'MASTER node MASTER' exists in all the physical nodes of the system cluster, setting the application state of the physical node to 'SLAVE node SLAVE';
rule 6: if the application state of the physical node is 'START' and the physical node is an alternative node of the application, setting the application state of the physical node to 'suspend HOLD';
rule 7: if the application state of the physical node is 'suspend HOLD' and the set waiting time is exceeded, the application state of the physical node is set to 'SLAVE node SLAVE'. Here, the set waiting time is the time for each physical node to determine whether the physical node itself can be modified to the MASTER node MASTER process according to the MASTER node selection rule. In the embodiment of the invention, the main node selection rule is as follows: the temporary node names of the physical nodes have the smallest lexicographic ordering among all the alternative nodes, wherein the lexicographic ordering is based on a method that words arranged in alphabetical order are arranged in alphabetical order;
rule 8: if the application state of the physical node is SLAVE node SLAVE, the physical node is an alternative node for application, and the first-choice node for application is down (including disconnected network connection), and there is no physical node with the application state set as MASTER node MASTER in all the alternative nodes for application, the application state of the physical node is set as MASTER node MASTER when the physical node meets the MASTER node selection rule;
rule 9: if the application state of the physical node is 'SLAVE node SLAVE', the physical node is a preferred node of the application, and the application is applied to the system cluster without any alternative node, the application state of the physical node is set to 'MASTER node';
rule 10: and if the application state of the physical node is 'SLAVE node SLAVE', the physical node is a preferred node of the application, and the application state of the physical node is currently in the set back switching time, the application state of the physical node is set to 'MASTER node MASTER'. Wherein, the switching-back time refers to the time for recovering to the primary and alternative nodes of the initialization configuration;
rule 11: if the application state of the physical node is 'MASTER node MASTER', the physical node is an alternative node for application, and the first-choice node of the application normally operates within the set back-switching time, the application state of the physical node is set to 'SLAVE node SLAVE';
rule 12: if the application state of the physical node is "STOP", the application state of the physical node does not need to be modified, and at this time, the physical node only needs to wait for exiting.
In the above rules, in rule 1 to rule 3, the physical node does not need to perform application state data interaction with other physical nodes in the system cluster when performing application state modification; rules 4 to 11 introduce the situation that the application state is modified after the application state interaction between the physical node and other physical nodes in the system cluster is performed; rule 12 describes the case where no application state modification is required.
According to the embodiment of the present invention, after the application state modification is performed according to the application state modification mechanism, the high-availability client of the physical node may perform corresponding processing on the application according to the modification condition of the application state, specifically, the method includes:
if the modified application state is 'MASTER node MASTER', starting the application;
and if the modified application state is not the MASTER node MASTER and the application state before modification is the MASTER node MASTER, stopping the application.
Fig. 3 is a schematic diagram of an application state transition process according to an embodiment of the present invention. As shown in fig. 3, a transition process for a highly available client of a physical node to modify an application state according to an application state modification mechanism is shown.
According to the embodiment of the invention, the deployment mode of the physical nodes in the system cluster comprises the following steps: registry-based hot standby deployment and non-registry-based hot standby deployment.
Fig. 4 is a schematic diagram of a deployment architecture of a system cluster according to an embodiment of the present invention. As shown in fig. 4, the system cluster of the present invention currently supports deployment and management of clusters based on a Zookeeper mode of a registry and not based on the Zookeeper mode, including MASTER node selection, application daemon monitoring, application health check, and the like. If cluster deployment is carried out based on the registration center Zookeeper mode, each physical node can realize data interaction with other physical nodes through the registration center Zookeeper; if the cluster deployment is not performed based on the Zookeeper mode of the registry, data interaction can be directly performed between each physical node and other physical nodes through heartbeat monitoring.
Fig. 5 is a schematic diagram of main modules of an apparatus for application management in a system cluster according to an embodiment of the present invention. As shown in fig. 5, the apparatus 500 for application management in a system cluster according to an embodiment of the present invention mainly includes a state updating module 501, a state modifying module 502, and an application processing module 503.
A state updating module 501, configured to update an application state of each application recorded in a physical node after the physical node of the system cluster is started;
a state modification module 502, configured to modify, for each application, an application state of the physical node according to an application state modification mechanism;
and an application processing module 503, configured to perform corresponding processing on the application according to the modified application state.
According to one embodiment of the invention, the types of application states include: start, master, slave, suspend, stop, and stateless.
According to another embodiment of the invention, applying the state modification mechanism comprises:
when the physical node is started, setting the application state of the physical node to be 'started';
setting the application state of the physical node to "stopped" when the physical node is stopped;
and when the physical node does not acquire the application states of other physical nodes included in the system cluster, setting the application state of the physical node to be 'stateless'.
According to yet another embodiment of the invention, applying the state modification mechanism comprises:
if the application state of the physical node is 'start', the physical node is a preferred node of the application, and no physical node with the application state set as 'master node' exists in all the physical nodes of the system cluster, setting the application state of the physical node as 'master node';
if the application state of the physical node is 'start', the physical node is a preferred node of the application, and a physical node with an application state of 'master node' exists in all physical nodes of the system cluster, setting the application state of the physical node as a 'slave node';
and if the application state of the physical node is 'start' and the physical node is the alternative node of the application, setting the application state of the physical node to 'suspend'.
According to yet another embodiment of the invention, applying the state modification mechanism comprises:
and if the application state of the physical node is 'suspended' and the set waiting time is exceeded, setting the application state of the physical node as a 'slave node'.
According to yet another embodiment of the invention, applying the state modification mechanism comprises:
if the application state of the physical node is a slave node, the physical node is an alternative node of the application, the first-choice node of the application is down, and no physical node with the application state set as a master node is in the alternative nodes of the application, the application state of the physical node is set as the master node when the physical node meets a master node selection rule;
if the application state of the physical node is a slave node, the physical node is a preferred node of the application, and the application has no alternative node in the system cluster, the application state of the physical node is set as a master node;
and if the application state of the physical node is a slave node, the physical node is a preferred node of the application, and the application state of the physical node is set as a master node within the set switching-back time.
According to yet another embodiment of the invention, applying the state modification mechanism comprises:
and if the application state of the physical node is the 'master node', the physical node is a candidate node of the application, and the preferred node of the application normally operates in the set back switching time, setting the application state of the physical node as a 'slave node'.
In another embodiment of the present invention, the master node selection rule is: the temporary node name of the physical node has the smallest lexicographic ordering among all the candidate nodes.
According to yet another embodiment of the invention, applying the state modification mechanism comprises:
and if the application state of the physical node is 'stop', the application state of the physical node does not need to be modified.
According to an embodiment of the present invention, the application processing module 503 may be further configured to:
if the modified application state is the 'main node', starting the application;
and if the modified application state is not the 'main node' and the application state before modification is the 'main node', stopping the application.
According to the embodiment of the invention, data interaction is carried out between the physical nodes through heartbeat monitoring so as to obtain the application state information of all the physical nodes.
In the embodiment of the present invention, the deployment manner of the physical nodes in the system cluster includes: registry-based hot standby deployment and non-registry-based hot standby deployment.
According to the technical scheme of the embodiment of the invention, after the physical node of the system cluster is started, the application state of each application recorded in the physical node is updated; for each application, modifying the application state of the physical node according to the application state modification mechanism; the application is correspondingly processed according to the modified application state, so that a high-availability and flexibly-configurable application management mode of an access cluster in a single-point access scene of the external integrated system is realized; when physical nodes of the external connection integrated interface need to be added, a high-availability program does not need to be developed independently, and deployment and application management of the system cluster can be achieved through configuration. In addition, the cluster deployment can be carried out on the basis of the registration center or not on the basis of the registration center aiming at the external integrated system cluster, so that the cluster deployment mode is flexible and the usability is high; in addition, in the operation process of the system cluster, when MASTER nodes MASTER of the application conflict, a dictionary sequence selection mechanism is adopted, and the uniqueness of the MASTER nodes can be ensured.
Fig. 6 illustrates an exemplary system architecture 600 of a method for application management in a system cluster or an apparatus for application management in a system cluster, to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for application management in a system cluster provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the apparatus for application management in a system cluster is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, a block diagram of a computer system 700 suitable for use with a terminal device or server implementing an embodiment of the invention is shown. The terminal device or the server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, and may be described as: a processor includes a state update module, a state modification module, and an application processing module. The names of these units or modules do not constitute a limitation to the units or modules themselves in some cases, for example, the status update module may also be described as "a module for updating the application status of each application recorded in a physical node of a system cluster after the physical node is started".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: after a physical node of a system cluster is started, updating the application state of each application recorded in the physical node; for each application, modifying the application state of the physical node according to an application state modification mechanism; and correspondingly processing the application according to the modified application state.
According to the technical scheme of the embodiment of the invention, after the physical node of the system cluster is started, the application state of each application recorded in the physical node is updated; for each application, modifying the application state of the physical node according to the application state modification mechanism; the application is correspondingly processed according to the modified application state, so that a high-availability and flexibly-configurable application management mode of an access cluster in a single-point access scene of the external integrated system is realized; when physical nodes of the external connection integrated interface need to be added, a high-availability program does not need to be developed independently, and deployment and application management of the system cluster can be realized through configuration. In addition, the cluster deployment can be carried out on the basis of the registration center or not on the basis of the registration center aiming at the external integrated system cluster, so that the cluster deployment mode is flexible and the usability is high; in addition, in the operation process of the system cluster, when MASTER nodes MASTER of the application conflict, a dictionary sequence selection mechanism is adopted, and the uniqueness of the MASTER nodes can be ensured.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (13)

1. A method for application management in a system cluster, comprising:
after a physical node of a system cluster is started, updating the application state of each application recorded in the physical node;
for each application, modifying the application state of the physical node according to an application state modification mechanism;
performing corresponding processing on the application according to the modified application state;
the application state modification mechanism comprises:
if the application state of the physical node is 'start', the physical node is a preferred node of the application, and no physical node with the application state set as 'master node' exists in all the physical nodes of the system cluster, setting the application state of the physical node as 'master node';
if the application state of the physical node is 'start', the physical node is a preferred node of the application, and a physical node with an application state of 'master node' exists in all physical nodes of the system cluster, setting the application state of the physical node as a 'slave node';
and if the application state of the physical node is 'start' and the physical node is the alternative node of the application, setting the application state of the physical node to 'suspend'.
2. The method of claim 1, wherein the type of application state comprises: start, master, slave, suspend, stop, and stateless.
3. The method of claim 2, wherein applying the state modification mechanism comprises:
and if the application state of the physical node is 'suspended' and the set waiting time is exceeded, setting the application state of the physical node as a 'slave node'.
4. The method of claim 2, wherein applying the state modification mechanism comprises:
if the application state of the physical node is a slave node, the physical node is an alternative node of the application, the first-choice node of the application is down, and no physical node with the application state set as a master node is in the alternative nodes of the application, the application state of the physical node is set as the master node when the physical node meets a master node selection rule;
if the application state of the physical node is a slave node, the physical node is a preferred node of the application, and the application has no alternative node in the system cluster, the application state of the physical node is set as a master node;
and if the application state of the physical node is a slave node, the physical node is a preferred node of the application, and the application state of the physical node is set as a master node within the set switching-back time.
5. The method of claim 4, wherein the master node selection rule is: the temporary node name of the physical node has the smallest lexicographic ordering among all the candidate nodes.
6. The method of claim 2, wherein applying the state modification mechanism comprises:
and if the application state of the physical node is the 'master node', the physical node is a candidate node of the application, and the preferred node of the application normally operates in the set back switching time, setting the application state of the physical node as a 'slave node'.
7. The method of claim 2, wherein applying the state modification mechanism comprises:
and if the application state of the physical node is 'stop', the application state of the physical node does not need to be modified.
8. The method according to any of claims 1-7, wherein the performing the corresponding processing on the application according to the modified application state comprises:
if the modified application state is the 'main node', starting the application;
and if the modified application state is not the 'main node' and the application state before modification is the 'main node', stopping the application.
9. The method according to any one of claims 1 to 7, wherein data interaction is performed between the physical nodes through heartbeat monitoring to obtain application state information of all the physical nodes.
10. The method of claim 1, wherein the deployment of the physical nodes in the system cluster comprises: registry-based hot standby deployment and non-registry-based hot standby deployment.
11. An apparatus for application management in a system cluster, comprising:
the state updating module is used for updating the application state of each application recorded in the physical node after the physical node of the system cluster is started;
the state modification module is used for modifying the application state of the physical node according to an application state modification mechanism for each application; the application state modification mechanism comprises: if the application state of the physical node is 'start', the physical node is a preferred node of the application, and no physical node with the application state set as 'master node' exists in all the physical nodes of the system cluster, setting the application state of the physical node as 'master node'; if the application state of the physical node is 'start', the physical node is a preferred node of the application, and a physical node with an application state of 'master node' exists in all physical nodes of the system cluster, setting the application state of the physical node as a 'slave node'; if the application state of the physical node is 'start' and the physical node is a candidate node of the application, setting the application state of the physical node to 'suspend';
and the application processing module is used for carrying out corresponding processing on the application according to the modified application state.
12. An electronic device for application management in a system cluster, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-10.
13. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN202010032522.5A 2020-01-13 2020-01-13 Method and device for managing applications in system cluster Active CN111277632B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010032522.5A CN111277632B (en) 2020-01-13 2020-01-13 Method and device for managing applications in system cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010032522.5A CN111277632B (en) 2020-01-13 2020-01-13 Method and device for managing applications in system cluster

Publications (2)

Publication Number Publication Date
CN111277632A CN111277632A (en) 2020-06-12
CN111277632B true CN111277632B (en) 2022-05-06

Family

ID=70998907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010032522.5A Active CN111277632B (en) 2020-01-13 2020-01-13 Method and device for managing applications in system cluster

Country Status (1)

Country Link
CN (1) CN111277632B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743692A (en) * 2014-12-31 2016-07-06 瞻博网络公司 Policy based framework for application management
CN107454140A (en) * 2017-06-27 2017-12-08 北京溢思得瑞智能科技研究院有限公司 A kind of Ceph cluster automatically dispose method and system based on big data platform
CN107948017A (en) * 2017-09-30 2018-04-20 用友金融信息技术股份有限公司 Highly available cluster system
CN109245908A (en) * 2017-07-10 2019-01-18 北京京东尚科信息技术有限公司 A kind of method and apparatus of principal and subordinate's cluster switching

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI235299B (en) * 2004-04-22 2005-07-01 Univ Nat Cheng Kung Method for providing application cluster service with fault-detection and failure-recovery capabilities
EP1662727B1 (en) * 2004-11-30 2013-04-03 Canon Kabushiki Kaisha Control of sequentially communicating with devices included in a plurality of networks (e.g. piconets)
US8427214B2 (en) * 2010-06-03 2013-04-23 Arm Limited Clock state independent retention master-slave flip-flop
CN103647668A (en) * 2013-12-16 2014-03-19 上海证券交易所 Host group decision system in high availability cluster and switching method for host group decision system
CN110650193B (en) * 2019-09-20 2021-06-25 腾讯科技(深圳)有限公司 Node management method, cluster management device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743692A (en) * 2014-12-31 2016-07-06 瞻博网络公司 Policy based framework for application management
CN107454140A (en) * 2017-06-27 2017-12-08 北京溢思得瑞智能科技研究院有限公司 A kind of Ceph cluster automatically dispose method and system based on big data platform
CN109245908A (en) * 2017-07-10 2019-01-18 北京京东尚科信息技术有限公司 A kind of method and apparatus of principal and subordinate's cluster switching
CN107948017A (en) * 2017-09-30 2018-04-20 用友金融信息技术股份有限公司 Highly available cluster system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Pseudowire Preferential Forwarding Status Bit;P. Muley等;《IETF rfc6870》;20130228;全文 *
基于Bully算法的Redis集群选举方案优化;王芬等;《计算机科学》;20171015;全文 *

Also Published As

Publication number Publication date
CN111277632A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
US20160342409A1 (en) Rolling upgrade of a distributed application
CN112527520A (en) Method and device for deploying message middleware
US9390156B2 (en) Distributed directory environment using clustered LDAP servers
CN111181765A (en) Task processing method and device
CN111666134A (en) Method and system for scheduling distributed tasks
CN113079098B (en) Method, device, equipment and computer readable medium for updating route
CN107818027B (en) Method and device for switching main name node and standby name node and distributed system
CN107526838B (en) Method and device for database cluster capacity expansion
CN113760522A (en) Task processing method and device
CN111277632B (en) Method and device for managing applications in system cluster
CN111767126A (en) System and method for distributed batch processing
CN110019059B (en) Timing synchronization method and device
CN109284177B (en) Data updating method and device
CN112084254A (en) Data synchronization method and system
CN115442129A (en) Method, device and system for managing cluster access authority
CN112883103A (en) Method and device for data transfer between clusters
CN113761075A (en) Method, device, equipment and computer readable medium for switching databases
CN113760469A (en) Distributed computing method and device
CN113760487A (en) Service processing method and device
CN108833147B (en) Configuration information updating method and device
CN113742376A (en) Data synchronization method, first server and data synchronization system
CN112860505A (en) Method and device for regulating and controlling distributed clusters
CN113157354A (en) Method, device, equipment and computer readable medium for processing data
CN113364615B (en) Method, device, equipment and computer readable medium for rolling upgrade
CN110661857A (en) Data synchronization method and device

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20221010

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Patentee after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Patentee before: CHINA CONSTRUCTION BANK Corp.

Patentee before: Jianxin Financial Science and Technology Co.,Ltd.

TR01 Transfer of patent right