CN113660339B - Method and apparatus for decentralizing clusters - Google Patents

Method and apparatus for decentralizing clusters Download PDF

Info

Publication number
CN113660339B
CN113660339B CN202110949191.6A CN202110949191A CN113660339B CN 113660339 B CN113660339 B CN 113660339B CN 202110949191 A CN202110949191 A CN 202110949191A CN 113660339 B CN113660339 B CN 113660339B
Authority
CN
China
Prior art keywords
node
cluster
service
response
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110949191.6A
Other languages
Chinese (zh)
Other versions
CN113660339A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110949191.6A priority Critical patent/CN113660339B/en
Publication of CN113660339A publication Critical patent/CN113660339A/en
Application granted granted Critical
Publication of CN113660339B publication Critical patent/CN113660339B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 

Abstract

A method and a device for decentralizing clusters are provided, which relate to the technical field of computers, in particular to the technical field of cluster deployment. The implementation scheme is as follows: receiving, through a port of a cluster service, access of at least one node, each of the at least one node configured to perform an operation to join the cluster based on the access; and in response to determining that the operation of the first node in the at least one node is successful, mounting an access interface of the first node to a backend of the cluster service such that a port of the cluster service is mapped to a port of the access interface of the first node, wherein the access interface is configured to cause the second node to join the first cluster including the first node based on the operation of a second node of the at least one node that is distinct from the first node.

Description

