Multicast-based cluster service discovery method and device, computing equipment and medium
By adopting a variety -based cluster service discovery method in the distributed system, the central control service and node services are added to the formation domain, and the address of the central control component is transmitted to realize the service reporting and registration. The problem of failure and single -point failure realizes a stable and reliable service discovery method.
Patent Information
- Application Number
- CN202411443022.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-21
AI Technical Summary
In modern distributed systems, the service discovery model based on the centralized service registration center has the risk of network request failure, especially in the case of cloud deployment, and the dependence of the centralized service discovery method on central control services leads to system failure. Higher risk.
Adopt a variety -based cluster service discovery method, add multiple central control services and node services to the same group broadcast domain to form a group broadcasting cluster, and transmit the central control component address of the central control service through the broadcast method to the node service. Realize service reporting and registration.
This method avoids dependence on public network services, reduces the risk of network request failure, realizes the unprepared service discovery method, avoids single -point failures, and ensures the stability and reliability of service discovery.
Smart Images

Figure CN119341932A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and specifically to a multicast-based cluster service discovery method, apparatus, computing device, and medium. Background Art
[0002] In modern distributed systems, service discovery is a key technology to ensure the system's dynamics and flexibility. Existing service discovery technologies mainly include discovery modes based on service registry centers and discovery modes based on DNS. Among them, the discovery mode based on service registry centers, such as Consul, Eureka, and Zookeeper, tracks the status and location of service instances by maintaining a centralized service registry. Service providers register their information with the registry center at startup, and service consumers query the registry center to discover available service instances. This discovery mode supports automatic registration, deregistration, and fault detection of services, improving the reliability and scalability of the system. The discovery mode based on DNS uses the DNS protocol to discover service instances. Service providers publish service information through DNS SRV records, and service consumers obtain the location of service instances through DNS queries. This discovery mode simplifies the service discovery process, but may have some limitations in dynamic environments, such as service instance update delays and DNS cache issues.
[0003] In a production environment, the registration center of the central control service is deployed in the cloud, so the central control service registration itself needs to be requested through the public network, so there is a certain probability that the request will fail, affecting the normal execution of service discovery within a certain period of time, especially for CDN services. For some operator nodes, if the area where the machine is deployed is far away from the cloud center computer room, the possibility of network request failure is very high. In addition, service discovery depends on the central control service. In a centralized service discovery mode, the central control service is deployed on a single machine. If the central control service fails, then all service discoveries in the cluster will fail. Summary of the invention
[0004] In view of the above problems, the present application is proposed to provide a multicast-based cluster service discovery method, apparatus, computing device and medium that overcome the above problems or at least partially solve the above problems.
[0005] According to one aspect of an embodiment of the present application, a multicast-based cluster service discovery method is provided, including:
[0006] Add multiple central control services and multiple node services to the same multicast domain to form a multicast cluster;
[0007] Transmitting the central control component addresses corresponding to multiple central control services to each node service in the multicast cluster in a multicast manner;
[0008] When any node service needs to report a service, the target central control component address is obtained from the central control component addresses corresponding to multiple central control services, so that the node service can report the service instance related information of the node service to the corresponding central control service according to the target central control component address.
[0009] Furthermore, transmitting the central control component addresses corresponding to the plurality of central control services to each node service in the multicast cluster in a multicast manner further includes:
[0010] Each central control service sends a multicast message including the central control component address corresponding to the central control service to the multicast address corresponding to the multicast cluster, and transmits the multicast message in a multicast manner to the nodes where the node services in the multicast cluster are deployed.
[0011] Further, each central control service sends a multicast message including the central control component address corresponding to the central control service to the multicast address corresponding to the multicast cluster, and transmits the multicast message in a multicast manner to the node where the node service in the multicast cluster is deployed further includes:
[0012] Each central control service sends a multicast message to the multicast address corresponding to the multicast cluster according to the multicast network socket at a preset time interval;
[0013] The multicast message is forwarded to the nodes under the corresponding broadcast domain through the switch, and the multicast message is forwarded to the nodes under the corresponding multicast domain through the router.
[0014] Furthermore, the multicast message includes a logical cluster identifier of the multicast cluster;
[0015] After forwarding the multicast message to the nodes in the multicast domain through the router, the method further includes:
[0016] Get the logical cluster identifier in the multicast message;
[0017] Determine whether the multicast message belongs to the multicast cluster to which the node belongs according to the logical cluster identifier;
[0018] If not, the multicast message is discarded.
[0019] Furthermore, after transmitting the multicast message in a multicast manner to the node deployed with the node service in the multicast cluster, the method further includes:
[0020] The node where the node service is deployed receives the multicast message, extracts the central control component address from the multicast message and stores it in the global variable data.
[0021] Furthermore, when any node service needs to report a service, obtaining a target central control component address from central control component addresses corresponding to multiple central control services further includes:
[0022] Get the target central control component address from the global variable data.
[0023] According to another aspect of an embodiment of the present application, a multicast-based cluster service discovery device is provided, including:
[0024] A cluster formation module, suitable for adding multiple central control services and multiple node services to the same multicast domain to form a multicast cluster;
[0025] A transmission module, adapted to transmit the central control component addresses corresponding to the plurality of central control services to each node service in the multicast cluster in a multicast manner;
[0026] The acquisition module is suitable for obtaining the target central control component address from the central control component addresses corresponding to multiple central control services when any node service needs to report service, so that the node service can report the service instance related information of the node service to the corresponding central control service according to the target central control component address.
[0027] According to another aspect of the embodiment of the present application, there is provided a computing device, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0028] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned multicast-based cluster service discovery method.
[0029] According to another aspect of the embodiments of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned multicast-based cluster service discovery method.
[0030] According to another aspect of the embodiments of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the above-mentioned multicast-based cluster service discovery method.
[0031] According to the solution provided in the embodiment of the present application, multicast communication technology is introduced into the service discovery scenario for the central control component, and multiple central control services and multiple node services are added to the same multicast domain to form a multicast cluster. Multiple central control services can multicast their corresponding central control component addresses and transmit them to each node service in the multicast cluster; when any node service needs to request the central control service to report the service, it can conveniently obtain the central control component address corresponding to the central control service in the multicast cluster to which it belongs, and then report the service according to the central control component address to complete the service registration; this solution can conveniently obtain the central control component address corresponding to the central control service without relying on the public network service, avoiding service discovery anomalies of the central control component caused by network problems, and realizing a decentralized service discovery method, avoiding dependence on the central control service deployed on a single machine, and realizing a stable and reliable service discovery method.
[0032] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation method of the embodiment of the present application is listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the embodiments of the present application. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0034] Figure 1 A schematic diagram of a process of a cluster service discovery method based on multicast according to an embodiment of the present application is shown;
[0035] Figure 2a A schematic diagram of a process of a cluster service discovery method based on multicast according to another embodiment of the present application is shown;
[0036] Figure 2b A schematic diagram of the architecture of a cluster service discovery method based on multicast is shown;
[0037] Figure 3 A structural block diagram of a cluster service discovery device based on multicast according to an embodiment of the present application is shown;
[0038] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0039] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0040] First, the terms involved in one or more embodiments of the present application are explained.
[0041] Service discovery: refers to the technology and process of automatically identifying and locating service instances in a distributed system. It maintains a service registry or directory, allowing service providers to register their location and other metadata with the registry when they start, and service consumers query the registry or directory to obtain the latest location information of service instances. The key purpose of service discovery is to support the dynamic and scalability of the system, ensuring that services can be automatically updated when changes occur (such as instance additions or failures), thereby achieving high availability and flexibility of the system.
[0042] CDN: Content Delivery Network is a new type of content service system based on IP network. Through the strategic construction and deployment of widely distributed edge servers, supplemented by relevant load balancing and central platform scheduling strategies, it can enable visiting users to access the available edge servers nearby and obtain the required content, thereby improving cache hit rate and response speed. The CDN distribution system is usually a tree-like structure that relies on layering and port multiplexing to improve the load capacity of the entire system. The edge-side CDN node close to the user obtains real-time media streams or static files from the source station through layers of back-to-source according to the decision of the scheduling system, thereby providing services to users.
[0043] Multicast: is a network communication method used to transmit data from a source node to a specific set of target nodes simultaneously, rather than broadcasting to all nodes in the network. Multicast creates and manages multicast groups in the network, allowing source nodes to send data packets to the group, and receivers to receive data by joining the group. This mechanism reduces the consumption of network bandwidth and can significantly improve data transmission efficiency and reduce network congestion compared to broadcasting. Multicast protocols usually include functions such as multicast address allocation, member management, and data transmission.
[0044] Broadcast: is a network communication method by which data is sent from a source node to all nodes in the network simultaneously. Broadcast ensures that all devices connected to the network receive the same data packets. Broadcast is often used in scenarios where information needs to be delivered to all members of the network, such as network initialization, device discovery, or certain types of network management. Since broadcast packets are received by all devices in the network, it can cause bandwidth waste and network congestion, so in many modern network protocols, broadcast is replaced by more efficient communication methods such as multicast or unicast.
[0045] Figure 1 A schematic diagram of a process flow of a cluster service discovery method based on multicast according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:
[0046] Step S101: Add multiple central control services and multiple node services to the same multicast domain to form a multicast cluster.
[0047] Among them, the central control service refers to the service that provides service registration for the service provider, and the node service refers to the microservice used as a service provider. For example, the node service may include a gateway service, a cache service, a back-to-source service, etc. In the embodiment of the present application, the multicast communication technology is introduced into the service discovery scenario for the central control component, so that the node service as a service provider can easily obtain the central control component address corresponding to the central control service without relying on the public network service.
[0048] Specifically, when the service is started, multiple central control services and multiple node services are added to the same multicast domain to form a multicast cluster, so that the node service can easily obtain the central control component address corresponding to the central control service in the multicast cluster to which it belongs through multicast, and then report the service according to the central control component address to complete the service registration, thereby realizing a decentralized service discovery method and avoiding dependence on the central control service deployed on a single machine.
[0049] Step S102: transmitting the central control component addresses corresponding to the plurality of central control services to each node service in the multicast cluster in a multicast manner.
[0050] After a multicast cluster is formed, multiple central control services can multicast their corresponding central control component addresses, which will then be transmitted to each node service in the same multicast cluster in a multicast communication manner, so that each node service can easily obtain the central control component address.
[0051] Step S103, when any node service needs to report service, obtain the target central control component address from the central control component addresses corresponding to multiple central control services, so that the node service can report the service instance related information of the node service to the corresponding central control service according to the target central control component address.
[0052] When any node service needs to request the central control service to report the service, it can obtain the target central control component address from the central control component addresses corresponding to multiple central control services. The target central control component address refers to the central control component address of the central control service used to provide service registration for the node service among multiple central control services. Then, the node service can report the service instance related information of the node service to the corresponding central control service according to the target central control component address to complete the service registration. The service instance related information includes the location information of the service instance, etc.
[0053] According to the multicast-based cluster service discovery method provided in the embodiment of the present application, multicast communication technology is introduced into the service discovery scenario for the central control component, and multiple central control services and multiple node services are added to the same multicast domain to form a multicast cluster. Multiple central control services can multicast their corresponding central control component addresses and transmit them to each node service in the multicast cluster; when any node service needs to request the central control service to report the service, it can conveniently obtain the central control component address corresponding to the central control service in the multicast cluster to which it belongs, and then report the service according to the central control component address to complete the service registration; this solution can conveniently obtain the central control component address corresponding to the central control service without relying on the public network service, avoiding the service discovery anomalies of the central control component caused by network problems, and realizing a decentralized service discovery method, avoiding the dependence on the central control service deployed on a single machine, and realizing a stable and reliable service discovery method.
[0054] Figure 2a A schematic diagram of a process flow of a cluster service discovery method based on multicast according to another embodiment of the present application is shown. Figure 2a As shown, the method comprises the following steps:
[0055] Step S201: Add multiple central control services and multiple node services to the same multicast domain to form a multicast cluster.
[0056] When the service is started, multiple central control services and multiple node services create a multicast network socket and join the same multicast domain to form a multicast cluster. Among them, the multicast network socket (Multicast Network Socket) is a special network socket used to implement multicast communication in an IP network and send and receive multicast data packets. Multicast communication allows data to be sent from a source to multiple recipients without sending a separate copy of the data to each recipient. Multicast uses a specific IP address range to identify the recipient group. These addresses are not assigned to any specific host, but are used to identify a group. In an embodiment of the present application, the central control service is the source in the multicast communication, and the node service is the receiver in the multicast communication. The node service can receive messages sent by the central control service by joining the corresponding multicast cluster.
[0057] Multiple central control services can be deployed on different CDN nodes; multiple node services can be deployed on different CDN nodes or on the same CDN node, without limitation here; the CDN node where the central control service is deployed and the CDN node where the node service is deployed can be the same or different, without limitation here.
[0058] Considering that multicast communication technology is particularly suitable for situations where data needs to be sent to a group of receivers at the same time, such as video conferencing, online live broadcasting and other fields, in the embodiment of the present application, multicast communication technology is introduced into the service discovery scenario for the central control component, and a small-scale cluster service discovery method suitable for the same local area network is proposed, and the same multicast cluster contains multiple central control services, successfully avoiding the dependence on the central control service deployed on a single machine, and effectively realizing the decentralization of service discovery for the central control component. Even if a central control service in a multicast cluster fails, other central control services in the multicast cluster can provide service registration services for the node services in the multicast cluster, complete service reporting and service registration, and realize a decentralized service discovery method. In addition, the service discovery does not rely on public network services. Compared with the existing technology, it can effectively avoid service discovery anomalies caused by network problems.
[0059] Figure 2b The schematic diagram of the architecture of the cluster service discovery method based on multicast is shown as follows: Figure 2bAs shown, the multicast cluster contains m central control services and n node services, specifically central control services 1 to central control services m and node services 1 to node services n. Those skilled in the art can set the specific values of m and n according to actual needs. Node services 1 to node services n can be microservices such as gateway services, cache services, and back-to-source services respectively; any central control service from central control services 1 to central control services m can provide service registration services for node services 1 to node services n, so that service consumers can find available service instances based on the registered information.
[0060] After forming a multicast cluster, each central control service may send a multicast message including the central control component address corresponding to the central control service to the multicast address corresponding to the multicast cluster, and transmit the multicast message in a multicast manner to the nodes where the node services in the multicast cluster are deployed. Specifically, this may be achieved through steps S202 and S203.
[0061] Step S202: Each central control service sends a multicast message to a multicast address corresponding to a multicast cluster according to a multicast network socket at a preset time interval.
[0062] For the central control service, it can multicast its own information, that is, the central control component address, through the multicast network socket at preset time intervals (for example, 1s, etc.). Specifically, the central control component address corresponding to the central control service is added to the multicast message, and the multicast message is sent to the multicast address corresponding to the multicast cluster.
[0063] Step S203: forwarding the multicast message to the nodes in the corresponding broadcast domain through the switch, and forwarding the multicast message to the nodes in the corresponding multicast domain through the router.
[0064] After any central control service sends a multicast message, the multicast message will be forwarded to the nodes in the same broadcast domain as the central control service through the switch, and then forwarded to the nodes in the same multicast domain through the router. Then, the nodes in the multicast cluster with node services deployed can receive multicast messages from the same multicast domain at regular time intervals (for example, 3 seconds).
[0065] Step S204: Acquire the logical cluster identifier in the multicast message.
[0066] Considering that a node may receive multicast messages from nodes that have joined the same multicast domain under the same switch or in the same LAN, there may be a situation where multicast messages are leaked. For example, during the production environment test, a node in multicast cluster A received a multicast message from a node in multicast cluster B. The reason may be that the network device configuration error caused the nodes of different multicast clusters to be in the same LAN. Since the nodes of all multicast clusters have the same IP address to join the multicast domain, the isolation of different multicast clusters is achieved through the isolation at the network device level, so there is a possibility of multicast message leakage. In an embodiment of the present application, the above problem is solved by adding a cluster IDC (Internet Data Center) authentication function. Specifically, the logical cluster identifier of the multicast cluster can be added to the multicast message, and the logical cluster identifier of the multicast cluster can be used as the authentication information to implement message authentication. In addition, the central control service can encrypt the sent multicast message, and the node service decrypts the received multicast message through the decryption method corresponding to the encryption method.
[0067] The multicast message includes a logical cluster identifier of the multicast cluster, which is an identifier used to distinguish the logical belonging of the multicast cluster, and different multicast clusters have different logical cluster identifiers. In step S204, the logical cluster identifier included in the multicast message is obtained from the multicast message.
[0068] Step S205, judging whether the multicast message belongs to the multicast cluster to which the node belongs according to the logical cluster identifier; if so, executing step S206; if not, executing step S208.
[0069] The node receiving the multicast message in the multicast domain (i.e., the receiver of the multicast message) can determine whether the multicast message is a message sent within the multicast cluster to which the node belongs based on the logical cluster identifier of the multicast message. If so, step S206 is executed to process the multicast message; if not, step S208 is executed to discard the multicast message.
[0070] Step S206: The node where the node service is deployed receives the multicast message, extracts the central control component address from the multicast message and stores it in the global variable data.
[0071] like Figure 2b As shown, the core process of the multicast-based cluster service discovery method proposed in this application mainly includes two sub-processes, one of which is Figure 2b The left part shows the sub-process of the central control service sending its own information. Another sub-process is Figure 2bThe right part shows the sub-process of the node service obtaining the central control service. Specifically, the node deployed with the node service receives the multicast message, processes the multicast message, extracts the address of the central control component included in the multicast message, and then stores the address of the central control component in the global variable data. Global variable data is a variable declared in the program and accessible throughout the program. It can share data between multiple functions, modules or classes, facilitate data transfer and access, and help simplify the code and reduce the complexity of data transfer.
[0072] Step S207, when any node service needs to report service, the target central control component address is obtained from the global variable data, so that the node service can report the service instance related information of the node service to the corresponding central control service according to the target central control component address.
[0073] When any node service needs to request the central control service to report service, the node service can obtain the target central control component address from the global variable data, and then the node service can report the service instance related information of the node service to the corresponding central control service according to the obtained target central control component address to complete the service registration.
[0074] In addition, in a production environment, the effectiveness of the multicast mechanism does not completely rely on the code design at multiple layers (such as seven layers), but also relies on the protocol support of the second and third layer network devices. If the router suddenly prohibits the multicast port, or the firewall blocks the multicast message, the service discovery within the entire multicast cluster will fail. Therefore, a downgrade strategy is also proposed in the embodiment of the present application. When the multicast mechanism fails, the multicast-based cluster service discovery method provided by the present application can still ensure the normal execution of service discovery without offline services. For node services, the address of the central control component obtained by service discovery can be placed in a file. Specifically, the global variable data can be placed in a file. When the node service needs to request the central control service, a central control component address can be randomly selected from the file based on the load balancing strategy as the target central control component address for the node service to report the service. When the multicast mechanism is abnormal, the central control component address of the central control service within the multicast cluster can be directly added to the file to temporarily ensure the normal execution of service discovery.
[0075] Step S208: discard the multicast message.
[0076] If it is determined in step S205 that the multicast message does not belong to the multicast cluster to which the node belongs, it means that the node has received multicast messages from other multicast clusters and does not need to process the multicast message, and the multicast message can be directly discarded.
[0077] The multicast-based cluster service discovery method provided in the embodiment of the present application is suitable for service discovery of small-scale clusters in the same local area network, and enables the same multicast cluster to include multiple central control services, successfully avoiding dependence on the central control service deployed on a single machine, and effectively realizing the decentralization of service discovery for the central control component. Even if a central control service in a multicast cluster fails, other central control services in the multicast cluster can provide service registration services for the node services in the multicast cluster, complete service reporting and service registration, and realize a decentralized service discovery method; and the service discovery method does not rely on public network services. Compared with the prior art, it can effectively avoid service discovery anomalies caused by network problems; in addition, a logical cluster identifier of the multicast cluster is added to the multicast message, and the logical cluster identifier of the multicast cluster is used as authentication information to realize message authentication, so that the receiver of the multicast message only needs to process the message sent within the multicast cluster to which it belongs, and the central control component address extracted from the multicast message is stored in the global variable data, thereby realizing the effective recording of the central control component address of each central control service in the multicast cluster.
[0078] Figure 3 A structural block diagram of a cluster service discovery device based on multicast according to an embodiment of the present application is shown. Figure 3 As shown, the device includes: a cluster forming module 310 , a transmission module 320 and an acquisition module 330 .
[0079] The cluster forming module 310 is adapted to add multiple central control services and multiple node services into the same multicast domain to form a multicast cluster.
[0080] The transmission module 320 is adapted to: transmit the central control component addresses corresponding to the multiple central control services to each node service in the multicast cluster in a multicast manner.
[0081] The acquisition module 330 is suitable for: when any node service needs to report service, obtaining the target central control component address from the central control component addresses corresponding to multiple central control services, so that the node service can report the service instance related information of the node service to the corresponding central control service according to the target central control component address.
[0082] Optionally, the transmission module 320 is further adapted to: each central control service sends a multicast message including the central control component address corresponding to the central control service to the multicast address corresponding to the multicast cluster, and transmits the multicast message in a multicast manner to the node where the node service in the multicast cluster is deployed.
[0083] Optionally, the transmission module 320 is further adapted to: each central control service sends a multicast message to the multicast address corresponding to the multicast cluster according to the multicast network socket at preset time intervals; forwards the multicast message to the nodes under the corresponding broadcast domain through the switch, and forwards the multicast message to the nodes under the corresponding multicast domain through the router.
[0084] Optionally, the multicast message includes a logical cluster identifier of the multicast cluster; the transmission module 320 is further adapted to: obtain the logical cluster identifier in the multicast message; determine whether the multicast message belongs to the multicast cluster to which the node belongs according to the logical cluster identifier; if not, discard the multicast message.
[0085] Optionally, the transmission module 320 is further adapted to: receive a multicast message by a node deployed with a node service, extract the central control component address from the multicast message and store it in the global variable data.
[0086] Optionally, the acquisition module 330 is further adapted to: acquire the target central control component address from the global variable data.
[0087] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.
[0088] The multicast-based cluster service discovery device provided in the embodiment of the present application is suitable for service discovery of small-scale clusters in the same local area network, and enables the same multicast cluster to include multiple central control services, successfully avoiding dependence on the central control service deployed on a single machine, and effectively realizing the decentralization of service discovery for the central control component. Even if a central control service in a multicast cluster fails, other central control services in the multicast cluster can provide service registration services for the node services in the multicast cluster, complete service reporting and service registration, and realize a decentralized service discovery method; and the service discovery method does not rely on public network services. Compared with the prior art, it can effectively avoid service discovery anomalies caused by network problems; in addition, a logical cluster identifier of the multicast cluster is added to the multicast message, and the logical cluster identifier of the multicast cluster is used as authentication information to realize message authentication, so that the receiver of the multicast message only needs to process the message sent within the multicast cluster to which it belongs, and the central control component address extracted from the multicast message is stored in the global variable data, thereby realizing the effective recording of the central control component address of each central control service in the multicast cluster.
[0089] An embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction or computer program, which enables a processor to perform operations corresponding to the multicast-based cluster service discovery method in any of the above method embodiments.
[0090] An embodiment of the present application provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the multicast-based cluster service discovery method in any of the above method embodiments.
[0091] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.
[0092] like Figure 4 As shown, the computing device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .
[0093] Wherein: the processor 402, the communication interface 404, and the memory 406 communicate with each other through the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the embodiment of the multicast-based cluster service discovery method for computing devices.
[0094] Specifically, the program 410 may include program codes, which include computer operation instructions.
[0095] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0096] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0097] Program 410 can be specifically used to enable processor 402 to execute the multicast-based cluster service discovery method in any of the above-mentioned method embodiments. The specific implementation of each step in program 410 can refer to the corresponding description in the corresponding steps and units in the above-mentioned multicast-based cluster service discovery embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.
[0098] The algorithm and display provided herein are not inherently related to any specific computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present application embodiment described herein, and the above description of specific languages is to disclose the best mode of implementation of the present application embodiment.
[0099] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0100] Similarly, it should be understood that in order to streamline the present disclosure and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed embodiments of the present application require more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the embodiment of the present application.
[0101] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0102] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the embodiments of the present application and to form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0103] The various component embodiments of the embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The embodiments of the present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the embodiments of the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0104] It should be noted that the above embodiments illustrate rather than limit the embodiments of the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The embodiments of the present application may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
Claims
1. A cluster service discovery method based on multicast, comprising: Add multiple central control services and multiple node services to the same multicast domain to form a multicast cluster; Transmitting the central control component addresses corresponding to the multiple central control services to each node service in the multicast cluster in a multicast manner; When any node service needs to report a service, a target central control component address is obtained from the central control component addresses corresponding to multiple central control services, so that the node service can report the service instance related information of the node service to the corresponding central control service according to the target central control component address.
2. According to the method of claim 1, the transmitting of the central control component addresses corresponding to the plurality of central control services to each node service in the multicast cluster in a multicast manner further comprises: Each central control service sends a multicast message including the central control component address corresponding to the central control service to the multicast address corresponding to the multicast cluster, and transmits the multicast message in a multicast manner to the node where the node service in the multicast cluster is deployed.
3. The method according to claim 2, wherein each central control service sends a multicast message including the central control component address corresponding to the central control service to the multicast address corresponding to the multicast cluster, and transmits the multicast message in a multicast manner to the node where the node service in the multicast cluster is deployed further comprises: Each central control service sends the multicast message to the multicast address corresponding to the multicast cluster according to the multicast network socket at a preset time interval; The multicast message is forwarded to the nodes in the corresponding broadcast domain through the switch, and the multicast message is forwarded to the nodes in the corresponding multicast domain through the router.
4. The method according to claim 3, wherein the multicast message includes a logical cluster identifier of the multicast cluster; After forwarding the multicast message to the nodes in the multicast domain through the router, the method further includes: Obtaining the logical cluster identifier in the multicast message; Determining, according to the logical cluster identifier, whether the multicast message belongs to a message in the multicast cluster to which the node belongs; If not, the multicast message is discarded.
5. According to the method according to any one of claims 2 to 4, after transmitting the multicast message in a multicast manner to the node where the node service in the multicast cluster is deployed, the method further comprises: The node on which the node service is deployed receives the multicast message, extracts the central control component address from the multicast message and stores it in the global variable data.
6. According to the method of claim 5, when any node service needs to report a service, obtaining the target central control component address from the central control component addresses corresponding to the multiple central control services further comprises: The target central control component address is obtained from the global variable data.
7. A cluster service discovery device based on multicast, comprising: A cluster formation module, suitable for adding multiple central control services and multiple node services to the same multicast domain to form a multicast cluster; A transmission module, adapted to transmit the central control component addresses corresponding to the plurality of central control services to each node service in the multicast cluster in a multicast manner; The acquisition module is suitable for obtaining the target central control component address from the central control component addresses corresponding to multiple central control services when any node service needs to report service, so that the node service can report the service instance related information of the node service to the corresponding central control service according to the target central control component address.
8. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the multicast-based cluster service discovery method according to any one of claims 1-6.
9. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the multicast-based cluster service discovery method according to any one of claims 1 to 6.
10. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the multicast-based cluster service discovery method according to any one of claims 1 to 6.
Citation Information
Cited By
Node discovery method in multicast limited environment
CN121771266A