CN107632899B - Snapshot service method and device of application server - Google Patents

Snapshot service method and device of application server Download PDF

Info

Publication number
CN107632899B
CN107632899B CN201710671253.5A CN201710671253A CN107632899B CN 107632899 B CN107632899 B CN 107632899B CN 201710671253 A CN201710671253 A CN 201710671253A CN 107632899 B CN107632899 B CN 107632899B
Authority
CN
China
Prior art keywords
snapshot
rule
application server
rules
execution time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710671253.5A
Other languages
Chinese (zh)
Other versions
CN107632899A (en
Inventor
杨传艳
赵欣
翟鲁超
李新峰
谭昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Civic Se Commercial Middleware Co ltd
Original Assignee
Shandong Civic Se Commercial Middleware Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Civic Se Commercial Middleware Co ltd filed Critical Shandong Civic Se Commercial Middleware Co ltd
Priority to CN201710671253.5A priority Critical patent/CN107632899B/en
Publication of CN107632899A publication Critical patent/CN107632899A/en
Application granted granted Critical
Publication of CN107632899B publication Critical patent/CN107632899B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a snapshot service method and a device of an application server, and the method comprises the following steps: acquiring at least two snapshot rules; setting the execution time of the snapshot rule in a timer; and the control timer executes the snapshot rules in sequence according to the execution time. Therefore, the method realizes that a plurality of snapshot rules are executed in sequence according to the execution time by setting the execution time of the snapshot rule, so that the information of the application server during the failure can be more comprehensively collected. In addition, since a plurality of snapshot rules can be executed, a user can customize the corresponding snapshot rule according to needs and apply the corresponding snapshot rule to the application server snapshot service, so that the snapshot rule is not limited to the content provided by the snapshot service by default, and the customization degree of the snapshot rule is higher. In addition, the snapshot service device of the application server also has the above-mentioned effects.

Description

Snapshot service method and device of application server
Technical Field
The present invention relates to the field of server snapshots, and in particular, to a snapshot service method and apparatus for an application server.
Background
With the continuous development of internet technology, the number of application servers in a cluster is increasingly huge, and because the failure of an application server in a cluster is often short in duration and is difficult to be checked by operation and maintenance personnel at the first time, the monitoring strength of the operation and maintenance personnel on the working condition of the application server is gradually reduced. Based on the above situation, operation and maintenance personnel urgently need to be able to master the fault condition monitoring and collection of the application server in the operation stage, so that the snapshot service of the application server is generated at the discretion of the operation. The snapshot service can quickly respond when the application server fails, and acquires software and hardware running condition information under the condition of responding to the failure according to the snapshot rule, thereby providing favorable help for operation and maintenance personnel to solve the failure of the application server.
However, in the prior art, the snapshot rule of the snapshot service is fixed, customization is insufficient, and operation and maintenance personnel can only set the rule by using the snapshot rule provided by the snapshot service by default; in addition, the snapshot service only supports the execution of one snapshot rule, and the amount of content monitored by the application server in the snapshot rule is also strictly limited, so that the fault information cannot be comprehensively collected.
Therefore, it is obvious that providing a snapshot service method of an application server to improve the customizable degree of a snapshot rule and collect failure information of the application server more comprehensively is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a snapshot service method and a snapshot service device of an application server, so that information of the application server in failure can be more comprehensively collected, and the customizability degree of a snapshot rule is improved.
In order to solve the above technical problem, the present invention provides a snapshot service method for an application server, including:
acquiring at least two snapshot rules;
setting the execution time of the snapshot rule in a timer;
and the control timer executes the snapshot rules in sequence according to the execution time.
Preferably, after acquiring the at least two snapshot rules, the method further includes:
and establishing an interface for editing the snapshot rule in an annotation mode.
Preferably, the method further comprises:
judging whether the snapshot rule changes or not;
if so, the snapshot rule is restarted.
Preferably, when the snapshot rule changes, the method further comprises:
judging whether the snapshot rule is applied to other target application servers in the application server cluster;
if yes, synchronizing the snapshot rule to the target application server, and entering a step of restarting the snapshot rule.
Preferably, the snapshot rule specifically includes:
the specified monitoring content and corresponding monitoring information generated according to the monitoring content.
Preferably, the annotation is in particular the HK2 annotation.
Preferably, the interface is a REST interface.
In addition, the present invention also provides a snapshot service apparatus of an application server, including:
the rule acquisition module is used for acquiring at least two snapshot rules;
the setting module is used for setting the execution time of the snapshot rule in the timer;
and the execution module is used for controlling the timer to sequentially execute the snapshot rule according to the execution time.
Preferably, the apparatus further comprises:
and the interface creating module is used for establishing an interface for editing the snapshot rule in an annotation mode.
Preferably, the apparatus further comprises:
the rule judging module is used for judging whether the snapshot rule changes or not, and if so, the restarting module is called;
and the restarting module is used for restarting the snapshot rule.
The snapshot service method of the application server provided by the invention realizes that the plurality of snapshot rules are executed in sequence according to the execution time by setting the execution time of the snapshot rule. The method has the advantages that although the number of the contents monitored by the application server in each snapshot rule is strictly limited, the purpose of increasing the number of the contents monitored by the application server can be achieved by executing a plurality of snapshot rules, so that the information when the application server fails can be more comprehensively collected. In addition, since a plurality of snapshot rules can be executed, a user can customize the corresponding snapshot rule according to needs and apply the corresponding snapshot rule to the application server snapshot service, so that the snapshot rule is not limited to the content provided by the snapshot service by default, and the customization degree of the snapshot rule is higher. In addition, the invention also provides a snapshot service device of the application server, and the beneficial effects are as described above.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a snapshot service method of an application server according to an embodiment of the present invention;
fig. 2 is a flowchart of another snapshot service method of an application server according to an embodiment of the present invention;
fig. 3 is a structural diagram of a snapshot service apparatus of an application server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
The core of the invention is to provide a snapshot service method and a snapshot service device of an application server, so that the customization degree of a snapshot rule is higher, and when the application server fails, the related information of the failure can be more comprehensively collected.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Example one
Fig. 1 is a flowchart of a snapshot service method of an application server according to an embodiment of the present invention. Referring to fig. 1, the snapshot service method of the application server includes the following specific steps:
step S10: at least two snapshot rules are obtained.
It can be understood that, since the amount of content monitored for the application server is strictly limited in a snapshot rule, only part of the application server information can be monitored in a snapshot rule. Therefore, the advantage of acquiring multiple snapshot rules is that the information of the application server can be monitored more comprehensively, and the user can set multiple types of monitoring contents in different snapshot rules according to the needs, so that the customization is stronger.
Step S11: the execution time of the snapshot rule is set in a timer.
The snapshot rules are constrained in execution time by a timer, and each time the execution time of one snapshot rule reaches a threshold set by a user, the snapshot rule stops executing and the next snapshot rule is executed. It will be appreciated that the execution time depends on the specific needs of the user, but should be relatively short in order to achieve the effect that all snapshot rules proceed simultaneously as much as possible.
Step S12: and the control timer executes the snapshot rules in sequence according to the execution time.
In this step, the execution of the snapshot rule is controlled according to the time of the snapshot rule set in the timer, so that the purpose of realizing the snapshot of various snapshot rules is achieved.
The snapshot service method of the application server provided by the invention realizes that the plurality of snapshot rules are executed in sequence according to the execution time by setting the execution time of the snapshot rule. The method has the advantages that although the number of the contents monitored by the application server in each snapshot rule is strictly limited, the purpose of increasing the number of the contents monitored by the application server can be achieved by executing a plurality of snapshot rules, so that the information when the application server fails can be more comprehensively collected. In addition, since a plurality of snapshot rules can be executed, a user can customize the corresponding snapshot rule according to needs and apply the corresponding snapshot rule to the application server snapshot service, so that the snapshot rule is not limited to the content provided by the snapshot service by default, and the customization degree of the snapshot rule is higher.
Example two
Fig. 2 is a flowchart of another snapshot service method of an application server according to an embodiment of the present invention. Steps S10-S12 in FIG. 2 are the same as those in FIG. 1, and are not repeated herein.
As shown in fig. 2, based on the above embodiment, as a preferred implementation, after acquiring at least two snapshot rules, the method further includes:
step S20: and establishing an interface for editing the snapshot rule in an annotation mode.
In the prior art, a DOM-mode stream model mode is generally used to read the XML configuration file to modify or edit the snapshot rule, but the snapshot rule is edited and modified in a configuration file mode, so that a large number of configuration files exist in an application server, configuration file redundancy is caused, and readability is reduced. Therefore, after the interface for editing the snapshot rule is established in the snapshot rule in an annotation mode, the editing operation of the snapshot rule can be realized through the interface, so that the operation of frequently writing the configuration file for editing the snapshot rule is avoided, the file redundancy is reduced, and the efficiency of editing the snapshot rule is improved. It is emphasized that, since there are many types of monitoring for the application server, the kinds and number of interfaces should be specifically determined according to different kinds of snapshot rules.
On the basis of the above example, the annotation is in particular the HK2 annotation, as a preferred implementation.
Since HK2 is a powerful lightweight annotation framework, it occupies less resources of the application server as a whole, and therefore has little impact on the performance of the application server.
On the basis of the above embodiment, as a preferred implementation, the interface is specifically a REST interface.
The REST interface is an interface type which accords with the REST standard, the overall style is simple and clear, the readability of the code is higher, and a series of operations such as the optimization of the interface in the later period are facilitated.
For a clearer understanding of the above embodiments, the following description will be made for a certain operation step of establishing an interface, but not specifically limited thereto:
annotating @ Configured for each tag interface class in the data model, after the annotation is successful, the DOM parser parses an XML configuration file according to attributes and elements specified in the tag interface class, reads snapshot rules, and issues the tag interface as an REST interface after the annotation is performed through HK 2.
As shown in fig. 2, on the basis of the above embodiment, as a preferred implementation, the method further includes:
step S21: it is determined whether a change has occurred to the snapshot rule, and if so, step S22 is performed.
Step S22: the snapshot rule is restarted.
It can be understood that, after the snapshot rule is changed, the snapshot rule should be executed again, which can ensure that the updated snapshot rule can be immediately applied to the snapshot service, thereby avoiding the situation that the information collected by the snapshot does not meet the user requirement when the application server fails. The specific execution order of the step is not limited, and the step may be performed after or simultaneously with any of the steps.
As shown in fig. 2, based on the above embodiment, as a preferred implementation, when the snapshot rule changes, the method further includes:
step S23: determining whether the snapshot rule applies to other target application servers in the application server cluster,
if so, step S24 is performed.
Step S24: the snapshot rule is synchronized to the target application server and the process proceeds to step S22.
Since application servers are often in an application server cluster environment, and some snapshot rules are commonly used by some application servers in the cluster, when a snapshot rule in one application server changes, the snapshot rules in other application servers also need to be changed in the same way. Therefore, in this embodiment, when a certain snapshot rule in an application server changes and another target application server in the cluster also uses the snapshot rule, the changed snapshot rule is synchronized to the target application server. Therefore, by adopting the method, the complicated operation that the user configures the snapshot rule one by one is avoided, and the overall efficiency is improved.
In addition, as a preferred embodiment, the snapshot rule specifically includes:
the specified monitoring content and corresponding monitoring information generated according to the monitoring content.
Wherein, the specified monitoring content comprises items such as CPU, GC, HTTP, JDBC, MEMORY and the like; the monitoring information includes a series of information helpful for the user to analyze the failure, such as GC log, MEMORY summary, MEMORY detailed information, JSTACK, etc. It should be noted that the monitored content can be obtained by reading the data interface provided by the application server, but a reasonable reading frequency should be maintained, and the overall performance of the application server may be affected by too high a reading frequency.
EXAMPLE III
In the above, the embodiment of the snapshot service method of the application server is described in detail, and the present invention further provides a snapshot service apparatus of the application server corresponding to the method.
Fig. 3 is a structural diagram of a snapshot service apparatus of an application server according to an embodiment of the present invention. The snapshot service device of the application server provided by the embodiment of the invention specifically comprises:
a rule obtaining module 10, configured to obtain at least two snapshot rules.
And a setting module 11, configured to set an execution time of the snapshot rule in a timer.
And the execution module 12 is configured to control the timer to execute the snapshot rule in sequence according to the execution time.
The snapshot service device of the application server provided by the invention realizes that a plurality of snapshot rules are executed in sequence according to the execution time by setting the execution time of the snapshot rule. The method has the advantages that although the number of the contents monitored by the application server in each snapshot rule is strictly limited, the purpose of increasing the number of the contents monitored by the application server can be achieved by executing a plurality of snapshot rules, so that the information when the application server fails can be more comprehensively collected. In addition, since a plurality of snapshot rules can be executed, a user can customize the corresponding snapshot rule according to needs and apply the corresponding snapshot rule to the application server snapshot service, so that the snapshot rule is not limited to the content provided by the snapshot service by default, and the customization degree of the snapshot rule is higher.
On the basis of the third embodiment, the apparatus further includes:
and the interface creating module is used for establishing an interface for editing the snapshot rule in an annotation mode.
On the basis of the third embodiment, the apparatus further includes:
the rule judging module is used for judging whether the snapshot rule changes or not, and if so, the restarting module is called;
and the restarting module is used for restarting the snapshot rule.
The snapshot service method and device of the application server provided by the invention are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (8)

1. A snapshot service method of an application server is characterized by comprising the following steps:
acquiring at least two snapshot rules;
setting the execution time of the snapshot rule in a timer;
controlling the timer to sequentially execute the snapshot rule according to the execution time;
after the at least two snapshot rules are obtained, the method further includes:
and establishing an interface for editing the snapshot rule in an annotation mode.
2. The method of claim 1, further comprising:
judging whether the snapshot rule changes or not;
if so, the snapshot rule is restarted.
3. The method of claim 2, wherein when the snapshot rule changes, the method further comprises:
judging whether the snapshot rule is applied to other target application servers in the application server cluster;
if yes, synchronizing the snapshot rule to the target application server, and entering the step of restarting the snapshot rule.
4. The method according to claim 1, wherein the snapshot rules specifically include:
the specified monitoring content and corresponding monitoring information generated according to the monitoring content.
5. Method according to claim 1, characterized in that said annotation is in particular the HK2 annotation.
6. Method according to claim 1, characterized in that the interface is in particular a REST interface.
7. A snapshot service apparatus of an application server, comprising:
the rule acquisition module is used for acquiring at least two snapshot rules;
the setting module is used for setting the execution time of the snapshot rule in a timer;
the execution module is used for controlling the timer to sequentially execute the snapshot rule according to the execution time;
wherein the apparatus further comprises:
and the interface creating module is used for establishing an interface for editing the snapshot rule in an annotation mode.
8. The apparatus of claim 7, further comprising:
the rule judging module is used for judging whether the snapshot rule changes or not, and if so, the restarting module is called;
the restarting module is used for restarting the snapshot rule.
CN201710671253.5A 2017-08-08 2017-08-08 Snapshot service method and device of application server Active CN107632899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710671253.5A CN107632899B (en) 2017-08-08 2017-08-08 Snapshot service method and device of application server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710671253.5A CN107632899B (en) 2017-08-08 2017-08-08 Snapshot service method and device of application server

Publications (2)

Publication Number Publication Date
CN107632899A CN107632899A (en) 2018-01-26
CN107632899B true CN107632899B (en) 2020-12-04

Family

ID=61099499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710671253.5A Active CN107632899B (en) 2017-08-08 2017-08-08 Snapshot service method and device of application server

Country Status (1)

Country Link
CN (1) CN107632899B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656876A (en) * 2018-12-07 2019-04-19 杭州宏杉科技股份有限公司 Storing method, device, electronic equipment and the machine readable storage medium of snapshot
US11741076B2 (en) 2021-03-22 2023-08-29 Kyndryl, Inc. Adaptive snapshot controller

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8613080B2 (en) * 2007-02-16 2013-12-17 Veracode, Inc. Assessment and analysis of software security flaws in virtual machines
AU2013308873A1 (en) * 2012-08-28 2015-03-05 VCE Company LLC Integrated computing platform deployed in an existing computing environment
US8983961B2 (en) * 2012-11-29 2015-03-17 International Business Machines Corporation High availability for cloud servers
CN104410671B (en) * 2014-11-03 2017-11-10 深圳市蓝凌软件股份有限公司 A kind of snapshot grasping means and data supervising device
CN106681861A (en) * 2016-12-08 2017-05-17 杭州销冠网络科技有限公司 New environment isolation configuration data management method and system

Also Published As

Publication number Publication date
CN107632899A (en) 2018-01-26

Similar Documents

Publication Publication Date Title
CN110162471B (en) Pressure testing method and system based on container cloud
US10353763B2 (en) Fault processing method, related apparatus, and computer
CN107040578B (en) Data synchronization method, device and system
WO2017162032A1 (en) Method and device for executing data recovery operation
US20190332513A1 (en) Method and apparatus for dealing with abnormality of application program and storage medium
WO2018126964A1 (en) Task execution method and apparatus and server
CN107766509B (en) Method and device for static backup of webpage
CN107766130B (en) Method and device for migrating virtual machine to container
CN102902558A (en) Project script file updating system and method as well as script file merging method and device
US20150095692A1 (en) Process control systems and methods
CN107632899B (en) Snapshot service method and device of application server
CN106713011B (en) Method and system for obtaining test data
US20100077382A1 (en) Computer-readable recording medium string a bug detection support program, similar structure identification information list output program, bug detection support apparatus, and bug detection support method
CN109063040B (en) Client program data acquisition method and system
CN116088846A (en) Processing method, related device and equipment for continuous integrated code format
CN106843822B (en) Execution code generation method and equipment
CN112069144A (en) Method and device for collecting system logs by multi-control cluster
CN111200654A (en) Client request error processing method and device
CN110941658A (en) Data export method, device, server and storage medium
JP6516343B2 (en) Application user interface automatic test method, electronic device, system and storage medium
CN106708541A (en) Version upgrading processing method and apparatus
WO2016120989A1 (en) Management computer and rule test method
CN115168175A (en) Program error solving method, device, electronic equipment and storage medium
CN113285824A (en) Method and device for monitoring security of network configuration command
US20150007200A1 (en) Automatically Deriving a Command for Starting a Program in an Operating System of a Computer

Legal Events

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