[go: up one dir, main page]

CN113986676A - Server health check method and device, electronic equipment and storage medium - Google Patents

Server health check method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113986676A
CN113986676A CN202111292985.6A CN202111292985A CN113986676A CN 113986676 A CN113986676 A CN 113986676A CN 202111292985 A CN202111292985 A CN 202111292985A CN 113986676 A CN113986676 A CN 113986676A
Authority
CN
China
Prior art keywords
result
health check
health
server
check
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111292985.6A
Other languages
Chinese (zh)
Inventor
赵沛静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software 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 Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202111292985.6A priority Critical patent/CN113986676A/en
Publication of CN113986676A publication Critical patent/CN113986676A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a server health check method, a server health check device, electronic equipment and a storage medium, which are used for solving the problem that the health check state detection requirement under a complex scene is difficult to meet. The method comprises the following steps: acquiring policy configuration information; analyzing the strategy configuration information by using a custom rule script to obtain a check strategy; and performing interactive health check on the server nodes in the cluster for multiple times according to the check strategy to obtain a health check result, wherein the interactive health check refers to performing the health check by using a detection request carrying response information, and the response information is included in the last response result.

Description

Server health check method and device, electronic equipment and storage medium
Technical Field
The present application relates to the technical field of server clustering and health check, and in particular, to a server health check method, apparatus, electronic device, and storage medium.
Background
The Heartbeat Mechanism (Heartbeat Mechanism) refers to a Heartbeat packet in computer science is a periodic signal, and whether the behavior is normal or not or whether the behavior is consistent with a computer system is detected in a form of hardware or software. Usually, a heartbeat packet is sent every few seconds between machines, and if the receiving terminal does not receive the heartbeat packet within a specified time (usually within a time interval of sending several heartbeat packets), the sending terminal is determined to have failed to send.
The server health check means that the effect of checking the health state of a server node is achieved by using a heartbeat mechanism between servers, and the health state here means that the server can normally provide services for the terminal. Specific examples thereof include: and sending a heartbeat packet at regular time to let the opposite side know that the opposite side still stays alive, and letting the opposite side return a response packet of the heartbeat packet, so that whether the opposite side stays alive or not can be known, and the connection validity can be ensured.
At present, the idea for server health check is that a certain rule is constructed and a single request is sent for a specified Protocol, such as Internet Control Message Protocol (ICMP), Transmission Control Protocol (TCP), hypertext Transfer Protocol (HTTP), and the like, but it is found in practice that sending a single request using a specified Protocol is difficult to meet the health check state detection requirement in a complex scene, for example, for complex scenes such as banks, hospitals, finance, schools, and the like.
Disclosure of Invention
An object of the embodiments of the present application is to provide a server health check method, device, electronic device and storage medium, which are used to solve the problem that it is difficult to meet the health check state detection requirement in a complex scene.
The embodiment of the application provides a server health check method, which comprises the following steps: acquiring policy configuration information; analyzing the strategy configuration information by using a custom rule script to obtain a check strategy; and performing interactive health check on the server nodes in the cluster for multiple times according to the check strategy to obtain a health check result, wherein the interactive health check refers to performing the health check by using a detection request carrying response information, and the response information is included in the last response result. In the implementation process, the policy configuration information is analyzed by using the custom rule script to obtain the check policy, and interactive health check is performed on the server nodes in the cluster according to the check policy, so that the condition that a single request is sent to check and detect the health state is avoided. The self-defined rule script can self-define the interactive detection rule, and the strategy configuration information can set various complex scenes of the interactive detection strategy, so that the obtained interactive health examination result can meet the detection requirement of the health examination state under the complex scenes.
Optionally, in this embodiment of the present application, performing multiple interactive health checks on server nodes in a cluster according to a checking policy to obtain a health check result, where the method includes: generating a first detection request according to a preset protocol rule, and sending the first detection request to a server node in a cluster so as to enable the server node in the cluster to return a first response result comprising response information; judging whether the first response result is a first expected result; and if so, sending a second detection request carrying response information to the server nodes in the cluster, so that the server nodes in the cluster return a second response result corresponding to the second detection request, and determining a health check result according to the second response result. In the implementation process, the second probe request carrying the response information is sent to the server node in the cluster only when the first response result is the first expected result, so that the server node in the cluster returns the second response result corresponding to the second probe request, and the health check result is determined according to the second response result, and therefore, the two-time interactive probe strategy can meet the probe requirement of the health check state in most cases.
Optionally, in this embodiment of the application, after determining whether the first response result is the first expected result, the method further includes: if the first response result is not the first expected result, the health check result is determined to be a failure.
Optionally, in this embodiment of the present application, determining a health check result according to the second response result includes: judging whether the second response result is a second expected result; if so, determining that the health check result is successful, otherwise, determining that the health check result is failure.
Optionally, in this embodiment of the present application, performing multiple interactive health checks on server nodes in a cluster according to a checking policy includes: acquiring a health examination script, and loading an examination strategy through the health examination script to acquire a strategy examination script; the server nodes in the load balancing cluster are interactively health checked multiple times while the policy check script is executed. In the implementation process, the checking strategy is loaded through the health checking script to obtain a strategy checking script; when the strategy checking script is executed, the server nodes in the load balancing cluster are subjected to interactive health checking for many times, and the detection requirement of the health checking state under the complex scene can be effectively met by the interactive health checking results for many times.
Optionally, in this embodiment of the present application, after obtaining the health check result, the method further includes: judging whether the health examination result is successful or not; and if so, modifying the health state of the server node to be normal, otherwise, modifying the health state of the server node to be abnormal.
Optionally, in an embodiment of the present application, the method further includes: judging whether the health state of the server node is normal or not; and if so, acquiring the data traffic and forwarding the data traffic to the server node. In the implementation process, the data traffic is acquired and forwarded to the server node only when the health state of the server node is normal, so that the condition that the service cannot be provided due to the fact that the traffic is forwarded to the abnormal server node is avoided, and the robustness of the server health check is effectively improved.
An embodiment of the present application further provides a server health check device, including: the configuration information acquisition module is used for acquiring the strategy configuration information; the checking strategy obtaining module is used for analyzing the strategy configuration information by using the user-defined rule script to obtain a checking strategy; and the check result obtaining module is used for carrying out multiple interactive health checks on the server nodes in the cluster according to the check strategy to obtain a health check result, wherein the interactive health checks refer to carrying out the health checks by using the detection request carrying the response information, and the response information is included in the last response result.
Optionally, in an embodiment of the present application, the inspection result obtaining module includes: the system comprises a detection request sending module, a response information sending module and a response information sending module, wherein the detection request sending module is used for generating a first detection request according to a preset protocol rule and sending the first detection request to a server node in a cluster so as to enable the server node in the cluster to return a first response result comprising response information; the first result judging module is used for judging whether the first response result is a first expected result or not; and the first result determining module is used for sending a second detection request carrying response information to the server nodes in the cluster if the first response result is a first expected result, so that the server nodes in the cluster return a second response result corresponding to the second detection request, and determining a health check result according to the second response result.
Optionally, in this embodiment of the present application, the server health check apparatus further includes: and the checking result negation module is used for determining the health checking result as failure if the first response result is not the first expected result.
Optionally, in an embodiment of the present application, the inspection result determining module includes: the second result judging module is used for judging whether the second response result is a second expected result or not; and the second result determining module is used for determining that the health examination result is successful if the second response result is a second expected result, and otherwise, determining that the health examination result is failed.
Optionally, in an embodiment of the present application, the inspection result obtaining module includes: the inspection script obtaining module is used for obtaining the health inspection script and loading an inspection strategy through the health inspection script to obtain a strategy inspection script; and the interactive check module is used for performing interactive health check on the server nodes in the load balancing cluster for a plurality of times when the strategy check script is executed.
Optionally, in this embodiment of the present application, the server health check apparatus further includes: the third result judging module is used for judging whether the health examination result is successful or not; and the health state modification module is used for modifying the health state of the server node to be normal if the health check result is successful, or modifying the health state of the server node to be abnormal if the health check result is not successful.
Optionally, in this embodiment of the present application, the server health check apparatus further includes: the health state judging module is used for judging whether the health state of the server node is normal or not; and the data traffic sending module is used for acquiring the data traffic and forwarding the data traffic to the server node if the health state of the server node is normal.
An embodiment of the present application further provides an electronic device, including: a processor and a memory, the memory storing processor-executable machine-readable instructions, the machine-readable instructions when executed by the processor performing the method as described above.
Embodiments of the present application also provide a computer-readable storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the method as described above.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic flow chart illustrating a server health check method provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of a health check system in a load balancing environment according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating forwarding of data traffic according to a health check result according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a server health check device provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as presented in the figures, is not intended to limit the scope of the embodiments of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments obtained by a person skilled in the art based on the embodiments of the present application without any creative effort belong to the protection scope of the embodiments of the present application.
Before introducing the server health check method provided in the embodiment of the present application, some concepts related to the embodiment of the present application are introduced:
a computer cluster (also referred to as a cluster) refers to a group of loosely or tightly connected computers that work together and need to be installed with an operating system and cooperative software to cooperate together, and the cooperative computers may also be referred to as cluster nodes.
A High-Availability (HA) Cluster, also known as a High Availability Cluster, a clustered HA Cluster, or a failover Cluster, is a group of electronic computers that support server applications that operate reliably with the goal of minimum outage time.
It should be noted that the server health check method provided in the embodiments of the present application may be executed by an electronic device, where the electronic device refers to a device terminal or a server having a function of executing a computer program, and the device terminal includes, for example: a smart phone, a personal computer, a tablet computer, a personal digital assistant, or a mobile internet device, etc. The server is, for example: x86 server and non-x 86 server, non-x 86 server includes: mainframe, minicomputer, and UNIX server.
Application scenarios to which the server health check method is applicable are described below, where the application scenarios include, but are not limited to: the server health check method is used for carrying out health check and the like on the server nodes in the computer cluster, wherein the computer cluster comprises but is not limited to a load balancing system cluster, a high-availability cluster and the like, the load balancing system relates to various industries such as banks, hospitals, finance, schools and the like, and the server health check method can be used for providing diversified health check services for the industries and meeting the detection requirements of health check states of different industries under complex scenes of different services.
Please refer to fig. 1, which is a schematic flow chart of a server health check method according to an embodiment of the present application; the server health check method mainly includes the steps of analyzing strategy configuration information by using a custom rule script to obtain a check strategy, and performing interactive health check on server nodes in a cluster according to the check strategy, so that the condition that a single request is sent to check and detect a health state is avoided. The self-defined rule script can self-define the interactive detection rule, and the strategy configuration information can set various complex scenes of the interactive detection strategy, so that the obtained interactive health examination result can meet the detection requirement of the health examination state under the complex scenes. The embodiment of the server health check method may include:
step S110: the electronic device obtains policy configuration information.
The embodiment of step S110 described above is, for example: the electronic device obtains the policy configuration information from the configuration file on the file system or the mobile storage device, and of course, the electronic device may also obtain the policy configuration information from the configuration table of the database, and so on. Policy Configuration Information (Policy Configuration Information) herein refers to checking Policy Configuration related Information for health check, and the measurement Configuration Information herein includes but is not limited to: duration of each probing interval, timeout duration, number of attempts, etc.
After step S110, step S120 is performed: the electronic equipment analyzes the strategy configuration information by using the custom rule script to obtain the check strategy.
The embodiment of step S120 described above is, for example: the electronic equipment analyzes the strategy configuration information by using a custom rule script which is interpreted and executed by a preset programming language to obtain a check strategy; the preset programming language can use LISP, Shell, Perl, Python and the like, the custom rule script can be written by a user according to custom detection rules such as service characteristics, namely the custom rule script can enable the user to define the detection rules according to the service characteristics, so that the user can more flexibly check the health of the server nodes in the cluster, and can better cope with unknown services and more complex health check scenes in a load balancing environment.
After step S120, step S130 is performed: and the electronic equipment carries out multiple interactive health checks on the server nodes in the cluster according to the check strategy to obtain health check results.
The interactive health check refers to performing health check by carrying a probe request of response information in a response result, and specifically, the electronic device may send the probe request to the server multiple times to allow the electronic device to interact with the server at a deeper level, specifically, for example: in the interaction process of the HTTP service, the electronic device may obtain a redirect address returned by the server (i.e., response information returned in a last response result), and then resend the probe request to the redirect address to confirm the working health state of the server, or, in the user authentication process, it is necessary to first obtain the server authentication encryption algorithm type (i.e., response information returned in the last response result), then encrypt the authentication information according to the authentication encryption algorithm type, and send the encrypted information to the server, thereby verifying the health state of the server.
There are many embodiments of the above step S130, including but not limited to the following:
in a first embodiment, an electronic device executes a health check script that may perform a plurality of interactive health checks according to different protocols, which may include:
step S131: the electronic equipment generates a first detection request according to a preset protocol rule and sends the first detection request to the server nodes in the cluster, so that the server nodes in the cluster return a first response result comprising response information.
The embodiment of step S131 described above is, for example: taking the example of interactive health check by the HTTP service, the user may write an HTTP health check script according to the service authentication rule, and then the script on the electronic device may generate a first probe request according to the preset protocol rule, and send the first probe request to the server nodes in the cluster, so that the server nodes in the cluster return a first response result including the response information.
Step S132: the electronic device determines whether the first response result is a first expected result.
Step S133: if the first response result is the first expected result, the electronic device sends a second detection request carrying response information to the server nodes in the cluster, so that the server nodes in the cluster return a second response result corresponding to the second detection request, and the health check result is determined according to the second response result.
The embodiments of the above steps S132 to S133 are, for example: the electronic equipment judges whether the first response result is a first expected result; and if the first response result is the first expected result, the electronic equipment sends a second detection request carrying response information to the server nodes in the cluster. And after receiving the second detection request, the server nodes in the cluster return a second response result corresponding to the second detection request. The electronic equipment judges whether the second response result is a second expected result; if the second response result is a second expected result, the electronic device determines that the health check result is successful; if the second response result is not the second expected result, the electronic device determines that the health check result is a failure.
Step S134: if the first response result is not the first expected result, the health check result is determined to be a failure.
In a second embodiment, a health check script is used to perform multiple interactive health checks in a load balancing environment, which may include: and acquiring a health check script, and loading a check strategy through the health check script to acquire a strategy check script. The server nodes in the load balancing cluster are interactively health checked multiple times while the policy check script is executed. The interactive health check refers to performing health check by using a probe request carrying response information, where the response information is included in a last response result.
Please refer to fig. 2, which is a schematic diagram of a health check system in a load balancing environment according to an embodiment of the present application; the health check system may include: the system comprises load balancing equipment, an HTTP service cluster and a MySQL service cluster; the HTTP service cluster comprises a server A and a server B, and the MySQL service cluster comprises a server C and a server D. Here, the servers a and B serve as real nodes for providing services at the backend, and when the services provided by the servers a and B depend on the services provided by the servers C and D, the servers a and B and the servers C and D need to be checked for health at the same time. I.e., a health check method is needed to detect services related to both protocols, conventional health check methods cannot perform health check for services of both protocol types, e.g., a and B servers provide HTTP services, and C and D provide database services for a and B. Embodiments that use a health check script to perform multiple interactive health checks in such a load balancing environment are for example: acquiring a health check script (which may be a health check script written by a user for HTTP services and MySQL services), and performing health check on the HTTP services, specifically for example: and performing health check on the HTTP service on the server A, and if the health check result of the HTTP service on the server A is successful, then performing health check on the MySQL service on the server C, wherein the service can be normally provided for the client only if the HTTP service on the server A and the MySQL service on the server C are successful.
In the implementation process, the policy configuration information is analyzed by using the custom rule script to obtain the check policy, and interactive health check is performed on the server nodes in the cluster according to the check policy, so that the condition that a single request is sent to check and detect the health state is avoided. The self-defined rule script can self-define the interactive detection rule, and the strategy configuration information can set various complex scenes of the interactive detection strategy, so that the obtained interactive health examination result can meet the detection requirement of the health examination state under the complex scenes.
Please refer to fig. 3, which is a schematic flow chart illustrating forwarding of data traffic according to a health check result according to an embodiment of the present application; optionally, after the health check result is obtained above, the data traffic may also be forwarded according to the health check result, including:
step S210: the electronic device determines whether the health check result is successful.
Step S220: and if the health check result is successful, the electronic equipment modifies the health state of the server node to be normal.
Step S230: and if the health check result is not successful, the electronic equipment modifies the health state of the server node into abnormal.
The embodiments of the above steps S210 to S230 are, for example: the electronic equipment judges whether the health check result is successful by using an executable program compiled or interpreted by a preset programming language; if the health check result is successful, the health state of the server node is modified to be normal; and if the health check result is not successful, modifying the health state of the server node into an abnormal state. Among others, programming languages that may be used are, for example: C. c + +, Java, BASIC, JavaScript, LISP, Shell, Perl, Ruby, Python, and PHP, among others.
Step S240: the electronic equipment judges whether the health state of the server node is normal.
Step S250: and if the health state of the server node is normal, the electronic equipment acquires the data traffic and forwards the data traffic to the server node.
The embodiments of the above steps S240 to S250 are, for example: the electronic equipment judges whether the health state of the server node is normal or not by using an executable program compiled or interpreted and executed by a preset programming language; and if the health state of the server node is normal, the electronic equipment acquires the data traffic and forwards the data traffic to the server node. It is to be appreciated that if the health of the server node is abnormal, the electronic device avoids forwarding data traffic to the server node. Among others, programming languages that may be used are, for example: C. c + +, Java, BASIC, JavaScript, LISP, Shell, Perl, Ruby, Python, and PHP, among others.
Please refer to fig. 4, which is a schematic structural diagram of a server health check apparatus according to an embodiment of the present application; the embodiment of the present application provides a server health check device 300, including:
a configuration information obtaining module 310, configured to obtain policy configuration information.
And the inspection policy obtaining module 320 is configured to analyze the policy configuration information using the custom rule script to obtain an inspection policy.
The examination result obtaining module 330 is configured to perform multiple interactive health examinations on the server nodes in the cluster according to the examination policy to obtain a health examination result, where the interactive health examinations refer to performing health examinations using probe requests carrying response information, and the response information is included in the last response result.
Optionally, in an embodiment of the present application, the inspection result obtaining module includes:
and the detection request sending module is used for generating a first detection request according to a preset protocol rule and sending the first detection request to the server nodes in the cluster so as to enable the server nodes in the cluster to return a first response result comprising response information.
And the first result judging module is used for judging whether the first response result is a first expected result.
And the first result determining module is used for sending a second detection request carrying response information to the server nodes in the cluster if the first response result is a first expected result, so that the server nodes in the cluster return a second response result corresponding to the second detection request, and determining a health check result according to the second response result.
Optionally, in this embodiment of the present application, the server health check apparatus further includes:
and the checking result negation module is used for determining the health checking result as failure if the first response result is not the first expected result.
Optionally, in an embodiment of the present application, the inspection result determining module includes:
and the second result judging module is used for judging whether the second response result is a second expected result.
And the second result determining module is used for determining that the health examination result is successful if the second response result is a second expected result, and otherwise, determining that the health examination result is failed.
Optionally, in an embodiment of the present application, the inspection result obtaining module includes:
and the examination script obtaining module is used for obtaining the health examination script and loading the examination strategy through the health examination script to obtain the strategy examination script.
And the interactive check module is used for performing interactive health check on the server nodes in the load balancing cluster for a plurality of times when the strategy check script is executed.
Optionally, in this embodiment of the present application, the server health check apparatus further includes:
and the third result judging module is used for judging whether the health examination result is successful.
And the health state modification module is used for modifying the health state of the server node to be normal if the health check result is successful, or modifying the health state of the server node to be abnormal if the health check result is not successful.
Optionally, in this embodiment of the present application, the server health check apparatus further includes:
and the health state judgment module is used for judging whether the health state of the server node is normal or not.
And the data traffic sending module is used for acquiring the data traffic and forwarding the data traffic to the server node if the health state of the server node is normal.
It should be understood that the apparatus corresponds to the above-mentioned embodiment of the server health check method, and can perform the steps related to the above-mentioned embodiment of the method, and the specific functions of the apparatus can be referred to the above description, and the detailed description is appropriately omitted here to avoid redundancy. The device includes at least one software function that can be stored in memory in the form of software or firmware (firmware) or solidified in the Operating System (OS) of the device.
Please refer to fig. 5, which illustrates a schematic structural diagram of an electronic device according to an embodiment of the present application. An electronic device 400 provided in an embodiment of the present application includes: a processor 410 and a memory 420, the memory 420 storing machine-readable instructions executable by the processor 410, the machine-readable instructions when executed by the processor 410 performing the method as above.
Embodiments of the present application also provide a computer-readable storage medium 430, where the computer-readable storage medium 430 stores a computer program, and the computer program is executed by the processor 410 to perform the above method.
The computer-readable storage medium 430 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
In addition, functional modules of the embodiments in the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be 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.
The above description is only an alternative embodiment of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present application, and all the changes or substitutions should be covered by the scope of the embodiments of the present application.

Claims (10)

1.一种服务器健康检查方法,其特征在于,包括:1. A server health check method, characterized in that, comprising: 获取策略配置信息;Get policy configuration information; 使用自定义规则脚本对所述策略配置信息进行解析,获得检查策略;Use a custom rule script to parse the policy configuration information to obtain an inspection policy; 根据所述检查策略对集群中的服务器节点进行多次交互式健康检查,获得健康检查结果,所述交互式健康检查是指使用携带响应信息的探测请求来进行健康检查,所述响应信息是上一次响应结果中包括的。Perform multiple interactive health checks on the server nodes in the cluster according to the check policy, and obtain health check results. The interactive health check refers to using a probe request carrying response information to perform a health check. The response information is the above Included in a response result. 2.根据权利要求1所述的方法,其特征在于,所述根据所述检查策略对集群中的服务器节点进行多次交互式健康检查,获得健康检查结果,包括:2. The method according to claim 1, wherein the performing multiple interactive health checks on the server nodes in the cluster according to the checking strategy to obtain a health check result, comprising: 根据预设协议规则生成第一探测请求,并向所述集群中的服务器节点发送所述第一探测请求,以使所述集群中的服务器节点返回包括响应信息的第一响应结果;Generate a first probe request according to a preset protocol rule, and send the first probe request to the server node in the cluster, so that the server node in the cluster returns a first response result including response information; 判断所述第一响应结果是否为第一预期结果;judging whether the first response result is the first expected result; 若是,则向所述集群中的服务器节点发送携带所述响应信息的第二探测请求,以使所述集群中的服务器节点返回所述第二探测请求对应的第二响应结果,并根据所述第二响应结果确定所述健康检查结果。If yes, send a second probe request carrying the response information to the server node in the cluster, so that the server node in the cluster returns the second response result corresponding to the second probe request, and according to the The second response result determines the health check result. 3.根据权利要求2所述的方法,其特征在于,在所述判断所述第一响应结果是否为第一预期结果之后,还包括:3. The method according to claim 2, wherein after judging whether the first response result is the first expected result, the method further comprises: 若所述第一响应结果不是第一预期结果,则将所述健康检查结果确定为失败。If the first response result is not the first expected result, the health check result is determined to be a failure. 4.根据权利要求2所述的方法,其特征在于,所述根据所述第二响应结果确定所述健康检查结果,包括:4. The method according to claim 2, wherein the determining the health check result according to the second response result comprises: 判断所述第二响应结果是否为第二预期结果;determining whether the second response result is the second expected result; 若是,则确定所述健康检查结果为成功,否则,确定所述健康检查结果为失败。If so, the health check result is determined to be successful, otherwise, the health check result is determined to be failure. 5.根据权利要求1所述的方法,其特征在于,所述根据所述检查策略对集群中的服务器节点进行多次交互式健康检查,包括:5. The method according to claim 1, wherein the performing multiple interactive health checks on the server nodes in the cluster according to the checking strategy, comprising: 获取健康检查脚本,并通过所述健康检查脚本加载所述检查策略,获得策略检查脚本;Obtain a health check script, and load the check policy through the health check script to obtain a policy check script; 在所述策略检查脚本被执行时,对负载均衡集群中的服务器节点进行多次交互式的健康检查。When the policy checking script is executed, multiple interactive health checks are performed on the server nodes in the load balancing cluster. 6.根据权利要求1所述的方法,其特征在于,在所述获得健康检查结果之后,还包括:6. The method according to claim 1, wherein after the obtaining the health check result, the method further comprises: 判断所述健康检查结果是否为成功;determine whether the health check result is successful; 若是,则将所述服务器节点的健康状态修改为正常,否则,将所述服务器节点的健康状态修改为异常。If yes, modify the health state of the server node to normal, otherwise, modify the health state of the server node to abnormal. 7.根据权利要求6所述的方法,其特征在于,还包括:7. The method of claim 6, further comprising: 判断所述服务器节点的健康状态是否为正常;Determine whether the health status of the server node is normal; 若是,则获取数据流量,并向所述服务器节点转发所述数据流量。If so, acquire the data traffic and forward the data traffic to the server node. 8.一种服务器健康检查装置,其特征在于,包括:8. A server health check device, comprising: 配置信息获取模块,用于获取策略配置信息;The configuration information acquisition module is used to acquire the policy configuration information; 检查策略获得模块,用于使用自定义规则脚本对所述策略配置信息进行解析,获得检查策略;An inspection policy obtaining module is used to parse the policy configuration information by using a custom rule script to obtain an inspection policy; 检查结果获得模块,用于根据所述检查策略对集群中的服务器节点进行多次交互式健康检查,获得健康检查结果,所述交互式健康检查是指使用携带响应信息的探测请求来进行健康检查,所述响应信息是上一次响应结果中包括的。The check result obtaining module is configured to perform multiple interactive health checks on the server nodes in the cluster according to the check policy to obtain the health check results, where the interactive health check refers to using the probe request carrying the response information to perform the health check , the response information is included in the last response result. 9.一种电子设备,其特征在于,包括:处理器和存储器,所述存储器存储有所述处理器可执行的机器可读指令,所述机器可读指令被所述处理器执行时执行如权利要求1至7任一所述的方法。9. An electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the instructions are executed as follows: The method of any one of claims 1 to 7. 10.一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至7任一所述的方法。10. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the method according to any one of claims 1 to 7 when the computer program is run by a processor.
CN202111292985.6A 2021-11-03 2021-11-03 Server health check method and device, electronic equipment and storage medium Pending CN113986676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111292985.6A CN113986676A (en) 2021-11-03 2021-11-03 Server health check method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111292985.6A CN113986676A (en) 2021-11-03 2021-11-03 Server health check method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113986676A true CN113986676A (en) 2022-01-28

Family

ID=79746093

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111292985.6A Pending CN113986676A (en) 2021-11-03 2021-11-03 Server health check method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113986676A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115437875A (en) * 2022-08-01 2022-12-06 北京思特奇信息技术股份有限公司 A self-adaptive system health examination method and system, electronic equipment, storage medium
CN115914027A (en) * 2022-12-19 2023-04-04 上海弘积信息科技有限公司 A health check system in a load balancing device
CN115941355A (en) * 2022-12-30 2023-04-07 苏州云融信息技术有限公司 Method for in-band detection of health state of security service
CN116962247A (en) * 2023-08-01 2023-10-27 北京志凌海纳科技有限公司 Active health check method, device, equipment and medium in load balancing system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107094182A (en) * 2017-06-01 2017-08-25 云南电网有限责任公司信息中心 A kind of load-balancing method of use SSO Single Sign Ons system detectio service node health degree
CN108769124A (en) * 2018-04-28 2018-11-06 Oppo广东移动通信有限公司 Application deployment method, device, server and storage medium of PaaS platform
CN110688137A (en) * 2019-09-27 2020-01-14 支付宝(杭州)信息技术有限公司 Application delivery method and device and storage medium
CN110912972A (en) * 2019-11-07 2020-03-24 北京浪潮数据技术有限公司 Service processing method, system, electronic equipment and readable storage medium
CN112579392A (en) * 2020-12-21 2021-03-30 深圳云之家网络有限公司 Application detection method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107094182A (en) * 2017-06-01 2017-08-25 云南电网有限责任公司信息中心 A kind of load-balancing method of use SSO Single Sign Ons system detectio service node health degree
CN108769124A (en) * 2018-04-28 2018-11-06 Oppo广东移动通信有限公司 Application deployment method, device, server and storage medium of PaaS platform
CN110688137A (en) * 2019-09-27 2020-01-14 支付宝(杭州)信息技术有限公司 Application delivery method and device and storage medium
CN110912972A (en) * 2019-11-07 2020-03-24 北京浪潮数据技术有限公司 Service processing method, system, electronic equipment and readable storage medium
CN112579392A (en) * 2020-12-21 2021-03-30 深圳云之家网络有限公司 Application detection method and device, computer equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115437875A (en) * 2022-08-01 2022-12-06 北京思特奇信息技术股份有限公司 A self-adaptive system health examination method and system, electronic equipment, storage medium
CN115914027A (en) * 2022-12-19 2023-04-04 上海弘积信息科技有限公司 A health check system in a load balancing device
CN115914027B (en) * 2022-12-19 2024-11-15 上海弘积信息科技有限公司 Health check system in load balancing equipment
CN115941355A (en) * 2022-12-30 2023-04-07 苏州云融信息技术有限公司 Method for in-band detection of health state of security service
CN116962247A (en) * 2023-08-01 2023-10-27 北京志凌海纳科技有限公司 Active health check method, device, equipment and medium in load balancing system
CN116962247B (en) * 2023-08-01 2024-02-09 北京志凌海纳科技有限公司 Active health check method, device, equipment and medium in load balancing system

