CN115834668A - Cluster node control method, device, equipment, storage medium and program product - Google Patents

Cluster node control method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN115834668A
CN115834668A CN202211394794.5A CN202211394794A CN115834668A CN 115834668 A CN115834668 A CN 115834668A CN 202211394794 A CN202211394794 A CN 202211394794A CN 115834668 A CN115834668 A CN 115834668A
Authority
CN
China
Prior art keywords
service
service registration
registration center
cluster
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211394794.5A
Other languages
Chinese (zh)
Other versions
CN115834668B (en
Inventor
凌晨
顾欣
王鹏培
刘成锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202211394794.5A priority Critical patent/CN115834668B/en
Publication of CN115834668A publication Critical patent/CN115834668A/en
Application granted granted Critical
Publication of CN115834668B publication Critical patent/CN115834668B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Hardware Redundancy (AREA)

Abstract

The disclosure provides a cluster node control method, relates to the technical field of cloud computing, and can be applied to the technical field of financial science and technology. The method is applied to a service registration center cluster, the service registration center cluster at least comprises a first service registration center node and a second service registration center node, and push switches are arranged on the first service registration center node and the second registration center node, and the control method comprises the following steps: after determining that the service registration center cluster has a fault, closing the push switch; and responding to a service subscription request initiated by a service consumer, and returning service information to the service consumer according to the state of the push switch. The present disclosure also provides a cluster node control apparatus, device, storage medium, and program product.

Description

Cluster node control method, device, equipment, storage medium and program product
Technical Field
The present disclosure relates to the field of cloud computing technologies, and in particular, to the field of micro service cluster technologies, and in particular, to a cluster node control method, apparatus, device, storage medium, and program product.
Background
Eureka is an open source framework in Netfix, and is used for service registration management as Zookeeper and Consul. Eureka is an AP architecture, highlighting usability. In practical production, network faults such as network jitter and the like still exist generally, and even the problem of 'split brain' occurs in severe cases. When a split brain problem occurs, a service consumer queries a provider list from the Eureka Server, and obtains an empty (i.e. no available provider) or incomplete (or not up-to-date) provider list (only obtaining providers in the same region, but automatically taking off the line of service providers in different regions due to expiration). Thereby affecting the normal invocation of the service.
In the related art, when the service provider list acquired by the service consumer is not complete or up-to-date, the final successful invocation of the service can be guaranteed as much as possible through a retry mechanism. Some service calls are not suitable for using a retry mechanism, especially in some idempotent scenarios, and in the case of an empty provider list, even if a retry mechanism is used, the service cannot be successfully called.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a cluster node control method, apparatus, device, medium, and program product that improve service invocation availability.
According to a first aspect of the present disclosure, a cluster node control method is provided, which is applied to a service registry cluster, where the service registry cluster at least includes a first service registry node and a second service registry node, and both the first service registry node and the second service registry node are provided with push switches, and the control method includes:
after determining that the service registration center cluster has a fault, closing the push switch;
and responding to a service subscription request initiated by a service consumer, and returning service information to the service consumer according to the state of the push switch.
According to an embodiment of the present disclosure, the returning service information to the service consumer according to the state of the push switch includes:
when the pushing switch is determined to be in the off state, returning a specific state code to the service consuming end, wherein the specific state code is used for representing the health state of the service registration center cluster; and
and when the state of the push switch is determined to be the starting state, returning a current service registration list to the service consumption end.
According to an embodiment of the present disclosure, the determining that the service registry cluster fails includes:
acquiring service registration information of a first service registration center node and service registration information of a second service center node in real time; and
and when the difference value of the service registration number between the service registration center nodes is larger than a preset threshold value, determining that the service registration center cluster has a fault.
According to an embodiment of the present disclosure, further comprising:
and after determining that the service registration center cluster fault is eliminated, opening the push switch.
A second aspect of the present disclosure provides an update method for a service registration list, applied to a service consumer, including:
sending a service subscription request to a service registration center node;
receiving service information returned by the service registration center node;
when the service information is determined to be the specific state code, using a service registration list of a local cache to call the service;
and when the service information is determined to be the current service registration list of the service registration center node, updating the locally cached service registration list according to the current service registration list.
A third aspect of the present disclosure provides a cluster node control apparatus, which is disposed in a service registry cluster, where the service registry cluster at least includes a first service registry node and a second service registry node, and both the first service registry node and the second service registry node are provided with push switches, and the apparatus includes:
the push switch control module is used for closing the push switch after determining that the service registration center cluster has a fault;
and the service information returning module is used for responding to a service subscription request initiated by a service consumption end and returning service information to the service consumption end according to the state of the push switch.
According to the embodiment of the disclosure, the device further comprises a fault judgment module.
And the fault judgment module is used for judging whether the current cluster has a fault.
According to the embodiment of the disclosure, the fault judgment module comprises a service information acquisition submodule and a fault determination submodule.
The service information acquisition sub-module is used for acquiring service registration information of a first service registration center node and service registration information of a second service center node in real time;
and the fault determining submodule is used for determining that the service registration center cluster has faults when the service registration number difference between the service registration center nodes is larger than a preset threshold value.
According to an embodiment of the present disclosure, the service information returning module includes a first determination submodule and a second determination submodule.
The first determining submodule is used for returning a specific state code to the service consuming terminal when the state of the push switch is determined to be the closed state, and the specific state code is used for representing the health state of the service registration center cluster.
And the second determining submodule is used for returning a current service registration list to the service consuming side when the state of the push switch is determined to be the starting state.
A fourth aspect of the present disclosure provides an updating apparatus for a service registration list, which is disposed at a service consumer, the updating apparatus including:
the service subscription module is used for sending a service subscription request to the service registration center node;
the receiving module is used for receiving the service information returned by the service registration center node;
the first determining module is used for calling the service by using a service registration list cached locally when the service information is determined to be a specific state code;
and the second determining module is used for updating the locally cached service registration list according to the current service registration list when the service information is determined to be the current service registration list of the service registration center node.
A fifth aspect of the present disclosure provides an electronic device, comprising: one or more processors; memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the above-described method.
A sixth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described method.
A seventh aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above method.
According to the cluster node control method provided by the embodiment of the disclosure, by adding the registration center cluster subscription push switch mechanism, the service consumer senses the health state of the registration center cluster by controlling the service subscription request to return a specific state code during a fault period, so as to judge whether the provider list of the local cache needs to be updated, ensure the normal calling of the service during the fault period, realize simplicity and low implementation cost, and reduce the influence caused by the fault of the registration center cluster.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
FIG. 1 is a schematic flow diagram illustrating service invocation under a microservice architecture;
FIG. 2 schematically illustrates an application scenario diagram of a cluster node control method, apparatus, device, medium and program product according to embodiments of the disclosure;
fig. 3 schematically shows a system architecture diagram of a cluster node control method provided according to an embodiment of the present disclosure;
fig. 4 schematically shows a flowchart of a cluster node control method provided according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow chart of a method for updating a service registration list provided according to an embodiment of the present disclosure;
fig. 6 schematically shows a block diagram of a cluster node control apparatus according to an embodiment of the present disclosure;
fig. 7 is a block diagram schematically illustrating a structure of an apparatus for updating a service registration list according to an embodiment of the present disclosure;
fig. 8 schematically shows a block diagram of an electronic device adapted to implement a cluster node control method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B, and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B, and C" would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and/or A, B, and C together, etc.).
Terms appearing in the embodiments of the present disclosure are explained first:
a service provider: and the microservice provider provides microservice applications.
The service consumer: invoking the microservice for consumption of the service.
The CAP principle: the term CAP theorem refers to Consistency (Consistency), availability (Availability), and Partition tolerance (Partition tolerance) in a distributed system. The CAP principle means that at most, these three elements can be realized at two points at the same time, and the three elements cannot be considered at the same time.
Eureka Server: the Eureka registration center provides functions of service registration, service information acquisition, service management, information synchronization and the like.
Eureka Client: a packaged client module for simplifying interaction with the Eureka registry.
Splitting the brain: when different parts of a cluster consider themselves to be active at the same time, the phenomenon can be called split brain symptom, and in the Eureka cluster, when the network is severely jittered, data of nodes of the Eureka cluster are inconsistent, and the split brain problem is generated.
In order to better understand the technical problems of the present disclosure, the technical problems in the related art will be explained below with reference to fig. 1. Fig. 1 schematically shows a flow diagram of service invocation under a micro-service architecture.
As shown in fig. 1, under the micro service architecture, there are three main roles: the system comprises a service provider, a service client (namely a consumer) and a service registration center, wherein the service provider is used for providing service, registering self service to the service registration center according to configuration information in a service release file when the service provider is started, and periodically sending a heartbeat report survival state to the service registration center; the service client is used for calling the service, subscribing the service to the service registration center according to the information configured in the service reference file when the service client is started, caching a service node list returned by the service registration center in a local memory, and establishing connection with a service provider; when the service provider node is changed, the service registration center is changed synchronously, the service client side refreshes the service node list cached in the local memory after sensing, and the service client side selects one service provider from the service node list cached in the local memory based on a load balancing algorithm to initiate calling.
In the microservice architecture, the service registry is an indispensable part of service discovery, and as a network address and database storing network instances, the service registry should be highly available and keep data up-to-date. Currently, netflix Eureka is a good example of a service registry, and Eureka is a service discovery framework developed by Netflix, is a REST-based service, and is mainly used for positioning middle-layer services running in an AWS domain so as to achieve the purposes of load balancing and middle-layer service failover. The SpringCloud integrates it in its sub-project spring-cloud-netflix to implement the service discovery function of SpringCloud.
Eureka contains two components: the system comprises an Eureka Server and an Eureka Client, wherein the Eureka Server provides service registration service, each node is registered in the Eureka Server after being started, and thus the service registry in the Eureka Server stores the information of all available service nodes, and the information of the service nodes can be visually seen in an interface; the Eureka Client is a java Client for simplifying the interaction with the Eureka Server, and is also a built-in load balancer using round-robin load algorithm. After the application starts, a heartbeat is sent to the Eureka Server for a default period of 30 seconds, and if the Eureka Server does not receive a heartbeat for a certain node for a plurality of heartbeat periods, the Eureka Server removes the service node from the service registry (for a default of 90 seconds). The data synchronization between the Eureka servers is completed in a copying mode, and the Eureka also provides a client caching mechanism, so that even if all the Eureka servers are down, the client can still consume APIs of other services by using the information in the cache. Therefore, the Eureka ensures high availability, flexibility and scalability of the system through heartbeat check, client cache and other mechanisms.
In practical production, network faults such as network jitter and the like are ubiquitous, and even the problem of split brain occurs in severe cases. The split brain problem refers to that different parts in a cluster consider themselves to be active at the same time, when network jitter occurs, the Eureka Server does not receive the heartbeat of a certain node in a plurality of heartbeat periods, the Eureka Server removes the service node from the service registry, but actually the service node is available, so that the problem that the service node is actually available and is still offline when data synchronization is performed between the Eureka servers occurs, and service calling of a service consumer is further influenced, and user experience is influenced.
Based on the above technical problem, an embodiment of the present disclosure provides a cluster node control method, which is applied to a service registry cluster, where the service registry cluster includes a first service registry node and a second service registry node, and both the first service registry node and the second service registry node are provided with push switches, and the control method includes: after determining that the service registration center cluster has a fault, closing the push switch; and responding to a service subscription request initiated by a service consumer, and returning service information to the service consumer according to the state of the push switch.
Fig. 2 schematically illustrates an application scenario diagram of a cluster node control method, apparatus, device, medium, and program product according to embodiments of the present disclosure.
As shown in fig. 2, the application scenario 100 according to this embodiment may include a service invocation scenario. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a cluster node server, which provides a service registration service, and returns service registration information for a service subscription request initiated by a service consumer through an application server, for example, in response to the service subscription request initiated by the service consumer, the cluster node server returns corresponding message information to the service consumer according to a state of a subscription switch, and the service consumer maintains a service registration list according to the message information.
It should be noted that the cluster node control method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the cluster node control apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The cluster node control method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the cluster node control apparatus provided in the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, and 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the cluster node control method and apparatus determined in the embodiments of the present disclosure may be used in the field of cloud computing technology, financial technology, or any field other than financial field, and the application fields of the cluster node control method and apparatus determined in the embodiments of the present disclosure are not limited.
Fig. 3 schematically shows a system architecture diagram of a cluster node control method provided according to an embodiment of the present disclosure. The system architecture workflow of the embodiment of the present disclosure is explained with reference to fig. 3, and as shown in fig. 3, the Eureka registration center cluster is composed of a Eureka Server1, a Eureka Server2, and a Eureka Server3, wherein one Service Provider1 completes Service registration with the Eureka Server1 and maintains a heartbeat with the Eureka Server1 to continue Service provisioning. One of the Service consumers Service Consumer1 initiates a Service subscription to the Eureka Server3 to obtain a provider list and invokes a Service. When a series of faults (possibly network reasons or other reasons) which possibly cause data inconsistency of the providers in the registration center cluster occur, a push switch of the Eureka registration center cluster is turned off, and after the push switch is turned off, request mechanisms such as registration, heartbeat continuity, offline logout and the like between the service provider and the registration center are kept unchanged. After the push switch is turned off, when the Service Consumer sends a Service subscription request to the Eureka Server3 to obtain the list of Service providers, the Eureka Server3 will return a specific HTTP status code (e.g. 5 XX) to the Service provider 1. When the Service Consumer Consumer1 receives the specific state code returned by the Eureka Server3, the Consumer will not update the locally cached Service provider list, and the originally cached provider list is still used when the Service is called, so as to ensure that the Service calling is not influenced. And when the fault is completely recovered, namely the data of the providers in the registration center cluster are consistent, the push switch of the registration center cluster is turned on, and the service subscription request of the consumer returns normally.
The cluster node control method according to the embodiment of the present disclosure will be described in detail below with reference to fig. 4 based on the scenario described in fig. 2 and the system architecture of fig. 3.
Fig. 4 schematically shows a flowchart of a cluster node control method provided according to an embodiment of the present disclosure. As shown in fig. 4, the cluster node control method of this embodiment includes operations S210 and S220, and the method is applied to a service registry cluster, and may be executed by a Server or other computing device, for example, may be executed by the Eureka registry cluster shown in fig. 3, where the Eureka cluster includes at least two service registry nodes, that is, a first service registry node and a second service registry node, and each of the first service registry node and the second service registry node is provided with a push switch, and for a service subscription request initiated by a service consumer, information returned by the Eureka Server is related to a state of the push switch.
In operation S210, after it is determined that the service registry cluster has a fault, the push switch is turned off.
According to the embodiment of the disclosure, service registration information of a first service registration center node and service registration information of a second service center node are obtained in real time; and when the difference value of the service registration number between the service registration center nodes is larger than a preset threshold value, determining that the service registration center cluster has a fault.
In an example, the health status of the cluster may be monitored by acquiring service registration information of each service registration center node in real time, where the service registration information may be, for example, the number of services registered in a current node, and when long-time network jitter occurs, if a difference between service registration numbers of the service registration center nodes is greater than a preset threshold, and data between the representative nodes is extremely inconsistent at this time, it is determined that the service registration center cluster has a fault. And after determining that the service registry cluster sends a fault, closing a push switch arranged on the registry node.
In operation S220, in response to a service subscription request initiated by a service consumer, service information is returned to the service consumer according to the state of the push switch.
According to the embodiment of the disclosure, when the state of the push switch is determined to be the off state, returning a specific state code to the service consumer, wherein the specific state code is used for representing the health state of the service registration center cluster; and when the state of the push switch is determined to be the starting state, returning a current service registration list to the service consumption end.
In one example, when a service subscription request initiated by a service consumer is received, service information is returned according to a current state of a push switch, specifically, when it is determined that the state of the push switch is an off state, it is characterized that a current cluster fails, a service registration list of a service registration center node may be empty or missing, and in order to ensure normal call of the service consumer, a specific state code is returned to the service consumer, where the specific state code may be an HTTP state code, or may be a specific message, so that the service consumer perceives a health state of the registration center cluster. And when the state of the push switch is determined to be an open state, representing that the current cluster is normal, and returning a service registration list to the service consumption end.
And the push switch is opened after the service registration center cluster is determined to be in fault elimination, namely, after the data of the providers in the registration center cluster are consistent. The push switch can be opened and closed manually by operation and maintenance personnel in emergency, or automatically controlled by some monitoring mechanisms.
According to the cluster node control method provided by the embodiment of the disclosure, by adding the registration center cluster subscription push switch mechanism, the service consumer senses the health state of the registration center cluster by controlling the service subscription request to return a specific state code during a fault period, so as to judge whether the provider list of the local cache needs to be updated, ensure the normal calling of the service during the fault period, realize simplicity and low implementation cost, and reduce the influence caused by the fault of the registration center cluster.
A method for updating the service registration list of the service consumer in the embodiment of the present disclosure will be described below with reference to fig. 5. Fig. 5 schematically shows a flowchart of an update method of a service registration list provided according to an embodiment of the present disclosure. The method for updating the service registration list provided by the embodiment of the disclosure is applied to a service consumer. As shown in fig. 5, operations S310 to S340 are included.
In operation S310, a service subscription request is transmitted to the service registry node.
In operation S320, service information returned by the service registry node is received.
In operation S330, when it is determined that the service information is the specific status code, a service call is made using a locally cached service registration list.
In operation S340, when it is determined that the service information is the current service registration list of the service registry node, the service registration list cached locally is updated according to the current service registration list.
In one example, each service consumption end locally maintains a service registration list, calls services according to the service registration list, periodically updates the service registration list, periodically sends a service subscription request to a service registration center node to update the service registration list, receives service information returned by the service registration center node, and updates the locally cached service registration list according to the received service information. Specifically, when it is determined that the service information is a specific status code, it indicates that the current cluster fails, and the consumer will not perform an update operation on the locally cached service provider list, and still use the originally cached provider list when performing service invocation, thereby ensuring that the service invocation is not affected. And when the service information is determined to be the current service registration list of the service registration center node, representing that the current cluster is normal, and updating the service registration list of the local cache according to the current service registration list.
Based on the cluster node control method, the disclosure also provides a cluster node control device. The apparatus will be described in detail below with reference to fig. 6.
Fig. 6 schematically shows a block diagram of a cluster node control apparatus according to an embodiment of the present disclosure.
As shown in fig. 6, the cluster node control apparatus 600 of this embodiment includes a push switch control module 610 and a service information return module 620.
The push switch control module 610 is configured to close the push switch after determining that the service registration center cluster has a fault. In an embodiment, the push switch control module 610 may be configured to perform the operation S210 described above, which is not described herein again.
The service information returning module 620 is configured to, in response to a service subscription request initiated by a service consumer, return service information to the service consumer according to the state of the push switch. In an embodiment, the service information returning module 620 may be configured to perform the operation S220 described above, which is not described herein again.
According to the embodiment of the disclosure, the device further comprises a fault judgment module.
And the fault judgment module is used for judging whether the current cluster has a fault.
According to the embodiment of the disclosure, the fault judgment module comprises a service information acquisition submodule and a fault determination submodule.
And the service information acquisition submodule is used for acquiring the service registration information of the first service registration center node and the service registration information of the second service center node in real time.
And the fault determining submodule is used for determining that the service registration center cluster has faults when the service registration number difference between the service registration center nodes is larger than a preset threshold value.
According to an embodiment of the present disclosure, the service information returning module includes a first determination submodule and a second determination submodule.
The first determining submodule is used for returning a specific state code to the service consuming terminal when the state of the push switch is determined to be the closed state, and the specific state code is used for representing the health state of the service registration center cluster.
And the second determining submodule is used for returning a current service registration list to the service consuming side when the state of the push switch is determined to be the starting state.
According to an embodiment of the present disclosure, any plurality of modules in the push switch control module 610 and the service information return module 620 may be combined and implemented in one module, or any one of the modules may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the push switch control module 610 and the service information return module 620 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware. Alternatively, at least one of the push switch control module 610 and the service information return module 620 may be implemented at least in part as a computer program module that, when executed, may perform corresponding functions.
Based on the method for updating the service registration list, the disclosure also provides a device for updating the service registration list. The apparatus will be described in detail below with reference to fig. 7.
Fig. 7 schematically shows a block diagram of a device for updating a service registration list according to an embodiment of the present disclosure.
As shown in fig. 7, the apparatus 700 for updating a service registration list of this embodiment includes a service subscription module 710, a receiving module 720, a first determining module 730, and a second determining module 740.
The service subscription module 710 is configured to send a service subscription request to the service registry node. In an embodiment, the service subscription module 710 may be configured to perform the operation S310 described above, which is not described herein again.
The receiving module 720 is configured to receive the service information returned by the service registry node, and in an embodiment, the receiving module 720 may be configured to perform the operation S320 described above, which is not described herein again.
The first determining module 730 is configured to, when it is determined that the service information is a specific status code, use a locally cached service registration list for service invocation. In an embodiment, the first determining module 730 may be configured to perform the operation S330 described above, which is not described herein again.
The second determining module 740 is configured to update the locally cached service registration list according to the current service registration list when it is determined that the service information is the current service registration list of the service registry node. In an embodiment, the second determining module 740 may be configured to perform the operation S340 described above, which is not described herein again.
According to an embodiment of the present disclosure, any plurality of the service subscription module 710, the receiving module 720, the first determining module 730, and the second determining module 740 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the service subscription module 710, the receiving module 720, the first determining module 730, and the second determining module 740 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the service subscription module 710, the receiving module 720, the first determining module 730 and the second determining module 740 may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
Fig. 8 schematically shows a block diagram of an electronic device adapted to implement a cluster node control method according to an embodiment of the present disclosure.
As shown in fig. 8, an electronic apparatus 900 according to an embodiment of the present disclosure includes a processor 901 which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. Processor 901 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 901 may also include on-board memory for caching purposes. The processor 901 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the electronic apparatus 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The processor 901 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the programs may also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 900 may also include input/output (I/O) interface 905, input/output (I/O) interface 905 also connected to bus 904, according to an embodiment of the present disclosure. The electronic device 900 may also include one or more of the following components connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer readable storage medium carries one or more programs which, when executed, implement a method for decision tree based message sorting according to an embodiment of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 902 and/or the RAM 903 described above and/or one or more memories other than the ROM 902 and the RAM 903.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the cluster node control method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 901. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted in the form of a signal over a network medium, distributed, and downloaded and installed via the communication section 909 and/or installed from the removable medium 911. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 909 and/or installed from the removable medium 911. The computer program, when executed by the processor 901, performs the above-described functions defined in the system of the embodiment of the present disclosure. The above described systems, devices, apparatuses, modules, units, etc. may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A cluster node control method is applied to a service registration center cluster, the service registration center cluster at least comprises a first service registration center node and a second service registration center node, and both the first service registration center node and the second registration center node are provided with push switches, and the control method is characterized by comprising the following steps:
after determining that the service registration center cluster has a fault, closing the push switch;
and responding to a service subscription request initiated by a service consumer, and returning service information to the service consumer according to the state of the push switch.
2. The control method of claim 1, wherein the returning service information to the service consumer according to the state of the push switch comprises:
when the pushing switch is determined to be in the off state, returning a specific state code to the service consuming end, wherein the specific state code is used for representing the health state of the service registration center cluster; and
and when the state of the push switch is determined to be the starting state, returning a current service registration list to the service consumption end.
3. The control method of claim 1, wherein the determining that the service registry cluster is down comprises:
acquiring service registration information of a first service registration center node and service registration information of a second service center node in real time; and
and when the difference value of the service registration number between the service registration center nodes is larger than a preset threshold value, determining that the service registration center cluster has a fault.
4. The control method according to any one of claims 1 to 3, characterized by further comprising:
and after determining that the service registration center cluster fault is eliminated, opening the push switch.
5. A method for updating a service registration list is applied to a service consumer, and is characterized in that the method comprises the following steps:
sending a service subscription request to a service registration center node;
receiving service information returned by the service registration center node;
when the service information is determined to be a specific state code, using a service registration list cached locally to call the service;
and when the service information is determined to be the current service registration list of the service registration center node, updating the locally cached service registration list according to the current service registration list.
6. A cluster node control device is arranged in a service registration center cluster, the service registration center cluster at least comprises a first service registration center node and a second service registration center node, and push switches are arranged on the first service registration center node and the second registration center node, and the cluster node control device is characterized by comprising:
the push switch control module is used for closing the push switch after determining that the service registration center cluster has a fault;
and the service information returning module is used for responding to a service subscription request initiated by a service consumption end and returning service information to the service consumption end according to the state of the push switch.
7. An apparatus for updating a service registration list, disposed at a service consumer, the apparatus comprising:
the service subscription module is used for sending a service subscription request to the service registration center node;
the receiving module is used for receiving the service information returned by the service registration center node;
the first determining module is used for calling the service by using a service registration list cached locally when the service information is determined to be a specific state code;
and the second determining module is used for updating the service registration list of the local cache according to the current service registration list when the service information is determined to be the current service registration list of the service registration center node.
8. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-5.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 5.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.
CN202211394794.5A 2022-11-08 2022-11-08 Cluster node control method, device, equipment, storage medium and program product Active CN115834668B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211394794.5A CN115834668B (en) 2022-11-08 2022-11-08 Cluster node control method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211394794.5A CN115834668B (en) 2022-11-08 2022-11-08 Cluster node control method, device, equipment, storage medium and program product

Publications (2)

Publication Number Publication Date
CN115834668A true CN115834668A (en) 2023-03-21
CN115834668B CN115834668B (en) 2024-05-07

Family

ID=85527251

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211394794.5A Active CN115834668B (en) 2022-11-08 2022-11-08 Cluster node control method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN115834668B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116137611A (en) * 2023-04-20 2023-05-19 中国工商银行股份有限公司 Traffic distribution method, device, equipment and medium

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626310A (en) * 2008-07-10 2010-01-13 阿里巴巴集团控股有限公司 Method, device and system for transmitting service information in trunking environment
CN101686244A (en) * 2008-09-23 2010-03-31 阿里巴巴集团控股有限公司 Method and system for transmitting service information
US7881268B1 (en) * 2005-02-17 2011-02-01 Sprint Spectrum L.P. Group list update system and method
CN103095587A (en) * 2013-01-23 2013-05-08 北京交通大学 Method of registration service and network ethnic group central control node and system
CN105847285A (en) * 2016-05-16 2016-08-10 乐视控股(北京)有限公司 Push service configuration method and device
US20170142041A1 (en) * 2015-11-12 2017-05-18 International Business Machines Corporation Message delivery in a message system
US20180084064A1 (en) * 2015-04-09 2018-03-22 Convida Wireless, Llc Registration management in the service layer
CN109257440A (en) * 2018-10-29 2019-01-22 南京南瑞信息通信科技有限公司 A kind of service discovery and client load equalization methods based on service register center
CN110120961A (en) * 2018-02-06 2019-08-13 北京京东尚科信息技术有限公司 A kind of method of Distributed Services cluster and its route synchronization
CN110365750A (en) * 2019-06-25 2019-10-22 苏宁云计算有限公司 Service registration system and method
CN111615066A (en) * 2020-02-07 2020-09-01 中国海洋大学 Distributed micro-service registration and calling method based on broadcast
CN112087333A (en) * 2020-09-07 2020-12-15 上海浦东发展银行股份有限公司 Micro-service registration center cluster and information processing method thereof
CN112367221A (en) * 2020-10-28 2021-02-12 常州微亿智造科技有限公司 Distributed registry recommendation method under industrial Internet of things
CN112667351A (en) * 2020-12-28 2021-04-16 通号智慧城市研究设计院有限公司 Intelligent analysis service system, method and medium based on containerized micro-service
US20210132974A1 (en) * 2019-11-01 2021-05-06 Dell Products L. P. System for peering container clusters running on different container orchestration systems
CN114640656A (en) * 2020-12-01 2022-06-17 博泰车联网科技(上海)股份有限公司 Method, apparatus and medium for updating data
CN115103008A (en) * 2022-06-13 2022-09-23 北京奇艺世纪科技有限公司 Service request forwarding system

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7881268B1 (en) * 2005-02-17 2011-02-01 Sprint Spectrum L.P. Group list update system and method
CN101626310A (en) * 2008-07-10 2010-01-13 阿里巴巴集团控股有限公司 Method, device and system for transmitting service information in trunking environment
CN101686244A (en) * 2008-09-23 2010-03-31 阿里巴巴集团控股有限公司 Method and system for transmitting service information
CN103095587A (en) * 2013-01-23 2013-05-08 北京交通大学 Method of registration service and network ethnic group central control node and system
US20180084064A1 (en) * 2015-04-09 2018-03-22 Convida Wireless, Llc Registration management in the service layer
US20170142041A1 (en) * 2015-11-12 2017-05-18 International Business Machines Corporation Message delivery in a message system
CN105847285A (en) * 2016-05-16 2016-08-10 乐视控股(北京)有限公司 Push service configuration method and device
CN110120961A (en) * 2018-02-06 2019-08-13 北京京东尚科信息技术有限公司 A kind of method of Distributed Services cluster and its route synchronization
CN109257440A (en) * 2018-10-29 2019-01-22 南京南瑞信息通信科技有限公司 A kind of service discovery and client load equalization methods based on service register center
CN110365750A (en) * 2019-06-25 2019-10-22 苏宁云计算有限公司 Service registration system and method
US20210132974A1 (en) * 2019-11-01 2021-05-06 Dell Products L. P. System for peering container clusters running on different container orchestration systems
CN111615066A (en) * 2020-02-07 2020-09-01 中国海洋大学 Distributed micro-service registration and calling method based on broadcast
CN112087333A (en) * 2020-09-07 2020-12-15 上海浦东发展银行股份有限公司 Micro-service registration center cluster and information processing method thereof
CN112367221A (en) * 2020-10-28 2021-02-12 常州微亿智造科技有限公司 Distributed registry recommendation method under industrial Internet of things
CN114640656A (en) * 2020-12-01 2022-06-17 博泰车联网科技(上海)股份有限公司 Method, apparatus and medium for updating data
CN112667351A (en) * 2020-12-28 2021-04-16 通号智慧城市研究设计院有限公司 Intelligent analysis service system, method and medium based on containerized micro-service
CN115103008A (en) * 2022-06-13 2022-09-23 北京奇艺世纪科技有限公司 Service request forwarding system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
崔蔚;李春阳;刘迪;杨超;金逸;: "面向微服务的统一应用开发平台", 电力信息与通信技术, no. 09, 15 September 2016 (2016-09-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116137611A (en) * 2023-04-20 2023-05-19 中国工商银行股份有限公司 Traffic distribution method, device, equipment and medium
CN116137611B (en) * 2023-04-20 2023-07-25 中国工商银行股份有限公司 Traffic distribution method, device, equipment and medium

Also Published As

Publication number Publication date
CN115834668B (en) 2024-05-07

Similar Documents

Publication Publication Date Title
US11438285B2 (en) Method and system for interaction servicing with embeddable ribbon display
US8713365B2 (en) Re-establishing push notification channels via user identifiers
US10091282B2 (en) Metadata-driven dynamic load balancing in multi-tenant systems
CN114048046B (en) Service calling method and device and load balancing equipment
CN109783151B (en) Method and device for rule change
US20200153707A1 (en) NF SERVICE CONSUMER RESTART DETECTION USING DIRECT SIGNALING BETWEEN NFs
US9389929B1 (en) Granular event management for service platforms
US10789145B2 (en) System and method for implementing a server configuration drift monitoring tool
CN115834668A (en) Cluster node control method, device, equipment, storage medium and program product
CN111200606A (en) Deep learning model task processing method, system, server and storage medium
CN108874531B (en) Method, device and system for fusing service and electronic equipment
US9900756B2 (en) Dynamically updating policy controls for mobile devices and applications via policy notifications
US11381665B2 (en) Tracking client sessions in publish and subscribe systems using a shared repository
CN115065686B (en) Configuration method, device and system of distributed load balancing system
US20240012632A1 (en) Coordinating updates to an agent platform appliance in which agents of cloud services are deployed
CN110851166A (en) User-unaware application program updating method and device and computer equipment
CN116302602A (en) Message transmission method and device for mixed development of router protogenesis
CN114968636A (en) Fault processing method and device
US11663117B2 (en) Customizable decision service
US11513833B1 (en) Event listener interface for container-based execution of serverless functions
CN113704670A (en) Data sharing method, apparatus, device, medium, and program product
CN114461424A (en) Inter-unit service discovery method, device and system under unitized deployment architecture
Ganchev et al. A cloud-based service recommendation system for use in UCWW
US11936530B1 (en) System, method, and computer program for AWS autoscaling of Tuxedo systems
CN114900383B (en) Interface processing method, device, electronic equipment and computer 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