Method and apparatus for decentralizing clusters
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to the field of cluster deployment technology, and more particularly, to a method and apparatus for decentralizing clusters, an electronic device, a computer readable storage medium, and a computer program product.
Background
The decentralised cluster is often started by a seed node in the initial starting process of the cluster, and based on the starting of the seed node, the subsequent joining node joins the cluster by the started seed node.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, the problems mentioned in this section should not be considered as having been recognized in any prior art unless otherwise indicated.
Disclosure of Invention
The present disclosure provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for decentralizing clusters.
According to an aspect of the present disclosure, there is provided a method for decentralizing clusters, comprising: receiving, through a port of a cluster service, an access of at least one node, each of the at least one node configured to perform an operation to join the cluster based on the access; and in response to determining that the operation of a first node of the at least one node is successful, mounting an access interface of the first node to a backend of the cluster service such that a port of the cluster service is mapped to a port of an access interface of the first node, wherein the access interface is configured to cause a second node of the at least one node to join a first cluster that includes the first node based on the operation of the second node that is distinct from the first node.
According to another aspect of the present disclosure, there is provided an apparatus for decentralizing clusters, comprising: a receiving unit configured to receive an access of at least one node through a port of a cluster service, each of the at least one node configured to perform an operation to join a cluster based on the access; and a mounting unit configured to mount an access interface of a first node of the at least one node to a back end of the cluster service in response to determining that the operation of the first node is successful, such that a port of the cluster service is mapped to a port of an access interface of the first node, wherein the access interface is configured to cause a second node of the at least one node to join a first cluster containing the first node based on the operation of the second node.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to implement a method according to the above.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to implement a method according to the above.
According to another aspect of the present disclosure, there is provided an electronic device, a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements a method according to the above.
According to one or more embodiments of the present disclosure, access of a node is received through a port of a cluster service, and the port of the cluster service is mapped to a port of an access interface of a first node that successfully joins a cluster by accessing the cluster service, such that other nodes that subsequently perform operations to join the cluster by accessing the cluster service may access the port of the access interface of the first node mapped to the port of the cluster service when accessing the cluster service. Because the access interface of the first node is configured to be based on the operation of joining the cluster, which is executed by other nodes accessing the cluster service, the other nodes join the first cluster to which the first node has joined; thus, other nodes that subsequently access the port of the access interface of the first node by accessing the cluster service can join the first cluster.
The first node is not limited to a seed node or a service node different from the seed node, so that the first cluster enables the decentralised cluster, and during the starting process of the decentralised cluster, the newly added node does not need to join the cluster through an access interface of the seed node. In a cluster comprising a plurality of nodes, under the condition that a seed node fails, the cluster can still be added through any other started node in the cluster, so that the problem of brain fracture possibly caused by restarting the seed node is effectively avoided.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The accompanying drawings illustrate exemplary embodiments and, together with the description, serve to explain exemplary implementations of the embodiments. The illustrated embodiments are for exemplary purposes only and do not limit the scope of the claims. Throughout the drawings, identical reference numerals designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a flow chart of a method for decentralizing clusters in accordance with some embodiments of the present disclosure;
FIG. 2 shows a flow chart of a process for receiving access of at least one node through a port of a cluster service in the method for decentralizing clusters according to FIG. 1;
FIG. 3 illustrates a flow chart of a process for second connecting a business node with a cluster service in response to determining that the operation corresponding to a first access failed in a method for de-centralizing clusters according to some embodiments of the present disclosure;
FIG. 4 illustrates a flow chart of a process for establishing a first cluster by a seed node in a method for decentralizing clusters in accordance with some embodiments of the present disclosure;
fig. 5 illustrates a flow chart of a process for receiving a first node joining a first cluster through an access interface of a seed node in a method for decentralizing clusters according to some embodiments of the present disclosure;
FIG. 6 illustrates a flow chart of a process for receiving a second node joining a first cluster through an access interface of each of a plurality of nodes in the first cluster in a method for decentralizing clusters in accordance with some embodiments of the present disclosure;
FIG. 7 illustrates a flow chart of a process for mounting an access interface of a first node to a backend of a cluster service in response to determining that the first node successfully joins the cluster in a method for de-centralizing the cluster in accordance with some embodiments of the present disclosure;
FIG. 8 illustrates a flow chart of a process for sequentially starting each of a seed node and at least one replica in a method for de-centralizing a cluster according to some embodiments of the present disclosure;
FIG. 9 illustrates a block diagram of an apparatus for decentralizing clusters in accordance with the present disclosure; and
fig. 10 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, the use of the terms "first," "second," and the like to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of the elements, unless otherwise indicated, and such terms are merely used to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, they may also refer to different instances based on the description of the context.
The terminology used in the description of the various illustrated examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, the elements may be one or more if the number of the elements is not specifically limited. Furthermore, the term "and/or" as used in this disclosure encompasses any and all possible combinations of the listed items.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
In the related art, after the decentralised cluster is started, the configuration is manually modified so that subsequently joining nodes join the cluster by accessing other normal addition points in the cluster. However, in a cluster deployed based on K8s (collectively known as Kubernetes), the containerized application is automatically deployed, scaled and managed by a containerized system, and node joining into the cluster is realized by manually modifying the configuration, so that the joining process of the node is complicated.
An aspect of the present disclosure provides a method for decentralizing clusters.
Referring to fig. 1, a method 100 for decentralizing clusters according to some embodiments of the present disclosure includes:
Step S110: receiving, through a port of a cluster service, an access of at least one node, each of the at least one node configured to perform an operation to join the cluster based on the access; and
step S120: in response to determining that the operation of a first node of the at least one node is successful, an access interface of the first node is mounted to a backend of the cluster service such that a port of the cluster service is mapped to a port of an access interface of the first node.
Wherein the access interface is configured to cause a second node of the at least one node distinct from the first node to join the second node in a first cluster comprising the first node based on the operation of the second node.
According to one or more embodiments of the present disclosure, access of a node is received through a port of a cluster service, and the port of the cluster service is mapped to a port of an access interface of a first node that successfully joins a cluster by accessing the cluster service, such that other nodes that subsequently perform operations to join the cluster by accessing the cluster service may access the port of the access interface of the first node mapped to the port of the cluster service when accessing the cluster service. Because the access interface of the first node is configured to be based on the operation of joining the cluster, which is executed by other nodes accessing the cluster service, the other nodes join the first cluster to which the first node has joined; thus, other nodes that subsequently access the port of the access interface of the first node by accessing the cluster service can join the first cluster.
The first node is not limited to a seed node or a service node different from the seed node, so that the first cluster enables the decentralised cluster, and during the starting process of the decentralised cluster, the newly added node does not need to join the cluster through an access interface of the seed node. In a cluster comprising a plurality of nodes, under the condition that a seed node fails, the cluster can still be added through any other started node in the cluster, so that the problem of brain fracture possibly caused by restarting the seed node is effectively avoided.
It should be noted that, in the present disclosure, the term "seed node" refers to a node that is a first node when a cluster is established, and the "service node" includes any node that is used to implement a service discovery function, such as a data node, a client node, and a machine learning node; at the same time, a "seed node" and a "service node"
According to the method disclosed by the invention, the method can be used in a cluster based on K8s, and is matched with the automatic deployment, expansion and contraction and management of the containerized application by a containerization system, the starting sequence of the nodes in the cluster is not required to be controlled manually, and the joining of the nodes into the cluster is realized.
According to some embodiments, in step S110, a cluster IP (Cluster IP) of a cluster service (cluster service) is created in K8S as an entry for each of the at least one node to join the cluster. According to some embodiments, the cluster IP (Cluster IP) is virtual IP. According to some embodiments, each of the at least one node joins the cluster by accessing the cluster IP (Cluster IP).
According to some embodiments, in step S120, after the operation of the joining node of the first node of the at least one node is successful, the ingress interface of the first node is mounted to the backend of the cluster service, so that the cluster IP (Cluster IP) of the cluster service is mapped to the port of the access interface of the first node. According to some embodiments, the access interface of each of the at least one node is configured as a Remote Procedure Call (RPC) interface, which may receive a join request from a node requesting to join the cluster, and receive the node requesting to join the cluster.
In some embodiments, each of the at least one node is implemented by a development kit (SDK) of uniform design to join the cluster by accessing the cluster IP (Cluster IP); and an access interface implementing each of the at least one node is configured as a Remote Procedure Call (RPC) interface to receive and join a join request from a node requesting to join the cluster.
In some embodiments, at least one node is further implemented through a development kit with unified design, and after joining the cluster, related protocols are implemented through heartbeat and broadcasting, so that the functions of node information synchronization and service discovery in the cluster are completed.
In the method according to the present disclosure, the deployment process of the cluster is implemented through a development kit (SDK) of uniform design, so that in the deployment of the cluster, once a seed node as an initial (first) start point of the cluster start is first started, its specificity is lost. Without requiring the seed node to always assume a special function as an entry for the node to join the group, nor to have additional functionality. I.e. the seed node only needs an integrated development kit (SDK) providing an access interface with the above described interface configured as a Remote Procedure Call (RPC). After the cluster is started, even if the seed node fails, for other started nodes in the cluster, the access interface configured as a Remote Procedure Call (RPC) interface can accept the joining request of the node requesting to join the cluster, and the node is received to join the cluster. The method further optimizes the automation attribute of the deployment, management and maintenance processes of the clusters based on K8s, and improves the efficiency of cluster deployment and management.
In some embodiments, the at least one node includes a service node, and as shown in fig. 2, step S110, receiving, through a port of the cluster service, an access of the at least one node includes:
step S210: in response to receiving a request for starting service of the service node, the service node is in first connection with the cluster service so as to access a port of the cluster service for the first time; and
step S220: and in response to determining that the operation corresponding to the first access fails, enabling the business node to conduct second connection with the cluster service so as to conduct second access on a port of the cluster service.
Since the cluster is in the process of deployment, the seed node is required to be the initial (first) node to establish the cluster. When the cluster is not established, the operation of the business node to join the cluster by accessing the port of the cluster service fails, so that the business node repeatedly accesses the port of the cluster service. In the process, the service node continuously executes the operation of joining the cluster through the port which can be accessed repeatedly, and once the cluster is established, the service node can join the cluster by accessing the port of the cluster service, thereby realizing the automatic joining of the service node through the cluster service. By constantly accessing the ports of the cluster service, the service node is waiting for the seed node to establish the cluster. The process does not need to set the starting sequence of the nodes in the cluster, can realize the deployment and service discovery of the cluster through an automatic waiting and joining process based on the attribute of the nodes, and further improves the automation attribute of the deployment, management and maintenance process of the cluster based on K8 s.
In some embodiments, the client makes a service request through the load balancer, which first connects with the cluster service by forwarding the request to the traffic node, which sends a request to initiate the service based on the received service request of the client.
In some embodiments, as shown in fig. 3, in response to determining that the operation corresponding to the first access fails, step S220 of making a second connection between the traffic node and the cluster service includes:
step S310: acquiring a first point in time in response to determining that the operation corresponding to the first access failed; and
step S320: and responding to the time interval of the current time point from the first time point is smaller than a preset value, so that the service node performs the second connection.
When the cluster is not established, when the operation of the service node for joining the cluster by accessing the port of the cluster service fails, the service node is repeatedly connected with the cluster service within a preset time period so as to repeatedly access the port of the cluster service, thereby avoiding continuous reconnection and occupying resources.
In some embodiments, in response to determining that the operation corresponding to the first access fails, step S220, causing the business node to make a second connection with the cluster service further includes:
And in response to the time interval between the current time point and the first time point being greater than or equal to a preset value, the service node resends the request for starting the service.
When the cluster is not established, when the operation of the service node to join the cluster by accessing the port of the cluster service fails, and the time period of the service node repeatedly connecting the cluster service exceeds a preset value, and the service of the service node still fails to be started. After the cluster is started, the service node is enabled to revisit the port of the cluster service to join the cluster by enabling the service node to resend the request for starting the service, and finally the service starting of the service node is achieved.
In some embodiments, the service state of the service node is detected by a container probe, and when an abnormality in the service state of the service node is detected, the service node is caused to resend the request to initiate the service.
In some embodiments, the steps S310, S320 and the above procedure for causing the service node to resend the request for starting the service are repeated until the service start of the service node is finally achieved.
An exemplary process of establishing a cluster based on a seed node as an initial (first) node in a method according to the present disclosure is described below.
In some embodiments, the at least one node comprises a seed node, as shown in fig. 4, the method 100 further comprises:
step S410: in response to determining that the operation of the seed node failed, establishing the first cluster, the first cluster including the seed node; and
step S420: in response to the establishment of the first cluster, it is determined that the operation of the seed node was successful.
When the cluster is not established, the seed node is used as an initial (first) node for cluster startup to establish the cluster. After the seed node accesses the cluster service, when the operation of adding the seed node into the cluster fails, and the current cluster which is not started is indicated, the seed node is used as a first node to establish a first cluster containing the seed node. Based on the establishment of the first cluster, it is determined that the seed node joins the first cluster, that is, the operation of joining the seed node to the cluster is successful, so that the port of the cluster service is mapped to the access interface of the seed node, and thus the node that subsequently performs the operation of joining the cluster by accessing the port of the cluster service can access the port of the access interface of the seed node to join the cluster. When an access interface of the seed node receives a join request of a node that performs an operation to join the cluster by accessing a port of the cluster service, the node is received to join the cluster.
In the process, the initial establishment of the cluster is realized, the starting sequence of the nodes is not required to be manually set, and the initial establishment of the cluster can be realized through the automatic access of the seed nodes, so that the automatic starting of the cluster is realized.
The following is an exemplary description of the process of joining a cluster by other nodes (including service nodes and seed nodes) after a cluster is established based on the seed node as an initial (first) node in the method according to the present disclosure.
In some embodiments, as shown in fig. 5, the method 100 further comprises:
step S510: based on the access interface of the seed node receiving a join request of the first node corresponding to the operation, enabling the first cluster to comprise the first node; and
step S520: in response to the first cluster including the first node, determining that the operation of the first node was successful.
After the seed node establishes the first cluster, a joining request of the first node in the at least one node is received through an interface of the seed node, and the first node is admitted to join the first cluster. Because the first node is included in the first cluster, the success of the operation of joining the first node into the cluster is determined, so that the access interface of the first node can be mounted on the rear end of the cluster service, and the port of the cluster service is mapped to the port of the access interface of the first node. Thus, a node subsequently accessing a port of the cluster service may access the port of the access interface of the first node by accessing the port of the cluster service, and may join the first cluster by sending a join request to the access interface of the first node.
In the above process, the first node is a second node (a node immediately following the seed node) joining the first cluster after the first cluster is established based on the seed node as the initial (first) node, and joins the first cluster through the access interface of the seed node as the initial (first) node. In other embodiments according to the present disclosure, the first node may be a third node (a node immediately after the second node), a fourth node (a node immediately after the third node), etc. joining the first cluster, without limitation herein.
In some embodiments, as shown in fig. 6, the method 100 further comprises:
step S610: causing the first cluster to include the second node based on receiving a join request of the second node corresponding to the operation by an access interface of any one of one or more nodes in the first cluster; and
step S610: in response to the first cluster including the second node, determining that the operation of the second node was successful.
After the seed node establishes the first cluster and receives the nodes through the access interfaces of the seed node, the first cluster includes a plurality of nodes therein, and the access interfaces of each of the plurality of nodes may be configured to receive a join request of the node to join the node to the first cluster. And receiving a joining request of a second node based on an access interface of any one of the plurality of nodes, so that the first cluster comprises the second node, and joining the second node into the first cluster is realized.
In some embodiments, when a second node performs an operation to join a cluster by accessing a port of a cluster service, the access interface of one of the plurality of nodes in the first cluster is adapted by a load balancer to receive a join request of the second node.
In some embodiments, as shown in fig. 7, in step S120, in response to determining that the first node successfully joins the cluster, mounting the access interface of the first node to the backend of the cluster service includes:
step S710: acquiring a service state of the first node in response to determining that the operation of the first node is successful; and
step S720: and in response to determining that the service state of the first node is normal, mounting an access interface of the first node to the back end of the cluster service.
Because the specific service function of the node is pulled up after the node is successfully accessed to the cluster, when the node joins the cluster through the cluster service, the service of the node is started, the node is ensured to be successfully joined to the cluster by acquiring the service state of the node as normal service, and meanwhile, the function of an access interface is ready, at the moment, the access interface of the node can be mounted to the rear end of the cluster service, so that the node which is subsequently joined through accessing the cluster service and can access the access interface of the node which is already joined to the cluster successfully, and the cluster is joined.
In some embodiments, the service status of a node is detected by a probe within a container. In some embodiments, the probes of the container include readiness probes corresponding to seed nodes, readiness probes and liveness probes corresponding to service nodes, and the like, without limitation.
In the related art, at cluster deployment time, it is declared that a seed node has multiple copies. When a cluster is started, the copies may form a cluster respectively due to the simultaneous starting, thereby causing brain fracture. To solve the above-described problems, according to some embodiments of the present disclosure, the at least one node includes a seed node and at least one copy corresponding to the seed node; and wherein step S210, in response to determining that the operation of the first node of the at least one node is successful, further comprises:
in response to the operation of the seed node and each of the at least one copy being successful, each of the seed node and each of the at least one copy is sequentially started to normalize a service state of only one of the seed node or the at least one portion at a same time.
By sequentially starting the seed nodes and at least one copy of the seed nodes, only one seed node (or copy) is running at the same time, and the situation that a plurality of copies are started simultaneously to form initial clusters respectively to cause brain fracture is avoided.
In some embodiments, the startup order of the services of the node is controlled by a statefulset or the like component.
In some embodiments, sequentially starting each of the seed node and the at least one replica as shown in fig. 8 includes:
step S810: in response to determining that the service state of the seed node is service normal, disabling the service state of each of the at least one copy; and
step S820: and in response to determining that the service state of the seed node is service failure, starting a first copy in the at least one copy, and enabling the service state of the first copy to be service normal.
By enabling other copies of the seed node to be in service failure when the service of the seed node is started, only one seed node (or copy) is operated at the same time, and simultaneously, when the seed node is in failure, one copy of the other copies is started, so that the situation that a plurality of copies are started simultaneously to form initial clusters respectively to cause brain fracture is avoided.
It should be understood that, the seed node and each of at least one copy corresponding to the seed node in the disclosure refer to nodes having functions as initial (first) nodes established as a cluster, and serve as backup and disaster prevention between each other.
According to another aspect of the present disclosure, as shown in fig. 9, there is also provided an apparatus 900 for decentralizing a cluster, including: a receiving unit 910 configured to receive an access of at least one node through a port of a cluster service, each of the at least one node being configured to perform an operation to join the cluster based on the access; and a mounting unit 920 configured to mount an access interface of a first node of the at least one node to a back end of the cluster service in response to determining that the operation of the first node is successful, such that a port of the cluster service is mapped to a port of an access interface of the first node, wherein the access interface is configured to cause a second node of the at least one node to join a first cluster including the first node based on the operation of the second node.
In some embodiments, the at least one node comprises a service node, and the receiving unit 910 comprises: a first connection unit, configured to make a first connection between the service node and the cluster service in response to receiving a request for starting the service of the service node, so as to make a first access to a port of the cluster service; and a second connection unit configured to, in response to determining that the operation corresponding to the first access fails, make a second connection between the service node and the cluster service to make a second access to a port of the cluster service.
In some embodiments, the second connection unit includes: an acquisition unit configured to acquire a first point in time in response to determining that the operation corresponding to the first access fails; and a second connection subunit configured to make the service node perform the second connection in response to a time interval of the current time point from the first time point being smaller than a preset value.
In some embodiments, the receiving unit comprises: and the control unit is used for enabling the service node to resend the corresponding service starting request in response to the fact that the time interval between the current time point and the first time point is larger than a preset value.
In some embodiments, the at least one node comprises a seed node, the apparatus further comprising: a building unit that, in response to determining that the operation of the seed node failed, builds the first cluster, the first cluster including the seed node; and a first determining unit configured to determine that the operation of the seed node is successful in response to establishment of the first cluster.
In some embodiments, the apparatus 900 further comprises: a receiving subunit configured to cause the first cluster to include the first node based on receipt of a join request by the first node corresponding to the operation by an access interface of the seed node; and a second determining unit configured to determine that the operation of the first node is successful in response to the first cluster including the first node.
In some embodiments, the receiving subunit is further configured to cause the first cluster to include the second node based on the access interface of any one of the plurality of nodes in the first cluster receiving a join request corresponding to the operation by the second node; and wherein the second determining unit is further configured to determine that the operation of the second node was successful in response to the first cluster including the second node.
According to another aspect of the present disclosure, there is also provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores a computer program which, when executed by the at least one processor, implements a method according to the above.
According to another aspect of the present disclosure, there is also provided a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements a method according to the above.
According to another aspect of the present disclosure, a computer program product is also provided.
Referring to fig. 10, a block diagram of a structure of an electronic device 1000 that may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM1002, and the RAM1003 are connected to each other by a bus 1004. An input/output (I/O) access interface 1005 is also connected to bus 1004.
Various components in device 1000 are connected to I/O access interface 1005, including: an input unit 1006, an output unit 1007, a storage unit 1008, and a communication unit 1009. The input unit 1006 may be any type of device capable of inputting information to the device 1000, the input unit 1006 may receive input numeric or character information, and generate key signal inputs related to user settings and/or function control of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and/or a remote control. The output unit 1007 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. Storage unit 1008 may include, but is not limited to, magnetic disks, optical disks. Communication unit 1009 allows device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and/or chipsets, such as bluetooth (TM) devices, 1302.11 devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs the various methods and processes described above, such as method 100. For example, in some embodiments, the method 100 may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM1002 and/or communication unit 1009. One or more of the steps of the method 200 described above may be performed when the computer program is loaded into RAM 1003 and executed by the computing unit 1101. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the method 100 by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the foregoing methods, systems, and apparatus are merely exemplary embodiments or examples, and that the scope of the present invention is not limited by these embodiments or examples but only by the claims following the grant and their equivalents. Various elements of the embodiments or examples may be omitted or replaced with equivalent elements thereof. Furthermore, the steps may be performed in a different order than described in the present disclosure. Further, various elements of the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after the disclosure.

Claims (19)

1. A method for decentralizing clusters, comprising:
Receiving, through a port of a cluster service, an access of at least one node, each of the at least one node configured to perform an operation to join the cluster based on the access; and
in response to determining that the operation of a first node of the at least one node was successful, mounting an access interface of the first node to a backend of the cluster service such that a port of the cluster service is mapped to a port of an access interface of the first node, wherein,
the access interface is configured to cause a second node of the at least one node distinct from the first node to join the second node in a first cluster that includes the first node based on the operation of the second node.
2. The method of claim 1, wherein the at least one node comprises a traffic node, and the receiving access by the at least one node through a port of a cluster service comprises:
in response to receiving a request for starting service of the service node, the service node is in first connection with the cluster service so as to access a port of the cluster service for the first time; and
and in response to determining that the operation corresponding to the first access fails, enabling the business node to conduct second connection with the cluster service so as to conduct second access on a port of the cluster service.
3. The method of claim 2, wherein the causing the business node to make a second connection with the cluster service in response to determining that the operation corresponding to the first access failed comprises:
acquiring a first point in time in response to determining that the operation corresponding to the first access failed; and
and responding to the time interval of the current time point from the first time point is smaller than a preset value, so that the service node performs the second connection.
4. The method of claim 3, wherein the receiving access of at least one node through a port of a cluster service further comprises:
and in response to the time interval between the current time point and the first time point being greater than or equal to a preset value, the service node resends the request for starting the service.
5. The method of claim 1, wherein the at least one node comprises a seed node, the method further comprising:
in response to determining that the operation of the seed node failed, establishing the first cluster, the first cluster comprising the seed node; and
in response to the establishment of the first cluster, it is determined that the operation of the seed node was successful.
6. The method of claim 5, further comprising:
based on the access interface of the seed node receiving a join request of the first node corresponding to the operation, enabling the first cluster to comprise the first node; and
in response to the first cluster including the first node, determining that the operation of the first node was successful.
7. The method of claim 6, further comprising:
causing the first cluster to include the second node based on receiving a join request of the second node corresponding to the operation by an access interface of any one of a plurality of nodes in the first cluster; and
in response to the first cluster including the second node, determining that the operation of the second node was successful.
8. The method of claim 1, wherein the mounting the access interface of the first node to the backend of the cluster service in response to determining that the first node successfully joined the cluster comprises:
acquiring a service state of the first node in response to determining that the operation of the first node is successful; and
and in response to determining that the service state of the first node is normal, mounting an access interface of the first node to the back end of the cluster service.
9. The method of claim 8, wherein the at least one node comprises a seed node and at least one copy corresponding to the seed node; and wherein said mounting an access interface of a first node of said at least one node to a backend of said cluster service in response to determining that said operation of said first node is successful further comprises:
and in response to the operation of the seed node and each of the at least one replica being successful, sequentially initiating each of the seed node and the at least one replica such that a service state of only one of the seed node or the at least one replica is normal at the same time.
10. The method of claim 9, wherein the sequentially initiating each of the seed node and the at least one copy comprises:
in response to determining that the service state of the seed node is service normal, disabling the service state of each of the at least one copy; and
and in response to determining that the service state of the seed node is service failure, starting a first copy in the at least one copy, and enabling the service state of the first copy to be service normal.
11. An apparatus for decentralizing clusters, comprising:
a receiving unit configured to receive an access of at least one node through a port of a cluster service, each of the at least one node configured to perform an operation to join a cluster based on the access; and
a mounting unit configured to mount an access interface of a first node of the at least one node to a backend of the cluster service in response to determining that the operation of the first node is successful, such that a port of the cluster service is mapped to a port of an access interface of the first node,
the access interface is configured to cause a second node of the at least one node distinct from the first node to join the second node in a first cluster that includes the first node based on the operation of the second node.
12. The apparatus of claim 11, wherein the at least one node comprises a service node, the receiving unit comprising:
a first connection unit, configured to make a first connection between the service node and the cluster service in response to receiving a request for starting the service of the service node, so as to make a first access to a port of the cluster service; and
And a second connection unit configured to, in response to determining that the operation corresponding to the first access fails, make a second connection between the service node and the cluster service to make a second access to a port of the cluster service.
13. The apparatus of claim 12, wherein the second connection unit comprises:
an acquisition unit configured to acquire a first point in time in response to determining that the operation corresponding to the first access fails; and
and the second connection subunit is configured to enable the service node to perform the second connection in response to the time interval between the current time point and the first time point being smaller than a preset value.
14. The apparatus of claim 13, wherein the receiving unit further comprises:
and the control unit is used for enabling the service node to resend the corresponding service starting request in response to the fact that the time interval between the current time point and the first time point is larger than a preset value.
15. The apparatus of claim 11, wherein the at least one node comprises a seed node, the apparatus further comprising:
a building unit that, in response to determining that the operation of the seed node fails, builds the first cluster, the first cluster including the seed node; and
A first determining unit configured to determine that the operation of the seed node is successful in response to establishment of the first cluster.
16. The apparatus of claim 15, further comprising:
a receiving subunit configured to cause the first cluster to include the first node based on receipt of a join request by the first node corresponding to the operation by an access interface of the seed node; and
a second determining unit configured to determine that the operation of the first node is successful in response to the first cluster including the first node.
17. The apparatus of claim 16, wherein the receiving subunit is further configured to cause the first cluster to include the second node based on an access interface of any of a plurality of nodes in the first cluster receiving a join request corresponding to the operation by the second node; and wherein
The second determining unit is further configured to determine that the operation of the second node is successful in response to the first cluster including the second node.
18. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the method comprises the steps of
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-10.
19. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-10.
CN202110949191.6A 2021-08-18 2021-08-18 Method and apparatus for decentralizing clusters Active CN113660339B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110949191.6A CN113660339B (en) 2021-08-18 2021-08-18 Method and apparatus for decentralizing clusters

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110949191.6A CN113660339B (en) 2021-08-18 2021-08-18 Method and apparatus for decentralizing clusters

Publications (2)

Publication Number Publication Date
CN113660339A CN113660339A (en) 2021-11-16
CN113660339B true CN113660339B (en) 2023-08-04

Family

ID=78480959

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110949191.6A Active CN113660339B (en) 2021-08-18 2021-08-18 Method and apparatus for decentralizing clusters

Country Status (1)

Country Link
CN (1) CN113660339B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8892689B1 (en) * 2008-04-30 2014-11-18 Netapp, Inc. Method and apparatus for a storage server to automatically discover and join a network storage cluster
CN107087032A (en) * 2017-05-11 2017-08-22 腾讯科技(深圳)有限公司 Realize the method and apparatus that cluster is set up
CN107222342A (en) * 2017-05-27 2017-09-29 郑州云海信息技术有限公司 A kind of cluster management network collocation method
CN109257195A (en) * 2017-07-12 2019-01-22 华为技术有限公司 The fault handling method and equipment of cluster interior joint
CN111090537A (en) * 2019-12-16 2020-05-01 无锡华云数据技术服务有限公司 Cluster starting method and device, electronic equipment and readable storage medium
CN111277460A (en) * 2020-01-17 2020-06-12 江苏满运软件科技有限公司 ZooKeeper containerization control method and device, storage medium and electronic equipment
CN111478953A (en) * 2020-03-27 2020-07-31 北京金山云网络技术有限公司 Self-construction method, device, system, equipment and storage medium of server cluster
CN111857963A (en) * 2020-07-28 2020-10-30 山东超越数控电子股份有限公司 Container arrangement implementation method, device, equipment and medium for Proxmox VE
CN112311596A (en) * 2020-10-22 2021-02-02 深圳前海微众银行股份有限公司 Data management method, device, equipment and computer storage medium
CN112910796A (en) * 2021-01-27 2021-06-04 北京百度网讯科技有限公司 Traffic management method, apparatus, device, storage medium, and program product

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103179178B (en) * 2011-12-26 2016-06-15 杭州华三通信技术有限公司 The method and apparatus of aggregation group member port between extension cluster

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8892689B1 (en) * 2008-04-30 2014-11-18 Netapp, Inc. Method and apparatus for a storage server to automatically discover and join a network storage cluster
CN107087032A (en) * 2017-05-11 2017-08-22 腾讯科技(深圳)有限公司 Realize the method and apparatus that cluster is set up
CN107222342A (en) * 2017-05-27 2017-09-29 郑州云海信息技术有限公司 A kind of cluster management network collocation method
CN109257195A (en) * 2017-07-12 2019-01-22 华为技术有限公司 The fault handling method and equipment of cluster interior joint
CN111090537A (en) * 2019-12-16 2020-05-01 无锡华云数据技术服务有限公司 Cluster starting method and device, electronic equipment and readable storage medium
CN111277460A (en) * 2020-01-17 2020-06-12 江苏满运软件科技有限公司 ZooKeeper containerization control method and device, storage medium and electronic equipment
CN111478953A (en) * 2020-03-27 2020-07-31 北京金山云网络技术有限公司 Self-construction method, device, system, equipment and storage medium of server cluster
CN111857963A (en) * 2020-07-28 2020-10-30 山东超越数控电子股份有限公司 Container arrangement implementation method, device, equipment and medium for Proxmox VE
CN112311596A (en) * 2020-10-22 2021-02-02 深圳前海微众银行股份有限公司 Data management method, device, equipment and computer storage medium
CN112910796A (en) * 2021-01-27 2021-06-04 北京百度网讯科技有限公司 Traffic management method, apparatus, device, storage medium, and program product

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王毅睿 ; 邢少华 ; 罗亚男 ; 孙芳 ; .基于EJB/CORBA的分布计算系统的研究.铁道通信信号.2006,(第06期),全文. *

Also Published As

Publication number Publication date
CN113660339A (en) 2021-11-16

Similar Documents

Publication Publication Date Title
US20170163479A1 (en) Method, Device and System of Renewing Terminal Configuration In a Memcached System
US20170163478A1 (en) Method,electronic device and system for updating client configuration in key-value pair database
EP3817338B1 (en) Method and apparatus for acquiring rpc member information, electronic device and storage medium
WO2016107443A1 (en) Snapshot processing method and related device
CN111181765A (en) Task processing method and device
CN112559498B (en) Method and device for constructing distributed architecture of time sequence space-time database system
CN107818027B (en) Method and device for switching main name node and standby name node and distributed system
CN113660339B (en) Method and apparatus for decentralizing clusters
WO2023229531A2 (en) Data transmission method and apparatus, terminal, and storage medium
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN113326192B (en) Application testing method, device, equipment and storage medium for mobile terminal
JP2010086137A (en) Message queuing method and program
CN113420275B (en) Data connection processing method, related device and computer program product
CN113596197B (en) Address switching method and device, electronic equipment and storage medium
CN116193481A (en) 5G core network processing method, device, equipment and medium
CN113641688B (en) Node updating method, related device and computer program product
KR20210040314A (en) Point to point connection method, apparatus, electronic device, storage medium and computer program
CN114567540B (en) Master-slave node switching method, device, equipment, medium and program product
CN114513524B (en) Resource synchronization method and device, electronic equipment and storage medium
CN113596172B (en) Method and device for updating nodes in distributed cluster
CN113992690B (en) Message transmission method, device, equipment and storage medium
CN116614357A (en) Configuration information issuing method and device, electronic equipment and storage medium
CN117201483A (en) File transmission method, device, electronic equipment and storage medium
CN117389927A (en) Data processing method, device, equipment and medium for automobile open system architecture
CN114598743A (en) Service discovery method, device, electronic equipment and 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