Similar Documents

Publication Publication Date Title
CN113986676A (en) Server health check method and device, electronic equipment and storage medium
CN111953770B (en) Route forwarding method and device, route equipment and readable storage medium
JP6726706B2 (en) System and method for detecting anomalous events based on the popularity of convolution
CN108667770B (en) Website vulnerability testing method, server and system
CN115225349B (en) Honeypot flow processing method and device, electronic equipment and storage medium
CN107835228B (en) Instruction processing method and device based on dynamic generalized routing
CN111294347B (en) Safety management method and system for industrial control equipment
CN112818307A (en) User operation processing method, system, device and computer readable storage medium
US20140250334A1 (en) Detection apparatus and detection method
US10970200B2 (en) Test result triage for a failed code validation
CN108319550A (en) A kind of test system and test method
US11055416B2 (en) Detecting vulnerabilities in applications during execution
CN112199281A (en) Data processing method and device, terminal equipment and readable storage medium
CN113010892B (en) Method and device for detecting malicious behavior of small program
CN111399890A (en) Game hot updating method, device and system and electronic equipment
CN109873732B (en) Test method and device for proxy server
CN110727537B (en) Method, device, computer equipment and storage medium for uniformly processing response message
CN116260643A (en) Security testing method, device and equipment for web service of Internet of things
CN114866398B (en) Network fault diagnosis method and device
CN111475400B (en) Verification method of service platform and related equipment
CN111049899B (en) kafka message storage system, method, apparatus, and computer-readable storage medium
CN111107143B (en) Network file transmission detection method, device and system
CN112579473A (en) A test system, method, computer equipment and storage medium
CN109274533B (en) Web service fault positioning device and method based on rule engine
CN115994361B (en) Container vulnerability detection method, system, electronic device and readable storage medium

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