CN113688021B - Load balancing service processing method, device, equipment and readable storage medium - Google Patents
Load balancing service processing method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN113688021B CN113688021B CN202110930460.4A CN202110930460A CN113688021B CN 113688021 B CN113688021 B CN 113688021B CN 202110930460 A CN202110930460 A CN 202110930460A CN 113688021 B CN113688021 B CN 113688021B
- Authority
- CN
- China
- Prior art keywords
- load balancing
- service
- process service
- normal
- balancing service
- 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
- 238000003672 processing method Methods 0.000 title claims abstract description 13
- 238000000034 method Methods 0.000 claims abstract description 260
- 230000008569 process Effects 0.000 claims abstract description 239
- 230000002159 abnormal effect Effects 0.000 claims abstract description 79
- 230000005856 abnormality Effects 0.000 claims abstract description 32
- 238000001514 detection method Methods 0.000 claims abstract description 24
- 238000011084 recovery Methods 0.000 claims abstract description 15
- 238000004590 computer program Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
- G06F11/3433—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment for load management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses a load balancing service processing method, a device, equipment and a readable storage medium, wherein the method comprises the following steps: detecting whether load balancing service is configured in the node; if the load balancing service is configured, judging whether the target process service is normal or not; the target process service is a process service capable of prejudging the availability of the load balancing service; if the target process service is abnormal, determining that the load balancing service in the node is abnormal; restarting the load balancing service to perform abnormal recovery on the load balancing service. According to the technical scheme, the automatic detection and the advanced detection of the load balancing service abnormality are realized, and the load balancing service is automatically restarted when the abnormality exists in the load balancing service, so that the abnormality recovery is automatically carried out on the load balancing service, the load balancing service can be recovered to be normal in time, the availability of the load balancing service is ensured, and the stability and the reliability of the load balancing service are improved.
Description
Technical Field
The present invention relates to the technical field, and in particular, to a method, an apparatus, a device, and a readable storage medium for processing a load balancing service.
Background
Load balancing services are widely used because of the bandwidth of network devices and servers that can be extended, throughput increased, network data processing capacity enhanced, and network flexibility and availability increased. The advanced load balancing service provides domain name resolution service, and distributes IP for users according to a given balancing strategy during resolution, thereby realizing the balancing of client business.
The original advanced load balancing service comprises two process services, namely a pdns (PowerDNS (Domain Name System, domain name System)) process service and a loadbalance process service, wherein the pdns process service is a cross-platform open source DNS service component, and the loadbalance process service is a service for providing domain name resolution and a balancing policy in the advanced load balancing service. The pdns process service receives the domain name request of the client and forwards the domain name request to the load balancing process service, and meanwhile, the pdns service also manages the load balancing process service, and the load balancing process service is started and stopped, and is restarted to resume when the load balancing process service is abnormally exited or analysis is overtime. If the load balancing service is abnormal, the service is not available, but is generally found after the load balancing service is not available, and the normal use of the load balancing service and the running of the cluster are affected.
In summary, how to ensure the availability of the load balancing service to improve the stability and reliability of the load balancing service is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the foregoing, an object of the present application is to provide a method, apparatus, device, and readable storage medium for processing a load balancing service, which are used for guaranteeing availability of the load balancing service, so as to improve stability and reliability of the load balancing service.
In order to achieve the above object, the present application provides the following technical solutions:
a method of load balancing service processing, comprising:
detecting whether load balancing service is configured in the node;
if the load balancing service is configured, judging whether the target process service is normal or not; the target process service is a process service capable of prejudging the availability of the load balancing service;
if the target process service is abnormal, determining that the load balancing service in the node is abnormal;
restarting the load balancing service to perform abnormal recovery on the load balancing service.
Preferably, determining whether the target process service is normal includes:
judging whether the pdns process service and the load balancing process service are included, whether the state of the pdns process service is normal, and whether the state of the load balancing process service is normal;
and if any one of the pdns process service or any one of the load balancing process service, the state abnormality of the pdns process service and the state abnormality of the load balancing process service is determined to be absent, determining that the target process service is abnormal.
Preferably, the determining whether the state of the load balancing process service is normal includes:
judging whether the time difference between the starting time of the load balancing process service and the current time is larger than or equal to a first threshold value or judging whether the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is smaller than or equal to a second threshold value;
and if the time difference between the starting time of the load balancing process service and the current time is larger than or equal to the first threshold value, or the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is smaller than or equal to the second threshold value, determining that the state of the load balancing process service is normal.
Preferably, after determining that there is an abnormality in the load balancing service in the node, the method further includes:
and recording the abnormal reason of the load balancing service in a log.
Preferably, after restarting the load balancing service to perform abnormal recovery on the load balancing service, the method further includes:
returning to the step of judging whether the target process service is normal or not;
counting the number of times that the load balancing service is restarted within a preset time length;
and if the number of times of restarting the load balancing service within the preset time length reaches a third threshold value, a prompt is sent out.
Preferably, before determining whether the node is configured with the load balancing service, the method further includes:
judging whether the cluster is in a normal state or not;
if the cluster is in a normal state, judging whether CTDB service is normal or not;
and if the CTDB service is normal, executing the step of judging whether the node is configured with the load balancing service.
Preferably, detecting whether the node is configured with a load balancing service includes:
and detecting whether the node is configured with a load balancing service or not at regular time.
A load balancing service processing apparatus, comprising:
the detection module is used for judging whether load balancing service is configured in the node or not;
the first judging module is used for judging whether the target process service is normal or not if the load balancing service is configured; the target process service is a process service capable of prejudging the availability of the load balancing service;
the determining module is used for determining that the load balancing service in the node is abnormal if the target process service is abnormal;
and the restarting module is used for restarting the load balancing service so as to recover the load balancing service abnormally.
A load balancing service processing apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of the load balancing service processing method according to any one of the above when executing the computer program.
A readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of the load balancing service processing method according to any one of the preceding claims.
The application provides a method, a device, equipment and a readable storage medium for processing load balancing service, wherein the method comprises the following steps: detecting whether load balancing service is configured in the node; if the load balancing service is configured, judging whether the target process service is normal or not; the target process service is a process service capable of prejudging the availability of the load balancing service; if the target process service is abnormal, determining that the load balancing service in the node is abnormal; restarting the load balancing service to perform abnormal recovery on the load balancing service.
According to the technical scheme, whether the load balancing service in the node is abnormal is determined by detecting whether the load balancing service is configured in the node and judging whether the process service capable of prejudging the availability of the load balancing service in the node is abnormal when the load balancing service is configured in the node is determined, so that automatic detection and advanced detection of the load balancing service abnormality are realized, and the abnormality of the load balancing service is found in time conveniently. When the process service capable of prejudging the availability of the load balancing service is abnormal, the load balancing service is considered to be abnormal, and at the moment, the load balancing service is restarted automatically to restore the load balancing service abnormally, so that the load balancing service can be restored to be normal in time, the availability of the load balancing service is ensured, and the stability and reliability of the load balancing service are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
Fig. 1 is a flowchart of a load balancing service processing method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a load balancing service processing device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a load balancing service processing device according to an embodiment of the present application.
Detailed Description
In the load balancing service, the pdns process service receives the domain name request of the client and forwards the domain name request to the load balancing process service, meanwhile, the pdns service also manages the load balancing process service, including starting and stopping, and the pdns service can also restart the load balancing process service when the load balancing process service is abnormally exited or the analysis is overtime, which is greatly helpful to the reliability of the service. However, if the pdns process service itself is abnormal, the following abnormal scenario may occur: 1) The pdns exception causes that the load balancing process service is not pulled up after exiting; 2) The pdns process service abnormality causes the pdns process service and the load balancing service to exit; 3) The abnormal pdns process service results in abnormal communication between the pdns process service and the load balancing process service, the pdns process service repeatedly restarts the load balancing service process, so that the load balancing service is not available, the load balancing service is not available in all the above abnormal scenes, and the related personnel can only find out that the load balancing service is not available when the related personnel cannot find out that the load balancing service is not available in time because the prior art has no fault detection and recovery function.
Therefore, the application provides a method, a device, equipment and a computer readable storage medium for processing load balancing service, which are used for guaranteeing the usability of the load balancing service so as to improve the stability and reliability of the load balancing service.
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1, which is a flowchart illustrating a method for processing a load balancing service according to an embodiment of the present application, the method for processing a load balancing service according to an embodiment of the present application may include:
s11: detecting whether load balancing service is configured in the node; if yes, go to step S12;
in the application, whether the load balancing service is configured in each node in the cluster can be detected, specifically, whether the load balancing service is configured in the detection node can be detected by checking whether the configuration file (specifically: etc/pdns/loadbalance. Xml) of the load balancing service is configured in the node, if the configuration file of the load balancing service is configured in the node is determined, and if the configuration file of the load balancing service is not configured in the node is determined, so that the convenience of the load balancing service configuration detection is improved.
In addition, when detecting whether the load balancing service is configured in the detection node by checking whether the configuration file of the load balancing service is configured in the node, specifically, whether the domain name and the corresponding IP are configured in the configuration file can be detected, if the domain name and the corresponding IP are configured in the configuration file, the load balancing service is determined to be configured in the node, otherwise, the load balancing service is determined not to be configured in the node, so that the efficiency of the load balancing service configuration detection is improved through the detection of the domain name and the corresponding IP. Specifically, whether a domain name is configured in the configuration file (if the keyword is present, this indicates that the domain name is configured) may be detected by detecting whether a keyword of "domain name" is present, and whether a corresponding IP is configured in the configuration file (if the keyword is present, this indicates that the corresponding IP is configured) may be detected by detecting whether a keyword of "address pool" is present.
In the above detection, if it is determined that the load balancing service is configured in the node, step S12 may be executed, and if it is determined that the load balancing service is not configured in the node, a prompt that the load balancing service is not configured in the current cluster may be issued.
S12: judging whether the target process service is normal or not; the target process service is a process service capable of prejudging the availability of the load balancing service; if not, step S13 is executed, if yes, it is determined that there is no abnormality in the load balancing service in the node, and at this time, the step of executing step S12 may be returned.
S13: and determining that the load balancing service in the node is abnormal.
If the load balancing service is configured in the node, whether the target process service is normal or not can be judged, wherein the target process service specifically refers to a process service capable of prejudging the availability of the load balancing service, namely, the process service capable of representing and prejudging the availability of the load balancing service by the target process service is normal or not, if the target process service is normal, the load balancing service is indicated to be not abnormal, the load balancing service is available, if the target process service is abnormal, the load balancing service is indicated to be abnormal, the situation of unavailability occurs later, namely, the process service capable of prejudging the availability of the load balancing service is judged to be normal or not, and the advanced judgment and the automatic judgment on the unavailability of the load balancing service can be realized.
It should be noted that the process service mentioned herein includes, but is not limited to, pdns service, and load balancing process service.
S14: restarting the load balancing service to perform abnormal recovery on the load balancing service.
If the load balancing service in the node is determined to be abnormal, the load balancing service can be automatically restarted to automatically recover the load balancing service, namely, the load balancing service can be timely recovered to be normal, so that the availability of the load balancing service is ensured, and the stability and reliability of the load balancing service are improved. Because the restart time of the load balancing service is short and the influence of the restart on the load balancing service is small, the load balancing service can be abnormally recovered by executing a load balancing service restart command (balance-manager restart).
According to the technical scheme, whether the load balancing service in the node is abnormal is determined by detecting whether the load balancing service is configured in the node and judging whether the process service capable of prejudging the availability of the load balancing service in the node is abnormal when the load balancing service is configured in the node is determined, so that automatic detection and advanced detection of the load balancing service abnormality are realized, and the abnormality of the load balancing service is found in time conveniently. When the process service capable of prejudging the availability of the load balancing service is abnormal, the load balancing service is considered to be abnormal, and at the moment, the load balancing service is restarted automatically to restore the load balancing service abnormally, so that the load balancing service can be restored to be normal in time, the availability of the load balancing service is ensured, and the stability and reliability of the load balancing service are improved.
The method for processing load balancing service provided in the embodiment of the present application, for determining whether a target process service is normal, may include:
judging whether the pdns process service and the load balancing process service are included, whether the state of the pdns process service is normal, and whether the state of the load balancing process service is normal;
if any one of the pdns process service or the load balancing process service is absent, the state of the pdns process service is abnormal, and the state of the load balancing process service is abnormal, the target process service is abnormal.
In the application, when judging whether the target process service is normal, it may be specifically judged whether the node includes two process services, namely, the pdns process service and the load balancing process service, and whether the state of the pdns process service is normal (specifically, it may be judged by a command of systemctl status pdns) or not, if any one of the pdns process service and the load balancing process service is absent in the node, it is determined that the target process service is abnormal, if the node includes the two process services but the state of the pdns process service is abnormal and/or the state of the load balancing process service is abnormal, it is similarly determined that the target process service is abnormal, that is, if any one of the pdns process service, the state of the pdns process service, and the state of the load balancing process service is abnormal, it is determined that the target process service is abnormal, that the load balancing service is abnormal, that is, if any one of the pdns process service is absent in the node is absent in the state of the pdns process service or the load balancing process service is abnormal, it is determined that the target process service is abnormal.
Through the process, the accuracy of judging whether the target process service is normal or not can be improved, so that the abnormality of the load balancing service can be found out in time, the abnormality can be recovered in time, and the availability, stability and reliability of the load balancing service are improved.
The method for processing the load balancing service provided by the embodiment of the application for judging whether the state of the load balancing process service is normal may include:
judging whether the time difference between the starting time of the load balancing process service and the current time is larger than or equal to a first threshold value or judging whether the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is smaller than or equal to a second threshold value;
if the time difference between the starting time of the load balancing process service and the current time is larger than or equal to a first threshold value, or the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is smaller than or equal to a second threshold value, the state of the load balancing process service is determined to be normal.
In the application, when judging whether the state of the load balancing process service is normal, whether the process service is normal can be determined by judging whether the load balancing process service is frequently pulled up, if the load balancing process service is determined to be frequently pulled up, the state of the load balancing service is determined to be abnormal, and if the load balancing process service is determined to be not frequently pulled up, the state of the load balancing service is determined to be normal.
Specifically, it may be determined whether a time difference between the start time of the load balancing process service and the current time (the time difference mentioned here is an absolute value of the time difference) is greater than or equal to a first threshold, where the current time mentioned here refers to the current time of the cluster, or whether a time difference between the start time of the load balancing process service and the start time of the pdns process service (the time difference mentioned here is an absolute value of the time difference) is less than or equal to a second threshold, where the first threshold may be specifically 5 minutes, and the second threshold may be specifically 2s, and of course, the magnitudes of the first threshold and the second threshold may be adjusted according to the actual situation. It should be noted that, the start time of the load balancing process service refers to a start time corresponding to a start time of the load balancing process service closest to the current time.
If the time difference between the starting time and the current time of the load balancing process service is greater than or equal to a first threshold value, the starting time of the load balancing process service is far from the current time, namely the load balancing process service is not started recently, so that the load balancing process service is not frequently pulled up, and the state of the load balancing process service is normal; if the time difference between the start time of the load balancing process service and the start time of the pdns process service is less than or equal to the second threshold, it indicates that the start time of the load balancing process service and the start time of the pdns process service are less different and are almost started together (under normal conditions, the pdns process service and the load balancing process service are almost started at the same time), so that it indicates that the load balancing process service is not frequently pulled up by the pdns process service and the state of the load balancing process service is normal. That is, if the time difference between the start time of the load balancing process service and the current time is greater than or equal to the first threshold, or if the time difference between the start time of the load balancing process service and the start time of the pdns process service is less than or equal to the second threshold, it indicates that the load balancing process service is not frequently pulled up, and the state thereof is normal.
If the time difference between the starting time of the load balancing process service and the current time is smaller than a first threshold value, and if the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is larger than a second threshold value, the starting time of the load balancing process service is indicated to be relatively short, and the starting time of the load balancing process service is relatively long, namely the load balancing process service is indicated to be frequently pulled up, and at the moment, the state of the load balancing process service is determined to be abnormal.
The method for processing load balancing service provided in the embodiment of the present application may further include, after determining that there is an abnormality in the load balancing service in the node:
the cause of the abnormality of the load balancing service is recorded in a log.
After determining that there is an abnormality in load balancing in the node, determining an abnormality cause of the load balancing service according to the determination of the abnormality cause of the target process service, specifically, if any one of the pdns process service or the load balancing process service is absent, determining the abnormality cause as absent, and determining, specifically, which process service is absent, the abnormality cause as absent, for example: if the pdns process service is absent, determining that the abnormality cause is the absence of the pdns process service; if the state of the pdns process service is abnormal, determining that the abnormal reason is the state abnormality of the pdns process service; if the state of the load balancing process service is abnormal, determining that the reason of the abnormality is the state abnormality of the load balancing process service.
The problem positioning can be conveniently carried out by the related personnel during subsequent log inspection by recording the abnormal reasons, and the processing according to the abnormal reasons is convenient.
The method for processing the load balancing service provided in the embodiment of the present application may further include, after restarting the load balancing service to perform exception recovery on the load balancing service:
returning to the step of executing and judging whether the target process service is normal;
counting the restarting times of the load balancing service in a preset time length;
and if the number of restarting times of the load balancing service in the preset time length reaches a third threshold value, a prompt is sent out.
In the present application, after restarting the load balancing service to perform exception recovery on the load balancing service, the step of determining whether the target process service is normal may be continuously performed, that is, the step S12 is performed in a return manner, and if the load balancing service is restarted subsequently, the number of times that the load balancing service is restarted within a preset time period may be counted, where the preset time period may be set according to the requirement.
Judging whether the restarting times of the load balancing service reach a third threshold value within a preset time length, if so, indicating that the problem occurs in the cluster environment or the compatibility of the cluster and the load balancing, and sending a prompt so that relevant personnel can take corresponding measures according to the prompt in time, and stopping executing the steps of judging whether the process service capable of prejudging the availability of the load balancing service is normal and restarting the load balancing at the same time when sending the prompt so as to avoid influencing the cluster.
The method for processing load balancing service provided in the embodiment of the present application may further include, before determining whether a load balancing service is configured in a node:
judging whether the cluster is in a normal state or not;
if the cluster is in a normal state, judging whether CTDB service is normal;
if the CTDB service is normal, a step of judging whether the load balancing service is configured in the node is performed.
In the present application, considering that the cluster is an environment where the load balancing service is located, before determining whether the node is configured with the load balancing service, whether the cluster is in a normal state (specifically, whether the cluster is checked and determined by an icfs-s command) may be determined first, if the cluster is in an abnormal state, a subsequent flow is not required to be executed, so as to prevent erroneous determination, and facilitate improvement of processing efficiency, and if the cluster is in a normal state, a subsequent flow is performed. Meanwhile, considering the IP-dependent CTDB (a lightweight cluster database implementation) service used by the load balancing service, if the CTDB service is abnormal, even if the node is configured with the load balancing service, the load balancing service cannot be normally used, so after the cluster is determined to be in a normal state, whether the CTDB service is normal (in particular, whether the CTDB service is checked and judged through a CTDB status command) can be judged first, if the CTDB service is abnormal, the subsequent flow is not performed any more, so as to prevent erroneous judgment and facilitate improvement of processing efficiency, and if the CTDB service is normal, the step of judging whether the node is configured with the load balancing service is performed again.
The accuracy and efficiency of the abnormal judgment of the load balancing service can be improved by the mode of judging the cluster and the CBDT service first.
The method for processing load balancing service provided in the embodiments of the present application, detecting whether a node is configured with a load balancing service, may include:
and (5) detecting whether the node is configured with a load balancing service or not at regular time.
When detecting whether the node is configured with the load balancing service, the node can be periodically detected whether the node is configured with the load balancing service, for example, whether the node is configured with the load balancing service can be detected every 5 minutes, so that waste of resources is avoided. Of course, whether the node is configured with the load balancing service can be detected in real time to improve the detection accuracy, or whether the node is configured with the load balancing service can be detected by receiving the detection instruction to meet the requirements of related personnel.
In the timing detection, the implementation may be performed by setting a timing task in advance, and specifically, a timing task corresponding to the load balancing service process may be added to a crontab (daemon of a timing task) of the Linux system, for example: the Crontab use case performs the detection service every 5 minutes: * And (5) starting the detection node with timing cycle to determine whether load balancing service is configured in the detection node, namely, starting the load balancing service processing at timing, exiting after the processing, and automatically starting after the timing task is met.
The embodiment of the application also provides a load balancing service processing device, referring to fig. 2, which shows a schematic structural diagram of the load balancing service processing device provided by the embodiment of the application, and may include:
a detection module 21, configured to determine whether a load balancing service is configured in the node;
a first judging module 22, configured to judge whether the target process service is normal if the load balancing service is configured; the target process service is a process service capable of prejudging the availability of the load balancing service;
a determining module 23, configured to determine that there is an abnormality in the load balancing service in the node if the target process service is abnormal;
and the restarting module 24 is configured to restart the load balancing service to perform abnormal recovery on the load balancing service.
The first determining module 22 may include:
the judging unit is used for judging whether the pdns process service and the load balancing process service are included, whether the state of the pdns process service is normal, and whether the state of the load balancing process service is normal;
and the determining unit is used for determining that the target process service is abnormal if any one of the pdns process service or the load balancing process service is absent, the state of the pdns process service is abnormal and the state of the load balancing process service is abnormal.
The load balancing service processing provided in the embodiment of the present application, the judging unit may include:
the judging subunit is used for judging whether the time difference between the starting time of the load balancing process service and the current time is larger than or equal to a first threshold value or whether the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is smaller than or equal to a second threshold value;
and the determining subunit is used for determining that the state of the load balancing process service is normal if the time difference between the starting time of the load balancing process service and the current time is larger than or equal to a first threshold value or the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is smaller than or equal to a second threshold value.
The load balancing service processing provided in the embodiment of the present application may further include:
and the recording module is used for recording the reason of the abnormality of the load balancing service in the log after determining that the load balancing service in the node is abnormal.
The load balancing service processing provided in the embodiment of the present application may further include:
the return module is used for returning to execute the step of judging whether the target process service is normal or not after restarting the load balancing service to perform abnormal recovery on the load balancing service;
the statistics module is used for counting the restarting times of the load balancing service in a preset time length;
and the prompting module is used for sending a prompt if the number of restarting times of the load balancing service in the preset time length reaches a third threshold value.
The load balancing service processing provided in the embodiment of the present application may further include:
the second judging module is used for judging whether the cluster is in a normal state or not before judging whether the load balancing service is configured in the node or not;
the third judging module is used for judging whether the CTDB service is normal or not if the cluster is in a normal state;
and the execution module is used for executing the step of judging whether the load balancing service is configured in the node if the CTDB service is normal.
The load balancing service processing provided in the embodiment of the present application, the detection module 21 may include:
and the detection unit is used for detecting whether the load balancing service is configured in the node at regular time.
The embodiment of the application also provides a load balancing service processing device, referring to fig. 3, which shows a schematic structural diagram of the load balancing service processing device provided by the embodiment of the application, and may include:
a memory 31 for storing a computer program;
the processor 32, when executing the computer program stored in the memory 31, may implement the following steps:
detecting whether load balancing service is configured in the node; if the load balancing service is configured, judging whether the target process service is normal or not; the target process service is a process service capable of prejudging the availability of the load balancing service; if the target process service is abnormal, determining that the load balancing service in the node is abnormal; restarting the load balancing service to perform abnormal recovery on the load balancing service.
The embodiment of the application also provides a readable storage medium, wherein the readable storage medium stores a computer program, and the computer program can realize the following steps when being executed by a processor:
detecting whether load balancing service is configured in the node; if the load balancing service is configured, judging whether the target process service is normal or not; the target process service is a process service capable of prejudging the availability of the load balancing service; if the target process service is abnormal, determining that the load balancing service in the node is abnormal; restarting the load balancing service to perform abnormal recovery on the load balancing service.
The readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The description of the relevant parts in the load balancing service processing device, the device and the computer readable storage medium provided in the embodiments of the present application may refer to the detailed description of the corresponding parts in the load balancing service processing method provided in the embodiments of the present application, which is not repeated here.
It is noted that 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. Moreover, 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 is inherent to. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. In addition, the parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of the corresponding technical solutions in the prior art, are not described in detail, so that redundant descriptions are avoided.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (8)
1. A method for processing load balancing service, comprising:
detecting whether load balancing service is configured in the node;
if the load balancing service is configured, judging whether the target process service is normal or not; the target process service is a process service capable of prejudging the availability of the load balancing service; wherein, judging whether the target process service is normal, includes: judging whether the pdns process service and the load balancing process service are included, whether the state of the pdns process service is normal, and whether the state of the load balancing process service is normal; if any one of the pdns process service or any one of the load balancing process service, the state abnormality of the pdns process service and the state abnormality of the load balancing process service is determined to be absent, determining that the target process service is abnormal;
wherein, judging whether the state of the load balancing process service is normal comprises: judging whether the time difference between the starting time of the load balancing process service and the current time is larger than or equal to a first threshold value or judging whether the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is smaller than or equal to a second threshold value; if the time difference between the starting time of the load balancing process service and the current time is greater than or equal to the first threshold value, or the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is less than or equal to the second threshold value, determining that the state of the load balancing process service is normal
If the target process service is abnormal, determining that the load balancing service in the node is abnormal;
restarting the load balancing service to perform abnormal recovery on the load balancing service.
2. The load balancing service processing method according to claim 1, further comprising, after determining that there is an abnormality in the load balancing service in the node:
and recording the abnormal reason of the load balancing service in a log.
3. The load balancing service processing method according to claim 1, further comprising, after restarting the load balancing service to perform an abnormal recovery for the load balancing service:
returning to the step of judging whether the target process service is normal or not;
counting the number of times that the load balancing service is restarted within a preset time length;
and if the number of times of restarting the load balancing service within the preset time length reaches a third threshold value, a prompt is sent out.
4. The load balancing service processing method according to claim 1, further comprising, before determining whether the load balancing service is configured in the node:
judging whether the cluster is in a normal state or not;
if the cluster is in a normal state, judging whether CTDB service is normal or not;
and if the CTDB service is normal, executing the step of judging whether the node is configured with the load balancing service.
5. The load balancing service processing method according to claim 1, wherein detecting whether the load balancing service is configured in the node comprises:
and detecting whether the node is configured with a load balancing service or not at regular time.
6. A load balancing service processing apparatus, comprising:
the detection module is used for judging whether load balancing service is configured in the node or not;
the first judging module is used for judging whether the target process service is normal or not if the load balancing service is configured; the target process service is a process service capable of prejudging the availability of the load balancing service;
wherein, the first judging module includes:
the judging unit is used for judging whether the pdns process service and the load balancing process service are included, whether the state of the pdns process service is normal, and whether the state of the load balancing process service is normal;
the determining unit is used for determining that the target process service is abnormal if any one of the pdns process service or the load balancing process service, the state abnormality of the pdns process service and the state abnormality of the load balancing process service is determined to be absent;
wherein the judging unit includes:
the judging subunit is used for judging whether the time difference between the starting time of the load balancing process service and the current time is larger than or equal to a first threshold value or whether the time difference between the starting time of the load balancing process service and the starting time of the pdns process service is smaller than or equal to a second threshold value;
a determining subunit, configured to determine that the state of the load balancing process service is normal if the time difference between the start time of the load balancing process service and the current time is greater than or equal to a first threshold, or if the time difference between the start time of the load balancing process service and the start time of the pdns process service is less than or equal to a second threshold;
the determining module is used for determining that the load balancing service in the node is abnormal if the target process service is abnormal;
and the restarting module is used for restarting the load balancing service so as to recover the load balancing service abnormally.
7. A load balancing service processing apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the load balancing service processing method according to any one of claims 1 to 5 when executing the computer program.
8. A readable storage medium, characterized in that the readable storage medium has stored therein a computer program which, when executed by a processor, implements the steps of the load balancing service processing method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110930460.4A CN113688021B (en) | 2021-08-13 | 2021-08-13 | Load balancing service processing method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110930460.4A CN113688021B (en) | 2021-08-13 | 2021-08-13 | Load balancing service processing method, device, equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113688021A CN113688021A (en) | 2021-11-23 |
CN113688021B true CN113688021B (en) | 2023-12-22 |
Family
ID=78579821
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110930460.4A Active CN113688021B (en) | 2021-08-13 | 2021-08-13 | Load balancing service processing method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113688021B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114710503A (en) * | 2022-04-21 | 2022-07-05 | 思必驰科技股份有限公司 | Service scheduling method, electronic device and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106330610A (en) * | 2016-08-29 | 2017-01-11 | 浪潮(北京)电子信息产业有限公司 | Load balance processing system and method |
CN107766152A (en) * | 2017-10-19 | 2018-03-06 | 郑州云海信息技术有限公司 | Management method, system, device and the readable storage medium storing program for executing of load balancing service |
CN110162405A (en) * | 2019-05-31 | 2019-08-23 | 福建南威软件有限公司 | A kind of method and system of automated service discovery and load balancing |
CN111475302A (en) * | 2020-04-08 | 2020-07-31 | 安徽洲峰电子科技有限公司 | Method for balancing service load in process based on content |
CN112929416A (en) * | 2021-01-22 | 2021-06-08 | 苏州浪潮智能科技有限公司 | Load balancing method, device, equipment and storage medium of domain name system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8775628B2 (en) * | 2011-08-31 | 2014-07-08 | Metaswitch Networks Ltd. | Load balancing for SIP services |
CN106797405B (en) * | 2016-12-14 | 2020-01-10 | 华为技术有限公司 | Distributed load balancing system, health check method and service node |
-
2021
- 2021-08-13 CN CN202110930460.4A patent/CN113688021B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106330610A (en) * | 2016-08-29 | 2017-01-11 | 浪潮(北京)电子信息产业有限公司 | Load balance processing system and method |
CN107766152A (en) * | 2017-10-19 | 2018-03-06 | 郑州云海信息技术有限公司 | Management method, system, device and the readable storage medium storing program for executing of load balancing service |
CN110162405A (en) * | 2019-05-31 | 2019-08-23 | 福建南威软件有限公司 | A kind of method and system of automated service discovery and load balancing |
CN111475302A (en) * | 2020-04-08 | 2020-07-31 | 安徽洲峰电子科技有限公司 | Method for balancing service load in process based on content |
CN112929416A (en) * | 2021-01-22 | 2021-06-08 | 苏州浪潮智能科技有限公司 | Load balancing method, device, equipment and storage medium of domain name system |
Non-Patent Citations (1)
Title |
---|
基于开源软件的DNS查询日志分析系统;郑海山;厦门大学学报(自然科学版);第56卷(第2期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113688021A (en) | 2021-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110515820B (en) | Server fault maintenance method and device, server and storage medium | |
CN106856489B (en) | Service node switching method and device of distributed storage system | |
CN106533805B (en) | Micro-service request processing method, micro-service controller and micro-service architecture | |
US9189348B2 (en) | High availability database management system and database management method using same | |
US20080288812A1 (en) | Cluster system and an error recovery method thereof | |
CN111880906A (en) | Virtual machine high-availability management method, system and storage medium | |
CN108600284B (en) | Ceph-based virtual machine high-availability implementation method and system | |
CN113688021B (en) | Load balancing service processing method, device, equipment and readable storage medium | |
CN111324423A (en) | Method and device for monitoring processes in container, storage medium and computer equipment | |
CN113347037B (en) | Data center access method and device | |
CN111478792B (en) | Cutover information processing method, system and device | |
CN109586989B (en) | State checking method, device and cluster system | |
CN113722181A (en) | BMC process monitoring method, device, system and medium of server | |
CN112650624B (en) | Cluster upgrading method, device, equipment and computer readable storage medium | |
CN106911508B (en) | DNS configuration recovery method and device | |
CN115314361B (en) | Server cluster management method and related components thereof | |
CN108427627A (en) | The method and device and electronic equipment of statistical system stability | |
CN112069032A (en) | Availability detection method, system and related device for virtual machine | |
CN109493230B (en) | Supplementary recording method and device for unilateral transaction | |
CN111181777A (en) | Service degradation method, device, computer equipment and storage medium | |
CN113821414B (en) | Server protection method and device, electronic equipment and storage medium | |
CN113112023B (en) | Inference service management method and device of AIStation inference platform | |
CN110442467B (en) | Data sharing method, terminal and computer readable storage medium | |
CN116149932A (en) | Method and device for detecting software system state and electronic equipment | |
CN113918407A (en) | Method and device for managing service process 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |