CN106021005B - Method and device for providing application service and electronic equipment - Google Patents
Method and device for providing application service and electronic equipment Download PDFInfo
- Publication number
- CN106021005B CN106021005B CN201610306379.8A CN201610306379A CN106021005B CN 106021005 B CN106021005 B CN 106021005B CN 201610306379 A CN201610306379 A CN 201610306379A CN 106021005 B CN106021005 B CN 106021005B
- Authority
- CN
- China
- Prior art keywords
- node
- application program
- election
- backup
- state
- 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
Links
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/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0706—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
- G06F11/0748—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a remote unit communicating with a single-box computer node experiencing an error/fault
-
- 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/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0793—Remedial or corrective actions
Abstract
The embodiment of the invention discloses a method and a device for providing an application service and electronic equipment. The method comprises the following steps: constructing two application program nodes for an application program in a management cluster system of the electronic equipment; starting the two constructed application program nodes, and respectively configuring an application program main node and an application program backup node; setting the configured application program backup node as an application program main node after the application program main node is abnormal; and calling a command line which is pre-injected into the management cluster system and used for starting the application program node, restarting the abnormal application program main node, and setting the abnormal application program main node as an application program backup node. By applying the invention, the usability of the application program providing the application service can be improved.
Description
Technical field
The present invention relates to computer communication reliability technology more particularly to it is a kind of provide applied business method, apparatus and
Electronic equipment.
Background technique
With computer communication and the continuous development of Internet technology, electronic equipment using more and more common, for example,
Intelligent mobile phone, personal digital assistant, palm PC and desktop computer are more and more widely used, and are mounted on
All kinds of computer applied algorithms (APP, Application) in electronic equipment are also more and more.But as application program exists
Electronic equipment is disposed in online operational process, can be because of various factors, for example, code bug, Insufficient disk space, delay machine, answering
Cause application program to stop running or exit with program bug etc., the applied business provided based on the application program caused to interrupt,
To which the user to applied business makes troubles, the applied business experience of user is reduced, application program operation is also affected
The public praise and image of quotient.
The continuity of applied business can not be interrupted in order to guarantee computer applied algorithm when abnormal, promotes application program
Availability and applied business continuity, currently, general in the electronic device by the way of active/standby Application Backup
Applied business is provided, to ensure the high availability of applied business.Specifically, by being in the electronic device to provide application
The same application of business disposes two examples, primary application program and backup application, primary application program is arranged
Corresponding host process (application program major node), backup application corresponds to backup process (Application Backup node), using journey
Sequence host node carries out heartbeat detection by heartbeat packet with Application Backup node, wherein heartbeat packet is in host node and backup
The customized command word that other side oneself state is periodically notified between node, sends according to certain time interval.Work as application
Program backup node monitors that application program major node is exited because abnormal by heartbeat detection, Application Backup node automatically at
For application program major node, to all applied business of adapter tube application program major node, so that the application program is still
Applied business service can be externally provided.
But this provides the method for applied business using active/standby application program, exits, answers because abnormal in application program major node
After automatically becoming application program major node with program backup node, need to restart the application program master because exiting extremely manually
Node makes Application Backup node, can be timely after being abnormal in the node for currently providing applied business
Take over the node because exiting extremely.Due to needing manually to restart the node exited extremely (application program), thus, it needs
It is equipped with special operation and maintenance personnel, so that the cost of maintenance applications high availability is big, higher cost;Further,
If operation and maintenance personnel fails to restart the node (application program) because exiting extremely in time, in currently running node
When because of abnormal exiting, the applied business that will lead to offer is interrupted, to reduce the availability of application program.
Summary of the invention
In view of this, the embodiment of the present invention provides the method, apparatus and electronic equipment of a kind of offer applied business, promotion is mentioned
For the availability of the application program of applied business.
In order to achieve the above objectives, the embodiment of the present invention adopts the following technical scheme that
In a first aspect, the embodiment of the present invention provides a kind of method of offer applied business, comprising:
It is two parts of application program nodes of application builds in the management group system of electronic equipment;
The two parts of application program nodes for starting building, are respectively configured application program major node and Application Backup
Node;
After application program major node is abnormal, the main section of application program is set by the Application Backup node of configuration
Point;
It calls and is previously implanted for starting the order line of application program node in management group system, restarting is abnormal
Application program major node, and be set as Application Backup node.
Optionally, described is two parts of application program node packets of application builds in the management group system of electronic equipment
It includes:
Building includes failed controller, timed task monitor, manager and the management group system for monitoring node device,
The quantity of the failed controller, timed task monitor and monitoring node device is 2, and the quantity of the manager is 1;
It is respectively the one application program node of application builds in two monitoring node devices;
The order line of starting application program node is configured in two failed controllers respectively;
The order line of startup separator controller is configured in two timed task monitors respectively.
Optionally, the corresponding failed controller of each application program node, a timed task monitor and a monitoring section
Point device, two parts of application program nodes sharing managers.
Optionally, described application program major node to be respectively configured and Application Backup node includes:
Two failed controllers obtain the application program node starting in corresponding monitoring node device respectively, defeated to manager
Notification instruction is elected out;
Manager receives election notification instruction, and respectively two parts of application program nodes create corresponding application program node road
Diameter notifies two failed controllers to conduct an election, by election results information respectively;
Failed controller receives election results information, notifies corresponding monitoring node device;
Monitoring node device by comprising application program node be placed in manager for the application program node creation application
On program node path, if election results information is to elect successfully, the application program node for including becomes application program
Host node;If election results information is election failure, the application program node for including becomes Application Backup node.
Optionally, the failed controller includes: active backup election device submodule, wherein elects device in active backup
The order line of starting application program node is configured in submodule.
Optionally, the failed controller further include: health monitor submodule and heartbeat server submodule, it is described
Monitoring node device includes: healthy submodule, heartbeat client child module and application program node, described to obtain corresponding monitoring
Application program node starting in node device, exporting election notification instruction to manager includes:
The healthy regular inquiry application node state of submodule, the application program node state that storage inquiry obtains;
Health monitor submodule is interacted with healthy submodule, obtains the application program node shape stored in healthy submodule
State is compared, when meeting pre-set election strategy, to active backup with the application program node state of itself storage
Elect device submodule output election notification instruction;
Active backup election device submodule receives the election notification instruction of health monitor submodule output, defeated to manager
Out.
Optionally, the application program node state includes: inactive state, starts and do not elect state successfully, using journey
Sequence primary node status and Application Backup node state.
Optionally, described to meet pre-set election strategy and include:
If the application program node state stored in health monitor submodule is inactive state, the application journey of acquisition
Sequence node state is to start not elect state successfully, meets pre-set election strategy.
Optionally, described to meet pre-set election strategy and include:
If the application program node state stored in health monitor submodule is application program major node state or answers
Application program node state with program backup node state, acquisition is inactive state, meets pre-set election strategy.
Optionally, described after application program major node is abnormal, it sets the Application Backup node of configuration to
Application program major node includes:
The state of application program major node in failed controller monitoring node device, if listening to the main section of application program
Dotted state changes, and exports election switching command to manager;
Manager receives election switching command, is the application program of the application program major node creation in deletion manager
Node path, using the Application Backup node path of storage as application program major node path, and will be comprising electing successfully
Election results information notify another failed controller;
Another failed controller receives election results information, notifies corresponding monitoring node device;
It monitors node device and updates corresponding application program node state.
Optionally, the Application Backup node that is set as includes:
The corresponding failed controller of the application program node of restarting obtains application program node reboot, to management
Device exports backup instruction;
Manager receives backup instruction, creates corresponding Application Backup node for the application program node of restarting
Backup result information is notified failed controller by path;
Failed controller receives backup result information, notifies corresponding monitoring node device;
The application program node of restarting is placed in manager as application program node creation by monitoring node device
On Application Backup node path, the application program node of the restarting becomes Application Backup node.
Optionally, the method also includes:
It, will be described by the manager after timed task monitor monitors that corresponding failed controller is abnormal
Application Backup node is set as application program major node;
Timed task monitor calls the pre-set order line for being used to start the failed controller, starts abnormal
Failed controller.
Optionally, described after timed task monitor monitors that corresponding failed controller is abnormal, by described
The Application Backup node is set application program major node by manager
Heartbeat client child module obtains application program node state from healthy submodule, sends out to heartbeat server submodule
Send the heartbeat packet comprising application program node state;
Heartbeat server submodule obtains active backup election device submodule bulk state, receives heartbeat client child module and sends
Heartbeat packet, return to the heartbeat packet response comprising active backup election device submodule bulk state to heartbeat client child module;
Heartbeat client child module receives heartbeat packet response, active backup election device submodule bulk state is obtained, if obtained
Active backup election device submodule be in inactive state, and application program node state is application program major node state,
The current state of application program node is revised as Application Backup node state by triggering;
Timed task monitor monitor active backup election device submodule, if active backup election device submodule is in not
Starting state sets application program major node for the Application Backup node by manager.
Second aspect, the embodiment of the present invention provide a kind of device of offer applied business, comprising: the building of application program node
Module, configuration module, exception processing module and restart module, wherein
Application program node constructs module, for being two parts of application builds in the management group system of electronic equipment
Application program node;
Configuration module, for start building two parts of application program nodes, be respectively configured application program major node with
And Application Backup node;
Exception processing module, for after application program major node is abnormal, by the Application Backup node of configuration
It is set as application program major node;
Restart module, is previously implanted in management group system for calling for starting the order of application program node
Row, restarts abnormal application program major node, and be set as Application Backup node.
Optionally, the application program node building module includes: management group system construction unit, application program node
Construction unit, the first order line configuration unit and the second order line configuration unit, wherein
Manage group system construction unit, for construct comprising failed controller, timed task monitor, manager and
The management group system of node device is monitored, the quantity of the failed controller, timed task monitor and monitoring node device is
2, the quantity of the manager is 1;
Application program node construction unit, for being respectively that the application builds one are answered in two monitoring node devices
Use program node;
First order line configuration unit, for being configured to starting application program node in two failed controllers respectively
Order line;
Second order line configuration unit, for being configured to startup separator control in two timed task monitors respectively
The order line of device.
Optionally, the corresponding failed controller of each application program node, a timed task monitor and a monitoring section
Point device, two parts of application program nodes sharing managers.
Optionally, described application program major node to be respectively configured and Application Backup node includes:
Two failed controllers obtain the application program node starting in corresponding monitoring node device respectively, defeated to manager
Notification instruction is elected out;
Manager receives election notification instruction, and respectively two parts of application program nodes create corresponding application program node road
Diameter notifies two failed controllers to conduct an election, by election results information respectively;
Failed controller receives election results information, notifies corresponding monitoring node device;
Monitoring node device by comprising application program node be placed in manager for the application program node creation application
On program node path, if election results information is to elect successfully, the application program node for including becomes application program
Host node;If election results information is election failure, the application program node for including becomes Application Backup node.
Optionally, the failed controller includes: active backup election device submodule, wherein elects device in active backup
The order line of starting application program node is configured in submodule.
Optionally, the failed controller further include: health monitor submodule and heartbeat server submodule, it is described
Monitoring node device includes: healthy submodule, heartbeat client child module and application program node, described to obtain corresponding monitoring
Application program node starting in node device, exporting election notification instruction to manager includes:
The healthy regular inquiry application node state of submodule, the application program node state that storage inquiry obtains;
Health monitor submodule is interacted with healthy submodule, obtains the application program node shape stored in healthy submodule
State is compared, when meeting pre-set election strategy, to active backup with the application program node state of itself storage
Elect device submodule output election notification instruction;
Active backup election device submodule receives the election notification instruction of health monitor submodule output, defeated to manager
Out.
Optionally, the application program node state includes: inactive state, starts and do not elect state successfully, using journey
Sequence primary node status and Application Backup node state.
Optionally, described to meet pre-set election strategy and include:
If the application program node state stored in health monitor submodule is inactive state, the application journey of acquisition
Sequence node state is to start not elect state successfully, meets pre-set election strategy.
Optionally, described to meet pre-set election strategy and include:
If the application program node state stored in health monitor submodule is application program major node state or answers
Application program node state with program backup node state, acquisition is inactive state, meets pre-set election strategy.
Optionally, the exception processing module includes: monitoring unit, switch unit, notification unit and updating unit,
In,
Monitoring unit, for notifying the state of application program major node in failed controller monitoring node device, if
It listens to application program major node state to change, exports election switching command to manager;
Switch unit receives election switching command for notification manager, and deleting in manager is the application program master
The application program node path of node creation, using the Application Backup node path of storage as application program major node road
Diameter, and will be comprising electing successful election results information to notify another failed controller;
Notification unit notifies corresponding monitoring to save for notifying another failed controller to receive election results information
Point device;
Updating unit, for notifying monitoring node device to update corresponding application program node state.
Optionally, it is described restart module include: call unit, restart monitoring unit, creating unit, information notification unit with
And reconfigure unit, wherein
Call unit is previously implanted in management group system for calling for starting the order of application program node
Row, restarts abnormal application program major node;
Restart monitoring unit, the corresponding failed controller of the application program node for restarting obtains application program section
Point restarting exports backup instruction to manager;
Creating unit receives backup instruction for notification manager, creates correspondence for the application program node of restarting
Application Backup node path, by backup result information notify failed controller;
Information notification unit notifies corresponding monitoring node device for notifying failed controller to receive backup result information;
Unit is reconfigured, is somebody's turn to do for notifying monitoring node device that the application program node of restarting is placed in manager
On the Application Backup node path of application program node creation, the application program node of the restarting, which becomes, applies journey
Sequence backup node.
It is optionally, described to restart module further include: exception monitoring unit and abnormal restoring unit, wherein
Exception monitoring unit, for leading to after timed task monitor monitors that corresponding failed controller is abnormal
It crosses the manager and sets application program major node for the Application Backup node;
Abnormal restoring unit, for notifying that it is pre-set for starting the Fault Control that timed task monitor calls
The order line of device starts abnormal failed controller.
Optionally, the exception monitoring unit includes: heartbeat packet subelement, heartbeat packet response subelement, parsing subunit
And monitoring subelement, wherein
Heartbeat packet subelement, for notifying heartbeat client child module to obtain application program node shape from healthy submodule
State sends the heartbeat packet comprising application program node state to heartbeat server submodule;
Heartbeat packet responds subelement, for notifying that it is blocky that heartbeat server submodule obtains active backup election device submodule
State receives the heartbeat packet that heartbeat client child module is sent, and returns to heartbeat client child module and elects device comprising active backup
The heartbeat packet of submodule bulk state responds;
Parsing subunit obtains active backup election device for notifying heartbeat client child module to receive heartbeat packet response
Submodule bulk state, if the active backup election device submodule obtained is in inactive state, and application program node state is
The current state of application program node is revised as Application Backup node state by application program major node state, triggering;
Subelement is monitored, for timed task monitor monitor active backup election device submodule, if active backup choosing
It lifts device submodule and is in inactive state, the main section of application program is set for the Application Backup node by manager
Point.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes: shell, processor, deposits
Reservoir, circuit board and power circuit, wherein circuit board is placed in the space interior that shell surrounds, processor and memory setting
On circuit boards;Power circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is for storing and can hold
Line program code;Processor is run and executable program code pair by reading the executable program code stored in memory
The program answered, the method for executing aforementioned any offer applied business.
It is provided in an embodiment of the present invention that the method, apparatus and electronic equipment of applied business are provided, by electronic equipment
Managing is two parts of application program nodes of application builds in group system;Start two parts of application program nodes of building,
Application program major node and Application Backup node is respectively configured;After application program major node is abnormal, it will configure
Application Backup node be set as application program major node;Calling, which is previously implanted, answers in management group system for starting
With the order line of program node, abnormal application program major node is restarted, and is set as Application Backup node.This
Sample, by injecting the order line for starting application program node in Zookeeper group system, thus in the main section of application program
After point is abnormal and exits, it can be restarted automatically the application program node exited extremely, without being equipped with special operation maintenance people
Member, so that the cost of maintenance applications high availability is small, cost is relatively low, the applied business that not will lead to offer is interrupted, thus
Promote the availability of application program.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Other attached drawings are obtained according to these attached drawings.
Fig. 1 provides the method flow schematic diagram of applied business for the embodiment of the present invention;
Fig. 2 is that the embodiment of the present invention is two parts of application programs of application builds in the management group system of electronic equipment
The flow diagram of node;
Fig. 3 is the process signal that application program major node and Application Backup node is respectively configured in the embodiment of the present invention
Figure;
Fig. 4 is the embodiment of the present invention after application program major node is abnormal, by the Application Backup node of configuration
It is set as the flow diagram of application program major node;
Fig. 5 is the flow diagram that the embodiment of the present invention is set as Application Backup node;
Fig. 6 provides the apparatus structure schematic diagram of applied business for the embodiment of the present invention;
Fig. 7 is the management group system structural schematic diagram of the embodiment of the present invention;
Fig. 8 is another structural schematic diagram of management group system of the embodiment of the present invention;
Fig. 9 is the structural schematic diagram of electronic equipment one embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described in detail with reference to the accompanying drawing.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its
Its embodiment, shall fall within the protection scope of the present invention.
Fig. 1 provides the method flow schematic diagram of applied business for the embodiment of the present invention.Referring to Fig. 1, this method comprises:
It step 11, is two parts of application program nodes of application builds in the management group system of electronic equipment;
In this step, as an alternative embodiment, management group system is Zookeeper group system.Zookeeper collection
Group's system is the distributed application program High Availabitity coordination service of a distribution, open source code, can be mentioned for Distributed Application
For including the Consistency services such as configuring maintenance, name Service, distributed synchronization, group service, pass through the complicated error-prone pass of encapsulation
Key service provides automatic and timely high availability guarantee for computer applied algorithm, and configuration is simple, has general well
Property, so as to which the system of interface and performance efficiency easy to use, function-stable is supplied to user, allow users to base
General high availability is realized in Zookeeper.
In the embodiment of the present invention, as an alternative embodiment, Fig. 2 is management cluster of the embodiment of the present invention in electronic equipment
It is the flow diagram of two parts of application program nodes of application builds in system.Referring to fig. 2, which includes:
Step 21, building includes failed controller, timed task monitor, manager and the management collection for monitoring node device
Group's system, the quantity of the failed controller, timed task monitor and monitoring node device are 2, the quantity of the manager
It is 1;
In this step, management group system includes: Fisrt fault controller, the first timed task monitor, the first monitoring
Node device, the second failed controller, the second timed task monitor, the second monitoring node device and manager, wherein
Manager is connected with Fisrt fault controller and the second failed controller respectively, and Fisrt fault controller is also distinguished
It is connected with the first timed task monitor, the first monitoring node device, the second failed controller is also supervised with the second timed task respectively
It controls device and the second monitoring node device is connected.
It step 22, is respectively the one application program node of application builds in two monitoring node devices;
It is the first application program of application builds node in the first monitoring node device, second in this step
Monitoring in node device is the second application program of application builds node.
In the embodiment of the present invention, the corresponding failed controller of each application program node, a timed task monitor and
One monitoring node device, two parts of application program nodes sharing managers.
Step 23, the order line of starting application program node is configured in two failed controllers respectively;
In this step, as an alternative embodiment, failed controller (HAFailoverController) includes: actively standby
Part election device submodule (ActiveStandbyElector), health monitor submodule (HealthMonitor) and heartbeat
Server submodule (HeartbeatRPCServer), wherein be configured to starting in ActiveStandbyElector and answer
With the order line of program node.
In the embodiment of the present invention, HAFailoverController monitors currently running application program (application program master
Node) health status.In electronic equipment starting, participate in electing currently running application program (application program node), and
The application program of notice election is started to provide applied business;And it is pre-configured with for starting application program node
Order line calls the order line for starting application program node after application program node is because of abnormal exit, and journey is applied in starting
Sequence node.
Step 24, the order line of startup separator controller is configured in two timed task monitors respectively.
In this step, it is configured to start in timed task monitor (CrontabMonitor)
The order line of ActiveStandbyElector.
Step 12, the two parts of application program nodes for starting building, are respectively configured application program major node and application
Program backup node;
In this step, failed controller, monitoring node device (MonitoredNode) and manager are utilized
(Zookeeper), application program major node and Application Backup node are configured.
As an alternative embodiment, Fig. 3 is that application program major node and application program is respectively configured in the embodiment of the present invention
The flow diagram of backup node.Referring to Fig. 3, which includes:
Step 31, two failed controllers obtain the application program node starting in corresponding monitoring node device respectively, to
Manager output election notification instruction;
In this step, as an alternative embodiment, monitoring node device (MonitoredNode) includes: healthy submodule
(HealthRPCServer), heartbeat client child module (HeartbeatRPCClient) and application program node
(FreezableWorkeNode)。
As an alternative embodiment, the application program node starting in corresponding monitoring node device is obtained, it is defeated to manager
Election notification instruction includes: out
HealthRPCServer periodically inquires FreezableWorkerNode state, and storage inquiry obtains
FreezableWorkerNode state;
HealthMonitor is interacted with HealthRPCServer, is stored in acquisition HealthRPCServer
FreezableWorkerNode state is compared with the FreezableWorkerNode state of itself storage, pre- when meeting
When the election strategy being first arranged, election notification instruction is exported to ActiveStandbyElector;
ActiveStandbyElector receives the election notification instruction of HealthMonitor output, defeated to Zookeeper
Out.
In the embodiment of the present invention, as an alternative embodiment, FreezableWorkerNode state includes: inactive shape
State (NOT_ALIVE) starts and does not elect state (ALIVE_UNKNWON), application program major node state (ALIVE_ successfully
) and Application Backup node state (ALIVE_STANDBY) ACTIVE.
In the embodiment of the present invention, inactive state includes but is not limited to that exception exits state, for example, starting failure, application
The application program node that program major node terminates operation, Application Backup node terminates operation, starts but does not conduct an election is whole
Only operation etc..
In the embodiment of the present invention, as an alternative embodiment, if electronic equipment starts application program node failure, enter
NOT_ALIVE;Alternatively, the application program node in ALIVE_UNKNWON terminates operation (stop), into NOT_ALIVE;Or
Person, the application program node in ALIVE_UNKNWON terminates operation, into NOT_ALIVE;Alternatively, being in ALIVE_
The Application Backup node of STANDBY terminates operation, into NOT_ALIVE;
If electronic equipment starts the success of application program node, enter ALIVE_UNKNWON from NOT_ALIVE, if place
It is elected successfully in the application program node of ALIVE_UNKNWON, into ALIVE_ACTIVE;If election failure, enters
ALIVE_STANDBY;
In the case of Application Backup node is in ALIVE_STANDBY, if answering in ALIVE_ACTIVE
It is terminated and is run with program major node, which enters ALIVE_ACTIVE;In ALIVE_ACTIVE, if therefore
Hinder controller and terminate operation dead), into ALIVE_STANDBY.
As an alternative embodiment, if the FreezableWorkerNode state stored in HealthMonitor is not
Starting state, the FreezableWorkerNode state of acquisition are to start not elect state successfully, meet pre-set election
Strategy elects an application program major node and an Application Backup section from two FreezableWorkerNode
Point.
As another alternative embodiment, if the FreezableWorkerNode state stored in HealthMonitor is
Application program major node state or Application Backup node state, the FreezableWorkerNode state of acquisition are not open
Dynamic state, meets pre-set election strategy, and the election of Application Backup node is become application program major node.
In the embodiment of the present invention, the election notice of HealthMonitor output is received in ActiveStandbyElector
After instruction, before interacting creation application program node path with Zookeeper to conduct an election, inquiry storage can be also used for
Election status indicator execute if stored election status indicator is non-elected mark and described interact wound with Zookeeper
Application program node path is built to conduct an election.
In the embodiment of the present invention, state (ALIVE_ is not elected successfully when FreezableWokrerNode has been in start
UNKNOWN), if the election status indicator that ActiveStandbyElector is saved is non-elected mark, application is initiated in triggering
Program major node/Application Backup node election.
Step 32, manager receives election notification instruction, and respectively two parts of application program node creations are corresponding applies journey
Sequence node path notifies two failed controllers to conduct an election, by election results information respectively;
In this step, as an alternative embodiment, manager use fights for mode and conducts an election, i.e., in manager, the
One failed controller and the second failed controller mutually fight for creation application program node path, and wound is first completed in manager confirmation
Building the corresponding failed controller of application program node path and electing the application program node path successfully, accordingly created is using journey
Sequence host node path;Then another failed controller election failure, the application program section accordingly created for another failed controller
Point path is Application Backup node path.
In the embodiment of the present invention, Zookeeper receive the first ActiveStandbyElector, and/or, second
ActiveStandbyElector output election notification instruction, respectively the first ActiveStandbyElector, and/or,
2nd ActiveStandbyElector creates corresponding application program node path to conduct an election, by election results information point
Do not notify the first ActiveStandbyElector, and/or, the 2nd ActiveStandbyElector.
In the embodiment of the present invention, as an alternative embodiment, Zookeeper use fights for mode and conducts an election, i.e., and first
ActiveStandbyElector and the 2nd ActiveStandbyElector mutually fights for creation application program node path,
Confirmation is first completed the corresponding ActiveStandbyElector of creation application program node path and is elected successfully, and what is accordingly created answers
It is application program major node path with program node path;Then another ActiveStandbyElector election failure, it is corresponding to create
The application program node path built is Application Backup node path.
Step 33, failed controller receives election results information, notifies corresponding monitoring node device;
Step 34, monitoring node device by comprising application program node be placed in manager for the application program node create
Application program node path on, if election results information is elect successfully, the application program node for including is as answering
Use program major node;If election results information is election failure, it is standby that the application program node for including becomes application program
Part node.
In this step, ActiveStandbyElector receives the election results information of Zookeeper output, notice
HealthRPCServer, if election results information is to elect successfully, HealthRPCServer will
FreezableWorkerNode is placed in Zookeeper as the main section of application program of ActiveStandbyElector creation
On point path, so that FreezableWorkerNode becomes application program major node, if election results information is that election is lost
It loses, FreezableWorkerNode is placed in Zookeeper as the application program of ActiveStandbyElector creation
On backup node path, so that FreezableWorkerNode becomes Application Backup node.
Step 13, after application program major node is abnormal, the Application Backup node of configuration is set as applying
Program major node;
In this step, as an alternative embodiment, Fig. 4 is that the embodiment of the present invention is abnormal in application program major node
Afterwards, the Application Backup node of configuration is set to the flow diagram of application program major node.Referring to fig. 4, the process packet
It includes:
Step 41, in failed controller monitoring node device application program major node state, if listening to application
Program major node state changes, and exports election switching command to manager;
In this step, HealthMonitor periodically obtains HealthRPCServer storage
FreezableWorkerNode state, if the FreezableWorkerNode state obtained is inactive state, to
ActiveStandbyElector output election switching command;
ActiveStandbyElector receives the election switching command of HealthMonitor output, defeated to Zookeeper
Out.
Step 42, manager receives election switching command, and deleting in manager is what the application program major node created
Application program node path using the Application Backup node path of storage as application program major node path, and will include
Successful election results information is elected to notify another failed controller;
In this step, if Zookeeper receives the first ActiveStandbyElector or second
ActiveStandbyElector output election switching command, and/or, monitoring ActiveStandbyElector state is
Inactive state, deleting is the first ActiveStandbyElector or second in Zookeeper
The application program node path of ActiveStandbyElector creation, is the 2nd ActiveStandbyElector by storage
Or the first ActiveStandbyElector creation application program node path as application program major node path, and will wrap
The successful election results information containing election notifies the 2nd ActiveStandbyElector or first
ActiveStandbyElector;
In the embodiment of the present invention, as an alternative embodiment, after the application program node path for deleting creation, if should
The corresponding ActiveStandbyElector restarting of application program node path is created, then triggers and conducts an election again, with
It is aforementioned to fight for unlike mode, when currently having application program major node path, for this
ActiveStandbyElector create Application Backup node path, with application program major node path be deleted when,
Take over deleted application program major node path.
Step 43, another failed controller receives election results information, notifies corresponding monitoring node device;
Step 44, monitoring node device updates corresponding application program node state.
Step 14, it calls and is previously implanted in management group system for starting the order line of application program node, again
Start abnormal application program major node, and is set as Application Backup node.
In this step, ActiveStandbyElector calls preconfigured FreezableWorkerNode starting life
Row is enabled, FreezableWorkerNode is started.
As an alternative embodiment, Fig. 5 is the flow diagram that the embodiment of the present invention is set as Application Backup node.
Referring to Fig. 5, which includes:
Step 51, the corresponding failed controller of the application program node of restarting obtains application program node and opens again
It is dynamic, backup instruction is exported to manager;
Step 52, manager receives backup instruction, creates corresponding application program for the application program node of restarting
Backup result information is notified failed controller by backup node path;
Step 53, failed controller receives backup result information, notifies corresponding monitoring node device;
Step 54, the application program node of restarting is placed in manager as the application program node by monitoring node device
On the Application Backup node path of creation, the application program node of the restarting becomes Application Backup node.
In the embodiment of the present invention, if FreezableWorkerNode is abnormal, for example, hang,
HealthMonitor knows the information, and to ActiveStandbyElector output node route deletion notification instruction, (election is cut
Change instruction), ActiveStandbyElector notifies Zookeeper to delete corresponding application program node path, Zookeeper
It is the application journey of another ActiveStandbyElector creation by storage after deleting corresponding application program node path
Sequence node path notifies another ActiveStandbyElector as application program major node path.As an example it is assumed that the
One FreezableWorkerNode is in Application Backup node state (ALIVE_STANDBY), when in application program master
2nd FreezableWorkerNode of node state (ALIVE_ACTIVE) hangs, the 2nd ActiveStandbyElector
Zookeeper, Zookeeper is notified to delete the corresponding application program node path of the 2nd ActiveStandbyElector, into
Row election, sets application program major node for the application program node path created for the first ActiveStandbyElector
Path, and notify the first ActiveStandbyElector, after the first ActiveStandbyElector receives notice, by first
FreezableWorkerNode is set as ALIVE_ACTIVE, i.e., by the state of the first FreezableWorkerNode from
ALIVE_STANDBY is updated to ALIVE_ACTIVE, hangs the 2nd FreezableWorkerNode of falling to take over.
As an alternative embodiment, this method can also include:
It, will be described by the manager after timed task monitor monitors that corresponding failed controller is abnormal
Application Backup node is set as application program major node;
Timed task monitor calls the pre-set order line for being used to start the failed controller, starts abnormal
Failed controller.
In the embodiment of the present invention, as an alternative embodiment, corresponding Fault Control is monitored in timed task monitor
After device is abnormal, setting application program major node for the Application Backup node by the manager includes:
HeartbeatRPCClient obtains FreezableWorkerNode state from HealthRPCServer, to
HeartbeatRPCServer sends the heartbeat packet comprising FreezableWorkerNode state;
HeartbeatRPCServer obtains ActiveStandbyElector state, receives HeartbeatRPCClient
The heartbeat packet of transmission returns to the heartbeat packet comprising ActiveStandbyElector state to HeartbeatRPCClient and rings
It answers;
HeartbeatRPCClient receives heartbeat packet response, ActiveStandbyElector state is obtained, if obtained
The ActiveStandbyElector taken is in inactive state, and FreezableWorkerNode state is application program master
The current state of FreezableWorkerNode is revised as Application Backup node state by node state, triggering;
CrontabMonitor monitors ActiveStandbyElector, if ActiveStandbyElector is in not
Starting state sets application program major node for the Application Backup node by Zookeeper.
In the embodiment of the present invention, CrontabMonitor calls described for starting the life of ActiveStandbyElector
Row is enabled, ActiveStandbyElector is started.
In the embodiment of the present invention, FreezableWorkerNode provides application when being in application program major node state
Procedure service.
In the embodiment of the present invention, journey is applied by the management group system of electronic equipment being two parts of application builds
Sequence node;The two parts of application program nodes for starting building, are respectively configured application program major node and Application Backup
Node;After application program major node is abnormal, application program major node is set by the Application Backup node of configuration;
It calls and is previously implanted in management group system for starting the order line of application program node, restart abnormal application journey
Sequence host node, and it is set as Application Backup node.In this way, the high availability general based on Zookeeper group system, leads to
It crosses and injects the order line for starting application program node in Zookeeper group system, to be sent out in application program major node
After raw exception exits, can be restarted automatically the application program node exited extremely makes without being equipped with special operation and maintenance personnel
Maintenance applications high availability cost it is small, cost is relatively low, can be provided for computer applied algorithm automatic and timely high
Availability guarantees that it is very low to dispose online cost, and configuration is simple, has good versatility;Further, due to that can weigh in time
New starting not will lead to offer when currently running node is also exited because of exception because of the node (application program) exited extremely
Applied business interrupt, to promote the availability of application program.
Fig. 6 provides the apparatus structure schematic diagram of applied business for the embodiment of the present invention.Referring to Fig. 6, which includes: application
Program node constructs module 61, configuration module 62, exception processing module 63 and restarts module 64, wherein
Application program node constructs module 61, for being application builds two in the management group system of electronic equipment
Part application program node;
In the embodiment of the present invention, as an alternative embodiment, application program node building module 61 includes: management cluster system
Construction unit, application program node construction unit, the first order line configuration unit and the second order line configuration unit unite (in figure
It is not shown), wherein
Group system construction unit is managed, for constructing comprising failed controller (HAFailoverController), determining
When task monitor (CrontabMonitor), manager (Zookeeper) and monitoring node device (MonitoredNode)
Group system is managed, the quantity of the failed controller, timed task monitor and monitoring node device is 2, the manager
Quantity be 1;
Fig. 7 is the management group system structural schematic diagram of the embodiment of the present invention.Referring to Fig. 7, which includes:
Fisrt fault controller 71, the first timed task monitor 72, first monitor node device 73, the second failed controller 74, second
Timed task monitor 75, second monitors node device 76 and manager 77, wherein
Manager 77 is connected with Fisrt fault controller 71 and the second failed controller 74 respectively, Fisrt fault controller
71 also respectively with the first timed task monitor 72, first monitoring node device 73 is connected, the second failed controller 74 also respectively with
Second timed task monitor 75 and the second monitoring node device 76 are connected.
In the embodiment of the present invention, HAFailoverController monitors currently running application program (application program master
Node) health status.In electronic equipment starting, participate in electing currently running application program (application program node), and
The application program of notice election is started to provide applied business;And it is pre-configured with for starting application program node
Order line calls the order line for starting application program node after application program node is because of abnormal exit, and journey is applied in starting
Sequence node.
Application program node construction unit, for being respectively that the application builds one are answered in two monitoring node devices
Use program node;
It is the first application program of application builds node in the first monitoring node device in the embodiment of the present invention,
It is the second application program of application builds node in the second monitoring node device.
First order line configuration unit, for being configured to starting application program node in two failed controllers respectively
Order line;
Second order line configuration unit, for being configured to startup separator control in two timed task monitors respectively
The order line of device.
It is the corresponding failed controller of each application program node, certain as an alternative embodiment in the embodiment of the present invention
When task monitor and one monitoring node device, two parts of application program nodes sharing managers.
Application program major node is respectively configured for starting two parts of application program nodes of building in configuration module 62
And Application Backup node;
It is described application program major node to be respectively configured and Application Backup node includes: in the embodiment of the present invention
Two failed controllers obtain the application program node starting in corresponding monitoring node device respectively, defeated to manager
Notification instruction is elected out;
Manager receives election notification instruction, and respectively two parts of application program nodes create corresponding application program node road
Diameter notifies two failed controllers to conduct an election, by election results information respectively;
Failed controller receives election results information, notifies corresponding monitoring node device;
Monitoring node device by comprising application program node be placed in manager for the application program node creation application
On program node path, if election results information is to elect successfully, the application program node for including becomes application program
Host node;If election results information is election failure, the application program node for including becomes Application Backup node.
In the embodiment of the present invention, as an alternative embodiment, manager use fights for mode and conducts an election, i.e., in manager
In, Fisrt fault controller and the second failed controller mutually fight for creation application program node path, and manager confirmation is first
Completing the corresponding failed controller of creation application program node path elects the application program node path successfully, accordingly created to be
Application program major node path;Then another failed controller election failure, the application accordingly created for another failed controller
Program node path is Application Backup node path.
In the embodiment of the present invention, as an alternative embodiment, Fig. 8 is another knot of management group system of the embodiment of the present invention
Structure schematic diagram.Referring to Fig. 8, the management group system is in addition to comprising structure described in Fig. 7, wherein failed controller includes: active
Backup election device submodule (ActiveStandbyElector) 81, wherein configured in active backup election device submodule 81
For starting the order line of application program node.
As another alternative embodiment, failed controller further include: health monitor submodule (HealthMonitor) 82
And heartbeat server submodule (HeartbeatRPCServer) 83, monitoring node device includes: healthy submodule
(HealthRPCServer) 84, heartbeat client child module (HeartbeatRPCClient) 85 and application program node
(FreezableWorkerNode) 86, the application program node starting obtained in corresponding monitoring node device, to manager
Exporting election notification instruction includes:
HealthRPCServer periodically inquires FreezableWorkerNode state, and storage inquiry obtains
FreezableWorkerNode state;
HealthMonitor is interacted with HealthRPCServer, is stored in acquisition HealthRPCServer
FreezableWorkerNode state is compared with the FreezableWorkerNode state of itself storage, pre- when meeting
When the election strategy being first arranged, election notification instruction is exported to ActiveStandbyElector;
ActiveStandbyElector receives the election notification instruction of HealthMonitor output, defeated to Zookeeper
Out.
In the embodiment of the present invention, as an alternative embodiment, FreezableWorkerNode state includes: inactive shape
State starts and does not elect state, application program major node state and Application Backup node state successfully.
In the embodiment of the present invention, as an alternative embodiment, if stored in HealthMonitor
FreezableWorkerNode state is inactive state, and the FreezableWorkerNode state of acquisition is to start successfully not
Election state meets pre-set election strategy;Alternatively,
If the FreezableWorkerNode state stored in HealthMonitor is application program major node state
Or Application Backup node state, the FreezableWorkerNode state of acquisition is inactive state, and satisfaction is preset
Election strategy.
Exception processing module 63, for after application program major node is abnormal, by the Application Backup section of configuration
Point is set as application program major node;
In the embodiment of the present invention, as an alternative embodiment, exception processing module 63 include: monitoring unit, switch unit,
Notification unit and updating unit (not shown), wherein
Monitoring unit, for notifying the state of application program major node in failed controller monitoring node device, if
It listens to application program major node state to change, exports election switching command to manager;
Switch unit receives election switching command for notification manager, and deleting in manager is the application program master
The application program node path of node creation, using the Application Backup node path of storage as application program major node road
Diameter, and will be comprising electing successful election results information to notify another failed controller;
Notification unit notifies corresponding monitoring to save for notifying another failed controller to receive election results information
Point device;
Updating unit, for notifying monitoring node device to update corresponding application program node state.
Restart module 64, is previously implanted in management group system for calling for starting the order of application program node
Row, restarts abnormal application program major node, and be set as Application Backup node.
In the embodiment of the present invention, ActiveStandbvElector calls preconfigured FreezableWorkerNode
Start command row starts FreezableWorkerNode.
In the embodiment of the present invention, as an alternative embodiment, restart module 64 include: call unit, restart monitoring unit,
Creating unit, information notification unit and reconfigure unit (not shown), wherein
Call unit is previously implanted in management group system for calling for starting the order of application program node
Row, restarts abnormal application program major node;
Restart monitoring unit, the corresponding failed controller of the application program node for restarting obtains application program section
Point restarting exports backup instruction to manager;
Creating unit receives backup instruction for notification manager, creates correspondence for the application program node of restarting
Application Backup node path, by backup result information notify failed controller;
Information notification unit notifies corresponding monitoring node device for notifying failed controller to receive backup result information;
Unit is reconfigured, is somebody's turn to do for notifying monitoring node device that the application program node of restarting is placed in manager
On the Application Backup node path of application program node creation, the application program node of the restarting, which becomes, applies journey
Sequence backup node.
In the embodiment of the present invention, as another alternative embodiment, module 64 is restarted further include: exception monitoring unit and different
Normal recovery unit, wherein
Exception monitoring unit, for leading to after timed task monitor monitors that corresponding failed controller is abnormal
It crosses the manager and sets application program major node for the Application Backup node;
Abnormal restoring unit, for notifying that it is pre-set for starting the Fault Control that timed task monitor calls
The order line of device starts abnormal failed controller.
In the embodiment of the present invention, as an alternative embodiment, exception monitoring unit includes: heartbeat packet subelement, heartbeat packet
Respond subelement, parsing subunit and monitoring subelement, wherein
Heartbeat packet subelement, for notifying HeartbeatRPCClient to obtain from HealthRPCServer
FreezableWorkerNode state is sent to HeartbeatRPCServer comprising FreezableWorkerNode state
Heartbeat packet;
Heartbeat packet responds subelement, for notifying HeartbeatRPCServer to obtain ActiveStandbyElector shape
State receives the heartbeat packet that HeartbeatRPCClient is sent, and includes to HeartbeatRPCClient return
The heartbeat packet of ActiveStandbyElector state responds;
Parsing subunit is obtained for notifying HeartbeatRPCClient to receive heartbeat packet response
ActiveStandbyElector state, if the ActiveStandbyElector obtained is in inactive state, and
FreezableWorkerNode state is application program major node state, is triggered the current shape of FreezableWorkerNode
State is revised as Application Backup node state;
Subelement is monitored, monitors ActiveStandbyElector for CrontabMonitor, if
ActiveStandbyElector is in inactive state, is set the Application Backup node to by Zookeeper
Application program major node.
The embodiment of the present invention also provides a kind of electronic equipment, and the electronic equipment includes dress described in aforementioned any embodiment
It sets.
Fig. 9 is the structural schematic diagram of electronic equipment one embodiment of the present invention, may be implemented to implement shown in Fig. 1-8 of the present invention
The process of example, as shown in figure 9, above-mentioned electronic equipment may include: shell 91, processor 92, memory 93, circuit board 94 and electricity
Source circuit 95, wherein circuit board 94 is placed in the space interior that shell 91 surrounds, and processor 92 and memory 93 are arranged in circuit
On plate 94;Power circuit 95, for each circuit or the device power supply for above-mentioned electronic equipment;Memory 93 is for storing and can hold
Line program code;Processor 92 is run and executable program generation by reading the executable program code stored in memory 93
The corresponding program of code provides the method for applied business for executing described in aforementioned any embodiment.
Processor 92 to the specific implementation procedures of above-mentioned steps and processor 92 by operation executable program code come
The step of further executing may refer to the description of Fig. 1-8 illustrated embodiment of the present invention, and details are not described herein.
The electronic equipment exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data
Communication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and low
Hold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function
Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio,
Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic equipments with data interaction function.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by those familiar with the art, all answers
It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.
Claims (25)
1. a kind of provide the method for applied business, which is characterized in that this method comprises:
It is two parts of application program nodes of application builds in the management group system of electronic equipment;
The two parts of application program nodes for starting building, are respectively configured application program major node and Application Backup section
Point;
After application program major node is abnormal, application program major node is set by the Application Backup node of configuration;
It calls and is previously implanted in management group system for starting the order line of application program node, restart abnormal answer
With program major node, and it is set as Application Backup node;
Wherein, described to include: for two parts of application program nodes of application builds in the management group system of electronic equipment
Building includes failed controller, timed task monitor, manager and the management group system for monitoring node device, described
The quantity of failed controller, timed task monitor and monitoring node device is 2, and the quantity of the manager is 1;
It is respectively the one application program node of application builds in two monitoring node devices;
The order line of starting application program node is configured in two failed controllers respectively;
The order line of startup separator controller is configured in two timed task monitors respectively.
2. the method according to claim 1, wherein each application program node corresponds to a failed controller, one
Timed task monitor and a monitoring node device, two parts of application program nodes sharing managers.
3. the method according to claim 1, wherein described be respectively configured application program major node and using journey
Sequence backup node includes:
Two failed controllers obtain the application program node starting in corresponding monitoring node device respectively, export and select to manager
Lift notification instruction;
Manager receives election notification instruction, respectively two parts of application program nodes create corresponding application program node path with
It conducts an election, election results information is notified into two failed controllers respectively;
Failed controller receives election results information, notifies corresponding monitoring node device;
Monitoring node device by comprising application program node be placed in manager for the application program node creation application program
On node path, if election results information is to elect successfully, the application program node for including becomes the main section of application program
Point;If election results information is election failure, the application program node for including becomes Application Backup node.
4. according to the method described in claim 3, it is characterized in that, the failed controller includes: active backup election device
Module, wherein the order line of starting application program node is configured in active backup election device submodule.
5. according to the method described in claim 4, it is characterized in that, the failed controller further include: health monitor submodule
Block and heartbeat server submodule, the monitoring node device include: healthy submodule, heartbeat client child module and application
Program node, the application program node starting obtained in corresponding monitoring node device, exports election notice to manager and refers to
Order includes:
The healthy regular inquiry application node state of submodule, the application program node state that storage inquiry obtains;
Health monitor submodule is interacted with healthy submodule, obtains the application program node state stored in healthy submodule,
It is compared with the application program node state of itself storage, when meeting pre-set election strategy, is selected to active backup
Lift device submodule output election notification instruction;
Active backup election device submodule receives the election notification instruction of health monitor submodule output, exports to manager.
6. according to the method described in claim 5, it is characterized in that, the application program node state include: inactive state,
Start and does not elect state, application program major node state and Application Backup node state successfully.
7. according to the method described in claim 5, it is characterized in that, described meet pre-set election strategy and include:
If the application program node state stored in health monitor submodule is inactive state, the application program section of acquisition
Dotted state is to start not elect state successfully, meets pre-set election strategy.
8. according to the method described in claim 5, it is characterized in that, described meet pre-set election strategy and include:
If the application program node state stored in health monitor submodule is application program major node state or applies journey
The application program node state of sequence backup node state, acquisition is inactive state, meets pre-set election strategy.
9. will match the method according to claim 1, wherein described after application program major node is abnormal
The Application Backup node set is set as application program major node and includes:
The state of application program major node in failed controller monitoring node device, if listening to application program major node shape
State changes, and exports election switching command to manager;
Manager receives election switching command, is the application program node of the application program major node creation in deletion manager
Path using the Application Backup node path of storage as application program major node path, and will include election successfully choosing
It lifts result information and notifies another failed controller;
Another failed controller receives election results information, notifies corresponding monitoring node device;
It monitors node device and updates corresponding application program node state.
10. according to the method described in claim 9, it is characterized in that, the Application Backup node that is set as includes:
The corresponding failed controller of the application program node of restarting obtains application program node reboot, defeated to manager
Backup instruction out;
Manager receives backup instruction, creates corresponding Application Backup node road for the application program node of restarting
Backup result information is notified failed controller by diameter;
Failed controller receives backup result information, notifies corresponding monitoring node device;
The application program node of restarting is placed in manager as the application of application program node creation by monitoring node device
On program backup node path, the application program node of the restarting becomes Application Backup node.
11. according to the described in any item methods of claim 5 to 10, which is characterized in that the method also includes:
After timed task monitor monitors that corresponding failed controller is abnormal, by the manager by the application
Program backup node is set as application program major node;
Timed task monitor calls the pre-set order line for being used to start the failed controller, starts abnormal failure
Controller.
12. according to the method for claim 11, which is characterized in that described to monitor corresponding event in timed task monitor
After barrier controller is abnormal, application program major node packet is set for the Application Backup node by the manager
It includes:
Heartbeat client child module obtains application program node state from healthy submodule, sends and wraps to heartbeat server submodule
The heartbeat packet of the node state containing application program;
Heartbeat server submodule obtains active backup election device submodule bulk state, receives the heart that heartbeat client child module is sent
Packet is jumped, returns to the heartbeat packet response comprising active backup election device submodule bulk state to heartbeat client child module;
Heartbeat client child module receives heartbeat packet response, active backup election device submodule bulk state is obtained, if the work obtained
Jump backup election device submodule is in inactive state, and application program node state is application program major node state, triggering
The current state of application program node is revised as Application Backup node state;
Timed task monitor monitor active backup election device submodule, if active backup election device submodule is in inactive
State sets application program major node for the Application Backup node by manager.
13. a kind of provide the device of applied business, which is characterized in that the device includes: application program node building module, configuration
Module, exception processing module and restart module, wherein
Application program node constructs module, for being two parts of application builds applications in the management group system of electronic equipment
Program node;
Configuration module is respectively configured application program major node and answers for starting two parts of application program nodes of building
With program backup node;
Exception processing module, for after application program major node is abnormal, the Application Backup node of configuration to be arranged
For application program major node;
Restart module, is previously implanted in management group system for calling for starting the order line of application program node, weight
The abnormal application program major node of new starting, and it is set as Application Backup node;
Wherein, the application program node building module includes: management group system construction unit, application program node building list
Member, the first order line configuration unit and the second order line configuration unit, wherein
Group system construction unit is managed, includes failed controller, timed task monitor, manager and monitoring for constructing
The management group system of node device, the quantity of the failed controller, timed task monitor and monitoring node device are 2, institute
The quantity for stating manager is 1;
Application program node construction unit, for being respectively the application builds one in two monitoring node devices using journey
Sequence node;
First order line configuration unit, for being configured to the life of starting application program node in two failed controllers respectively
Enable row;
Second order line configuration unit, for being configured to startup separator controller in two timed task monitors respectively
Order line.
14. device according to claim 13, which is characterized in that the corresponding failed controller of each application program node,
One timed task monitor and a monitoring node device, two parts of application program nodes sharing managers.
15. device according to claim 13, which is characterized in that described that application program major node and application is respectively configured
Program backup node includes:
Two failed controllers obtain the application program node starting in corresponding monitoring node device respectively, export and select to manager
Lift notification instruction;
Manager receives election notification instruction, respectively two parts of application program nodes create corresponding application program node path with
It conducts an election, election results information is notified into two failed controllers respectively;
Failed controller receives election results information, notifies corresponding monitoring node device;
Monitoring node device by comprising application program node be placed in manager for the application program node creation application program
On node path, if election results information is to elect successfully, the application program node for including becomes the main section of application program
Point;If election results information is election failure, the application program node for including becomes Application Backup node.
16. device according to claim 15, which is characterized in that the failed controller includes: active backup election device
Submodule, wherein the order line of starting application program node is configured in active backup election device submodule.
17. device according to claim 16, which is characterized in that the failed controller further include: health monitor
Module and heartbeat server submodule, the monitoring node device include: healthy submodule, heartbeat client child module and answer
With program node, the application program node starting obtained in corresponding monitoring node device exports election notice to manager
Instruction includes:
The healthy regular inquiry application node state of submodule, the application program node state that storage inquiry obtains;
Health monitor submodule is interacted with healthy submodule, obtains the application program node state stored in healthy submodule,
It is compared with the application program node state of itself storage, when meeting pre-set election strategy, is selected to active backup
Lift device submodule output election notification instruction;
Active backup election device submodule receives the election notification instruction of health monitor submodule output, exports to manager.
18. device according to claim 17, which is characterized in that the application program node state includes: inactive shape
State starts and does not elect state, application program major node state and Application Backup node state successfully.
19. device according to claim 17, which is characterized in that described to meet pre-set election strategy and include:
If the application program node state stored in health monitor submodule is inactive state, the application program section of acquisition
Dotted state is to start not elect state successfully, meets pre-set election strategy.
20. device according to claim 17, which is characterized in that described to meet pre-set election strategy and include:
If the application program node state stored in health monitor submodule is application program major node state or applies journey
The application program node state of sequence backup node state, acquisition is inactive state, meets pre-set election strategy.
21. device according to claim 13, which is characterized in that the exception processing module includes: monitoring unit, switching
Unit, notification unit and updating unit, wherein
Monitoring unit, for notifying the state of application program major node in failed controller monitoring node device, if monitored
It changes to application program major node state, exports election switching command to manager;
Switch unit receives election switching command for notification manager, and deleting in manager is the application program major node
The application program node path of creation, using the Application Backup node path of storage as application program major node path, and
It will be comprising electing successful election results information to notify another failed controller;
Notification unit notifies corresponding monitoring node device for notifying another failed controller to receive election results information;
Updating unit, for notifying monitoring node device to update corresponding application program node state.
22. device according to claim 21, which is characterized in that described to restart module and include: call unit, restart monitoring
Unit, creating unit, information notification unit and reconfigure unit, wherein
Call unit is previously implanted in management group system for calling for starting the order line of application program node, weight
The abnormal application program major node of new starting;
Restart monitoring unit, the corresponding failed controller of the application program node for restarting obtains application program node weight
New starting exports backup instruction to manager;
Creating unit receives backup instruction for notification manager, creates corresponding answer for the application program node of restarting
With program backup node path, backup result information is notified into failed controller;
Information notification unit notifies corresponding monitoring node device for notifying failed controller to receive backup result information;
Unit is reconfigured, for notifying monitoring node device that the application program node of restarting is placed in manager as the application
On the Application Backup node path of program node creation, it is standby that the application program node of the restarting becomes application program
Part node.
23. device according to claim 22, which is characterized in that described to restart module further include: exception monitoring unit with
And abnormal restoring unit, wherein
Exception monitoring unit, for passing through institute after timed task monitor monitors that corresponding failed controller is abnormal
It states manager and sets application program major node for the Application Backup node;
Abnormal restoring unit, for notifying that it is pre-set for starting the failed controller that timed task monitor calls
Order line starts abnormal failed controller.
24. device according to claim 23, which is characterized in that the exception monitoring unit include: heartbeat packet subelement,
Heartbeat packet responds subelement, parsing subunit and monitoring subelement, wherein
Heartbeat packet subelement, for notifying heartbeat client child module to obtain application program node state from healthy submodule, to
Heartbeat server submodule sends the heartbeat packet comprising application program node state;
Heartbeat packet responds subelement, for notifying heartbeat server submodule to obtain active backup election device submodule bulk state, connects
Get into the frame of mind for work and jump the heartbeat packet of client child module transmission, is returned to heartbeat client child module and elect device submodule comprising active backup
The heartbeat packet of state responds;
Parsing subunit obtains active backup election device submodule for notifying heartbeat client child module to receive heartbeat packet response
Bulk state, if the active backup election device submodule obtained is in inactive state, and application program node state is application
The current state of application program node is revised as Application Backup node state by program major node state, triggering;
Subelement is monitored, for timed task monitor monitor active backup election device submodule, if active backup election device
Submodule is in inactive state, sets application program major node for the Application Backup node by manager.
25. a kind of electronic equipment, which is characterized in that the electronic equipment includes: shell, processor, memory, circuit board and electricity
Source circuit, wherein circuit board is placed in the space interior that shell surrounds, and processor and memory setting are on circuit boards;Power supply
Circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is for storing executable program code;Processing
Device runs program corresponding with executable program code by reading the executable program code stored in memory, for holding
The method of applied business is provided described in the aforementioned any claim 1-12 of row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610306379.8A CN106021005B (en) | 2016-05-10 | 2016-05-10 | Method and device for providing application service and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610306379.8A CN106021005B (en) | 2016-05-10 | 2016-05-10 | Method and device for providing application service and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106021005A CN106021005A (en) | 2016-10-12 |
CN106021005B true CN106021005B (en) | 2019-01-22 |
Family
ID=57099036
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610306379.8A Active CN106021005B (en) | 2016-05-10 | 2016-05-10 | Method and device for providing application service and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106021005B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107204934A (en) * | 2017-06-14 | 2017-09-26 | 北京凤凰理理它信息技术有限公司 | Automatic switchover method of flow, device, storage medium and electronic equipment |
CN107357681B (en) * | 2017-06-26 | 2019-12-31 | 杭州铭师堂教育科技发展有限公司 | Salt-based Zookeeper backup management system and method |
CN108874658A (en) * | 2017-12-25 | 2018-11-23 | 北京安天网络安全技术有限公司 | A kind of sandbox analysis method, device, electronic equipment and storage medium |
CN111092921B (en) * | 2018-10-24 | 2022-05-10 | 北大方正集团有限公司 | Data acquisition method, device and storage medium |
CN109710394A (en) * | 2018-12-27 | 2019-05-03 | 出门问问信息科技有限公司 | Timing task processing system and method |
CN111427704A (en) * | 2020-03-13 | 2020-07-17 | 平安科技(深圳)有限公司 | Remote monitoring method, device and equipment for configuration instruction and storage medium |
CN113472566A (en) * | 2021-06-11 | 2021-10-01 | 北京市大数据中心 | Status monitoring method of union block chain and master node status monitoring system |
CN113656207B (en) * | 2021-08-16 | 2023-11-03 | 北京百度网讯科技有限公司 | Fault processing method, device, electronic equipment and medium |
CN115514689B (en) * | 2022-09-22 | 2024-04-02 | 成都中航信虹科技股份有限公司 | Application program daemon method, device and storage medium |
CN116028245B (en) * | 2023-02-09 | 2023-10-13 | 中国证券登记结算有限责任公司 | Service message processing method and device based on message middleware |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103019889A (en) * | 2012-12-21 | 2013-04-03 | 曙光信息产业(北京)有限公司 | Distributed file system and failure processing method thereof |
CN105554106A (en) * | 2015-12-15 | 2016-05-04 | 上海仪电(集团)有限公司 | Memcache distributed caching system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9454359B2 (en) * | 2013-01-28 | 2016-09-27 | Red Hat, Inc. | Deployment optimization for high availability in a multi-tenant platform-as-a-service (PaaS) system |
-
2016
- 2016-05-10 CN CN201610306379.8A patent/CN106021005B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103019889A (en) * | 2012-12-21 | 2013-04-03 | 曙光信息产业(北京)有限公司 | Distributed file system and failure processing method thereof |
CN105554106A (en) * | 2015-12-15 | 2016-05-04 | 上海仪电(集团)有限公司 | Memcache distributed caching system |
Also Published As
Publication number | Publication date |
---|---|
CN106021005A (en) | 2016-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106021005B (en) | Method and device for providing application service and electronic equipment | |
CN108766422B (en) | Voice equipment response method and device, storage medium and computer equipment | |
US20170048123A1 (en) | System for controlling switch devices, and device and method for controlling system configuration | |
CN109391528A (en) | Awakening method, device, equipment and the storage medium of speech-sound intelligent equipment | |
TW201944236A (en) | Task processing method, apparatus, and system | |
CN108804119A (en) | Configure update method, device, system, configuration center, application node and medium | |
CN105262911B (en) | The processing method, system and device of system telephone in voice communication | |
CN110445662A (en) | OpenStack control node is adaptively switched to the method and device of calculate node | |
CN107332906A (en) | Distributed system office management method and device | |
CN106385330B (en) | A kind of implementation method and device of network function virtualization composer | |
CN105743671B (en) | Capacity expansion method, controller and system | |
CN109842526B (en) | Disaster recovery method and device | |
CN106161086B (en) | The control method and device that master control borad is restarted | |
CN110515696A (en) | Information monitoring method and device | |
CN112612635B (en) | Multi-level protection method for application program | |
CN108958980A (en) | Prevent method, electronic device and the computer readable storage medium of Activity life cycle exception | |
CN109491762B (en) | Container state control method and device, storage medium and electronic equipment | |
CN106445610A (en) | Application processing method and device | |
CN109947630B (en) | Fault notification method, device and storage medium | |
CN105072185A (en) | TR069 (Technical Report 069) remote monitoring method and system, and communication equipment | |
CN108234215B (en) | Gateway creating method and device, computer equipment and storage medium | |
CN110442367A (en) | The upgrade method and device of program, storage medium and electronic device | |
CN107332928B (en) | Using account synchronization management method, device, storage medium and electronic equipment | |
CN112328445B (en) | Multi-node management system based on condul | |
CN114553686B (en) | Method, system, equipment and storage medium for switching main and standby flow |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |