Cluster management method, system and device and storage medium
By setting up multiple business groups in a multi-node cluster system and dynamically switching main business devices, the problem of excessive load on management nodes is solved and system reliability and business continuity are improved.
Patent Information
- Application Number
- CN202411151489.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-10-11
AI Technical Summary
In the existing multi-node cluster system, the management node is overloaded, resulting in reduced system reliability.
By setting up multiple service groups in the cluster, and the management master device determining the service master device based on node status information, dynamic switching and load sharing of the service master device are realized, and the TRP protocol is used for master and backup management and data synchronization.
It effectively reduces the excessive load on business processing nodes, improves system reliability, and ensures the normal operation and business continuity of the cluster.
Smart Images

Figure CN118764537A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a cluster management method, system, device and storage medium. Background Art
[0002] In current multi-node cluster systems, one cluster node is usually elected from multiple cluster nodes as the management node, which is responsible for all services of the entire cluster (such as traffic forwarding), and one or more other cluster nodes are used as backup nodes to achieve node backup redundancy. However, if the management node is responsible for all services of the entire cluster, it is easy for the service processing node to be overloaded, reducing system reliability. Summary of the invention
[0003] The present invention provides a cluster management method, system, device and storage medium to solve the problem that in the existing cluster system, the service processing node is prone to overload, thereby reducing the system reliability.
[0004] In a first aspect, an embodiment of the present application provides a cluster management method, wherein there is a management master device among multiple node devices of the cluster, the multiple node devices are divided into two or more service groups, each service group includes two or more node devices, and a single node device belongs to one or more service groups; the method includes:
[0005] The management master device determines the service master device of each service group according to the status information of each node device, and schedules the service master device of each service group to execute different services.
[0006] Optionally, determining a service master device of each service group according to the status information of each node includes:
[0007] The management master device determines a service master device from among all the node devices in the service group according to at least one of the member health, member priority and load of each node device in the service group.
[0008] Optionally, determining a service master device from among all node devices in the service group according to at least one of a member health, a member priority, and a load of each node device in the service group includes:
[0009] The management master device determines the online node devices in the business group according to the online status of each node device in the business group;
[0010] The management master device determines a node device with the highest member priority in the service group according to the member priority, and obtains the service master device of the service group.
[0011] Optionally, determining a service master device from among all node devices in the service group according to at least one of a member health, a member priority, and a load of each node device in the service group includes:
[0012] According to the online status of each node device in the business group, the management master device determines the online node device in the business group, and then determines the online node device with the highest member priority to obtain the priority device;
[0013] When there are two or more priority devices, the management master device determines the priority device with the smallest load to obtain the service master device of the service group.
[0014] Optionally, determining a service master device from among all node devices in the service group according to at least one of a member health, a member priority, and a load of each node device in the service group includes:
[0015] After determining the online node device in the business group according to the online status of each node device in the business group, the management master device determines the online node device with the largest member health in the business group to obtain the first device;
[0016] When there are two or more first devices, the management master device determines the first device with the highest member priority in the service group to obtain the second device;
[0017] When there are two or more second devices, the management master device determines the second device with the smallest load in the service group to obtain the service master device of the service group.
[0018] Optionally, before determining the service master device of each service group, the method further includes:
[0019] When it is necessary to update the parameters of each node device, the management master device will synchronously configure the service-related parameters including VRRP rules to each node device, and update to obtain two or more service groups;
[0020] Based on the updated information of each service group, the management master device determines the service master device of each service group.
[0021] Optionally, after scheduling the service master devices of each service group to execute different services, the method further includes:
[0022] The management master device determines whether it is necessary to switch the service master device of the service group according to the status information of the service master device;
[0023] When the service master device of the service group needs to be switched, the management master device determines the service standby device with the best status in the service group according to the status information of all service standby devices in the service group, and obtains the target node device;
[0024] The management master device switches the target node device to the service master device and multicasts a notification to all node devices.
[0025] Optionally, after scheduling the service master devices of each service group to execute different services, the method further includes:
[0026] Each node device determines whether to switch the management master device according to the heartbeat message of the management master device;
[0027] If it is determined that the management master device needs to be switched, each node device obtains the status ranking data of all node devices, and switches the node device ranked first in the status ranking data to be the new management master device.
[0028] Optionally, determining whether the management master device needs to be switched according to the heartbeat message of the management master device includes:
[0029] If the heartbeat message of the management master device is not received within a timeout period, each node device determines the number of timeouts of the heartbeat message of the management master device;
[0030] When the number of heartbeat message timeouts of the management master device reaches a preset number, each node device determines that the management master device needs to be switched.
[0031] In a second aspect, an embodiment of the present application provides a cluster management system, including a cluster formed by multiple node devices; the multiple node devices include a management master device, the multiple node devices are divided into two or more service groups, each of the service groups includes two or more node devices, and a single node device belongs to one or more service groups;
[0032] The management master device is used to determine the service master device of each service group according to the status information of each node device, and schedule the service master device of each service group to execute different services.
[0033] In a third aspect, an embodiment of the present application provides a network device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned cluster management method or the functions of each node device in the above-mentioned cluster management system are implemented.
[0034] In a fourth aspect, an embodiment of the present application provides a readable storage medium, which stores a computer program, characterized in that when the computer program is executed by a processor, it implements the steps of the above-mentioned cluster management method, or the functions of each node device in the cluster management system.
[0035] In a solution provided by the above cluster management method, system, device and storage medium, there is a management master device among the multiple node devices of the cluster, and the multiple node devices are divided into two or more business groups, each business group includes two or more node devices, and a single node device belongs to one or more business groups; the management master device determines the business master device of each business group according to the status information of each node, and schedules the business master device of each business group to execute different businesses. In this embodiment, by setting up multiple business groups in the cluster, the management master device can dynamically switch the master and backup roles of each node device in the business group, so that the business master devices in different business groups execute different businesses, that is, different businesses can run on different node devices, realizing load sharing, effectively reducing the situation where the business processing node is overloaded, and improving system reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0037] Figure 1 is a schematic diagram of a cluster management system in one embodiment of the present invention;
[0038] Figure 2 is a schematic diagram of a cluster structure in one embodiment of the present invention;
[0039] Figure 3 is a flow chart of a cluster management method in one embodiment of the present invention;
[0040] Figure 4 and Figure 5 This is a schematic diagram of the master and backup roles of a VRRP backup group in one embodiment of the present invention;
[0041] Figure 6 is a physical topology diagram of a cluster in one embodiment of the present invention;
[0042] Figure 7 This is a schematic diagram of the switching of the primary and backup roles of a service group in one embodiment of the present invention;
[0043] Figure 8 is a schematic diagram of a structure of a network device in one embodiment of the present invention;
[0044] Fig. 9 It is another structural schematic diagram of a network device in one embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or their collections. It should also be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0047] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0048] References to "one embodiment" or "some embodiments" etc. described in the specification of the present invention mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0049] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0050] In view of the fact that the existing cluster is prone to overload, the present invention proposes a cluster management method. The implementation of the present invention requires the expansion of the existing Virtual Router Redundancy Protocol (VRRP) and proposes a new redundant backup protocol (TP-LINK Redundancy Protocol, TRP), which is carried on the User Datagram Protocol (User Datagram Protocol, UDP). The redundant backup protocol includes a master-slave management protocol and a data synchronization protocol. In this embodiment, only the master-slave management protocol is described.
[0051] Among them, the TRP protocol includes three types of messages: Hello messages, node management messages, and business group status management messages. Hello messages are also called heartbeat messages, which are used for node devices to join a high-availability cluster (High Availability, HA), hereinafter referred to as clusters. The node devices in the cluster discover each other through Hello messages. When the Hello message of a node device is not received within a period of time, such as when the Hello message of a node device is lost three times, it can be considered that the node device is offline. Each node device collects the status information of other node devices (such as online status, MAC address, priority, etc.) and uses it to elect and manage the main device.
[0052] Node devices can confirm each other's online status through Hello messages. Node management messages are used for information management at the node level within the cluster. For example, the management master device assigns a node ID (node number) to each node device to facilitate subsequent node device status management of each business group, configuration check and synchronization of management standby devices, etc.
[0053] The business group status management message is used for information management at the business group level within the cluster. For example, the management master device notifies each business group to switch business roles (such as switching the business master device of the business group) and reports the member health status of each node device in each business group, so that the management master device can adjust the business allocation strategy in real time.
[0054] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0055] The cluster management method provided in the embodiment of the present application can be applied in Figure 1In the cluster management system shown. The cluster management system includes a switch and a cluster including multiple node devices. Among them, each node device communicates through a wired and / or wireless network; each node device is connected to the switch, and the switch is used for internal cluster negotiation (i.e., determining the main device and the backup device) and data backup. The node devices of the cluster cooperate to complete related services, such as data forwarding services. Each node device can be any network device such as a router, a firewall, or a load balancer.
[0056] Among them, there is a management master device in the multiple node devices of the cluster, and the multiple node devices are divided into two or more business groups. Each business group includes two or more node devices, and a single node device belongs to one or more business groups. All node devices in the same business group can implement the same type of business. The management master device is used to perform role switching management and business scheduling for each business group in the cluster. Specifically, according to the status information of each node, the business master device of each business group is determined, and the business master device of each business group is scheduled to perform different businesses.
[0057] In this embodiment, by dividing the multiple node devices of the cluster into two or more business groups, each business group is uniformly managed by the management master device in the multiple node devices, and the master-slave role of each node device in the business group can be dynamically switched, so that the business master devices in different business groups execute different businesses, that is, different businesses can run on different node devices, thereby realizing load sharing, effectively reducing the situation where the business processing nodes are overloaded, and improving system reliability.
[0058] In addition, there is a management master device among the multiple node devices of the cluster, and the multiple node devices are divided into two or more service groups. Each service group may include only one node device. The management master device can schedule node devices in different service groups to perform different services.
[0059] In other embodiments, multiple node devices in a cluster may also form a service group, and the management master device is used to perform role switching management and service scheduling for the service group to achieve service scheduling between different node devices.
[0060] In one embodiment, each node device of the cluster is a VRRP member, that is, one or more network interfaces of each node device are configured with VRRP. When a single node device belongs to multiple service groups, in fact, different network interfaces of the node device belong to different service groups. The cluster has two levels: configuration management and service carrying. Each node device can be divided into two roles: master and slave at each level. Master can refer to the management master device or the service master device, depending on the specific context, and Slave can be the management backup device or the service backup device. Therefore, the management role and the service role are relatively independent. A node device can be both the management master device of HA and the service master device of a certain service group.
[0061] That is, if Figure 2 As shown, all node devices of the cluster form a management group, and multiple node devices are divided into two or more business groups (such as business group 1, business group N, N is an integer greater than 1). Among them, the management group includes a management master device and multiple management backup devices, and the number of management backup devices is greater than 2. Each business group includes two or more node devices. Each node device of the cluster is a VRRP member; all node devices in the same business group can implement the same type of business. Among them, the management master device needs to determine the business master device of each business group according to the status information of each node, and schedule the business master device of each business group to perform different services (such as data forwarding services). Each node device in each business group responds to the master-slave role switching instruction of the management master device to switch roles, and the node device responds to the instruction of the management master device to switch to the business master device in the business group, that is, responds to the business scheduling of the management master device, and executes the business assigned by the management master device. In one embodiment, when the total number of node devices in the cluster is 1 or 2, there may be no management backup device or only one management backup device, that is, the number of management backup devices is 0 or 1.
[0062] In this embodiment, all node devices in the cluster are regarded as a management group, and are divided into two or more business groups. Among them, the management group includes a management master device and multiple management backup devices; each business group includes two or more node devices, and each node device is a VRRP member. On the one hand, by setting multiple business groups, the management master device can dynamically switch the master and backup roles of each node device in the business group, so that the business master devices in different business groups perform different services. Since the priorities of members in different business groups are different, different services can run on different node devices, realizing load sharing, effectively reducing the situation where the business processing node is overloaded, and improving system reliability. On the other hand, when the management master device fails, the management backup device can quickly select a new management master device to perform business scheduling and node device management; at the same time, when the business master device fails, it can also quickly switch to a new business master device under the control of the management master device. This mechanism ensures the normal operation of the cluster, reduces the service interruption time, and tries to make users feel no sense of service interruption, further improving the reliability of the system.
[0063] In addition, multiple management backup devices are redundant in the management group, and device redundancy is also achieved in the business group. Compared with the traditional dual-machine hot standby, this embodiment has more nodes and can support flexible networking forms such as 1:N and 1+N. It can achieve multi-machine hot standby of management main devices and business main devices, with a higher degree of redundancy, further improving system reliability.
[0064] In one embodiment, the same node device can join different business groups, which is determined according to actual needs. For example, the same node device can be divided into different business groups according to the interface type (interface purpose) in the node device. When the same node device belongs to two or more business groups, the same node device has different priorities in different business groups. By setting up multiple business groups, the same node device can belong to two or more business groups, which increases the diversity of business groups. When the subsequent management master device schedules the business master devices in different business groups to perform different services, due to the different priorities of members in different business groups, different services can be ensured to run on different node devices, further realizing load sharing, effectively reducing the situation where the business processing node is overloaded, and improving system reliability.
[0065] In other embodiments, the priorities of the same node device in different service groups may also be the same to meet different service execution requirements of users.
[0066] In one embodiment, if Figure 3 As shown, a cluster management method is provided, which is applied in Figure 2 The cluster in is taken as an example to illustrate the process, which includes the following steps:
[0067] S10: The management master device determines the service master device of each service group according to the status information of each node;
[0068] S20: The management master device schedules the service master devices of each service group to execute different services.
[0069] In this embodiment, all node devices of the cluster form a management group, and the management group includes one management master device and multiple management backup devices. That is, there is one management master device among the multiple node devices of the cluster, and the remaining node devices serve as backup devices of the management master device, so that the management master device can be switched when the management master device fails. Multiple node devices are divided into two or more service groups, that is, the cluster includes two or more service groups, and each service group includes two or more node devices.
[0070] When a cluster has a management master device, the management master device needs to determine the service master device of each service group based on the status information of each node, and after receiving a service request, respond to the service request and schedule the service master device of the corresponding service group to execute different services. When performing service scheduling, different service groups can be scheduled to execute services corresponding to different service requests.
[0071] The service groups can be divided according to the number of node devices in the cluster. The more node devices in the cluster, the more service groups are divided. In other embodiments, each service group can be divided according to service type, and different service groups execute different types of services.
[0072] In this embodiment, multiple business groups are set up, and the management master device can dynamically switch the master and backup roles of each node device in the business group, so that the business master devices in different business groups execute different businesses, and different businesses can run on different node devices, thereby achieving load sharing, effectively reducing the situation where the business processing node is overloaded, and improving system reliability.
[0073] Among them, each node device is a VRRP member. When the management master device fails, the remaining node devices in the cluster can serve as management backup devices and quickly elect a new management master device to perform business scheduling and node device management. At the same time, when the business master device fails, it can also quickly switch roles under the control of the management master device, ensuring the normal operation of the cluster and timely completion of business, further improving the reliability of the system.
[0074] In addition, multiple management backup devices are redundant in the cluster, and redundancy is also achieved in the business group. Compared with dual-machine hot standby, this embodiment has more nodes and can support flexible networking forms such as 1:N and 1+N. It can achieve multi-machine hot standby of management main devices and business main devices, with a higher degree of redundancy, further improving system reliability.
[0075] In one embodiment, after step S10, that is, after scheduling the service master devices of each service group to execute different services, the method further specifically includes the following steps:
[0076] S30: The management master device determines whether it is necessary to dynamically switch the master and backup roles of each node device in the service group according to the status information of each service master device, so as to ensure that the service master device of each service group completes the corresponding service.
[0077] After the management master device responds to the service request and schedules the service master devices of each service group to perform different services, the management master device also needs to obtain the status information of each node device (including the service master device) so as to dynamically switch the master-slave roles of each node device in the service group according to the status information of each service master device to ensure that the service master devices of each service group complete the corresponding services.
[0078] For example, when the management master device discovers that an interface failure (link failure) occurs in a service master device of a certain service group, it commands the service master device to switch to a service backup device, and determines a new service master device based on the status information of each service backup device in the service group, so that the new service master device can take over the work of the original service master device, execute its corresponding service, and ensure that the service is completed normally.
[0079] It is important to understand that the Virtual Routing Redundancy Protocol (VRRP) combines multiple devices into a virtual device, and implements the backup of the default gateway by configuring the IP address of the virtual device as the default gateway; when a gateway device fails, the VRRP mechanism can elect a new gateway device (gateway interface) to take on data traffic, thereby ensuring reliable communication on the network. A VRRP backup group (VRRP Group) consists of multiple device interfaces working together, and device interfaces can join different VRRP backup groups according to different needs.
[0080] In this embodiment, each node device is a VRRP member. Multiple VRRP backup groups can be added to a business group according to the interface type, and a node device can belong to different business groups, that is, a node device belongs to multiple VRRP backup groups. When it is necessary to switch the roles of the business master device and the business backup device in the business group, such as when the business master device in the business group fails, the business master device switches, and the master-slave role switching of the corresponding VRRP backup group can be realized synchronously, thereby realizing interface linkage switching, ensuring the connectivity of the upper and lower interfaces (such as the upper interface WAN port, the lower interface LAN port), avoiding the reliability failure problem caused by the inconsistency of the upper and lower interfaces due to the master-slave switching in the traditional VRRP backup group, and improving the reliability of the system.
[0081] like Figure 4As shown in the figure, a service group includes three node devices, namely, device A, device B and device C. Device A is the service master device in the service group, and devices B and C are both service backup devices Slave. Device A, device B and device C all include two interfaces, GE1 and GE2. GE1 and GE2 can be LAN interface and WAN interface respectively. Therefore, two VRRP backup groups are included in the service group: VRRP1 and VRRP2. Figure 5 As shown in the figure, when the GE1 interface of Master device A fails, the master of the service group will switch to device B, and device B will become the new service master device. When the service master device switches, the master-backup relationship of all VRRP backup groups on the device will switch synchronously, and the services of interface GE1 and interface GE2 of device A will be transferred to device B, realizing interface linkage switching and ensuring upstream and downstream connectivity.
[0082] In this embodiment, the service group includes three node devices, namely device A, device B and device C, and the service group includes two VRRP backup groups. This is only for illustrative purposes. In other embodiments, the service group also includes other numbers of node devices and VRRP backup groups, which will not be repeated here.
[0083] In one embodiment, in step S30, that is, according to the status information of each service master device, each node device in the service group is dynamically switched to a master / slave role, which specifically includes the following steps:
[0084] S31: The management master device determines whether it is necessary to switch the service master device of the service group according to the status information of the service master device.
[0085] During the working process, the management master device needs to determine the status information of the business master device, which includes the online status, member health and interface failure status. Then, based on the status information of the business master device and the status information of the business backup devices in the same business group, it is determined whether it is necessary to switch the business master device of the business group. For example, if no heartbeat message reported by the business master device is received within a certain period of time, it means that the business master device is offline and it is necessary to switch the business master device of its business group. For another example, when the management master device receives the member health reported by the business master device and determines that the member health has decreased (such as interface failure), it determines that it is necessary to switch the business master device of the business group.
[0086] In addition, in other embodiments, it is also necessary to determine whether it is necessary to switch the service master device of the service group according to the activation of the preemption function. For example, the original service master device is switched to the service backup device due to a fault. After the original service master device recovers from the fault, if the member priority of the original service master device is higher than the current service master device in the service group, and the preemption function of the original service master device is enabled, it is determined that the service master device of the service group needs to be switched.
[0087] S32: When the service master device of the service group needs to be switched, the management master device determines the service standby device with the best status in the service group according to the status information of all service standby devices in the service group, and obtains the target node device.
[0088] S33: The management master device switches the target node device to the service master device, and multicasts a notification to all node devices.
[0089] When it is necessary to switch the service master device of the service group, the management master device determines the service backup device with the best status in the service group based on the status information of all service backup devices in the service group, obtains the target node device, and then switches the target node device to the service master device and multicasts a notification to all node devices.
[0090] The process of determining the target node device refers to the process of determining the service master device mentioned above, which will not be repeated here.
[0091] In other embodiments, the management master device may first determine whether it has received a business master device switching instruction sent by the user. If it has received a business master device switching instruction, indicating that the business master device of the business group needs to be switched, the management master device needs to respond to the business master device switching instruction and switch the business master device of the corresponding business group to the node device specified by the instruction.
[0092] In this embodiment, according to the status information of the service master device, it is determined whether the service master device of the service group needs to be switched. When the service master device of the service group needs to be switched, according to the status information of all service backup devices in the service group, the service backup device with the best status in the service group is determined to obtain the target node device; the target node device is switched to the service master device, and a multicast notification is made to all node devices. The service master device is switched in time according to the status of each node device, so as to ensure the normal execution of the service and improve the efficiency of service execution.
[0093] In one embodiment, in order to ensure the normal use of the cluster and perform service scheduling management through the cluster, it is necessary to establish the cluster and determine the initial management master device of the cluster, and it is necessary to pre-network and configure parameters of the multi-node devices, and determine the management master device. Specifically, the process of the above-mentioned cluster networking, parameter configuration and management master device is as follows, that is, the cluster is established in the following way:
[0094] S01: Networking is performed for each node device, and each node device is connected to the same switch through a heartbeat interface (heartbeat line connection) to form a cluster physical topology.
[0095] When each node device is connected to the same switch via a heartbeat line, the WAN and / or LAN of the node device can be hot-backed up. Each network segment can be hot-backed up in 1:N or 1+N mode according to the interface (link), where 1 is the master device and N is the backup device. It can support flexible networking forms such as 1:N or 1+N, and can achieve multi-machine hot-backup of the management master device and the business master device, with a higher degree of redundancy, further improving system reliability.
[0096] like Figure 6 As shown in the figure, taking the node device as a router as an example, multiple node devices include egress router 1, egress router 2, egress router 3, and egress router 4. Egress router 1, egress router 2, egress router 3, and egress router 4 are connected to each operator through WAN1, WAN2, WAN3, and WAN4 respectively. Each node device follows the TRP protocol, and each node device is connected to the same switch through a heartbeat line. Figure 6 As shown in the figure, the WAN (Wide Area Network) side of each egress router does not need to be hot-backed up. Each egress router can have 4 LAN interfaces, that is, there are four subnets on the LAN (Local Area Network) side. The four subnets of each egress router are LAN1, LAN2, LAN3, and LAN4 from left to right. Among them, the subnets of each egress router are hot-backed up in a ratio of 1:3.
[0097] In this embodiment, the node device is a router, such as Figure 6 The networking form is only an example. In other embodiments, the node device may be other devices, and the networking form of each node device may also be other, which will not be repeated here.
[0098] S02: Each node device obtains cluster management parameters, and performs parameter configuration based on the cluster management parameters.
[0099] The cluster management parameters may be sent by the user through other devices, and then each node device obtains the cluster management parameters and performs parameter configuration based on the cluster management parameters. In other embodiments, the user may also directly configure the cluster management parameters on each node device. The cluster management parameter content is shown in Table 1 below:
[0100] Table 1
[0101]
[0102] In this embodiment, the cluster management parameters in Table 1 above are only for illustrative purposes. In other embodiments, other parameter configurations may be used, which will not be described in detail here.
[0103] S03: After configuring the cluster management parameters, each node device negotiates with the management group and jointly elects a management master device.
[0104] Among them, the cluster management parameters include the management role configured by the user for each node device. The user will configure the expected management role (master or backup) of each device, that is, the management role of each node device may be a management master device or a management backup device. Among them, there can be multiple node devices with the management role configured as a management master device, and multiple management masters can be configured, but there is only one management master device when the cluster is actually running. After each node device configures the cluster management parameters to enable the cluster function, each node device will negotiate the management group based on the configured cluster management parameters (including the management role of its own backup configuration) and the device cluster startup time, and jointly elect the management master device.
[0105] For example, if the time interval between each node device turning on the cluster function is short, each node device will participate in the election, that is, each node device will negotiate with the management group based on the cluster management parameters and jointly elect the management master device. If some node devices turn on the cluster function after the timeout period, that is, the time interval between turning on the cluster function and other node devices is long, then the cluster has already elected the management master device. Even if the management role of the node device that currently turns on the cluster function is the management master device, the node device can only run as a management backup device to avoid preemption and configuration data overwriting.
[0106] In other embodiments, the initial management role of each node device may be Slave, that is, a management standby device, so as to avoid preempting the management master device Master of the current cluster.
[0107] In one embodiment, to avoid inconsistency between the configured management role and the actual operation role, after configuring the cluster management parameters, the designated node device can be pre-enabled to run as the management master device, and other node devices can then enable the cluster function to reduce the management group negotiation process.
[0108] In the process of each node device negotiating the management group according to the cluster management parameters, the configured management role is only used as one of the election parameters, and other election parameters may also include the status of each node device.
[0109] Specifically, after each node device configures the cluster management parameters to enable the cluster function, each node device multicasts heartbeat messages according to the cluster management parameter settings at a preset frequency, and maintains a cluster node list based on the received heartbeat messages. The cluster node list includes the status of each node device, such as whether it is online (when the number of heartbeat message timeouts of the node device reaches the preset number, the node device is offline). When each node device finds that the high-availability cluster has no master, that is, there is no management master device (such as if no heartbeat message is received from the Master for more than a preset time, it is determined that there is no master), each node device is sorted in descending order according to the status of each node device, and the node device ranked first is switched to the management master device Master. Among them, the sorting basis for electing the management master device is: online => user configuration tendency => small node MAC address. Specifically, online node devices are prioritized, and when all node devices are online, the management role configured by the user shall prevail. If the user-configured roles are the same, the node device with a smaller heartbeat port MAC address shall be prioritized. Afterwards, the management master device Master multicasts its own parameter information to all node devices. At the same time, the management master device Master also needs to check the ID (unique identifier) of each node device. If there is an invalid or conflicting ID, the ID of the invalid or conflicting node device will be re-allocated, and the allocation result will be multicast to each node device. After each node device receives the multicast information from the Master, each node device maintains the role of the management standby device Slave, and each Slave checks whether its own parameter configuration is consistent with the Master. If it is inconsistent, it requests the Master to synchronize the configuration parameters.
[0110] S04: The management master device obtains service-related parameters of each service group, and synchronizes the service-related parameters of each service group to all node devices, so that each node device is configured with the service-related parameters of the corresponding service group.
[0111] The service-related parameters of each service group include VRRP rules and service group parameters of each service group.
[0112] Each node device controls related interface configuration (including address configuration) based on the VRRP rule.
[0113] VRRP rules include multiple VRRP standby groups and configuration parameters of each VRRP standby group, as shown in Table 2:
[0114] Table 2
[0115]
[0116] The service group parameters are used to indicate the node devices of each service group and the node configuration parameters of each service group. The node configuration parameters may be as shown in Table 3:
[0117] Table 3
[0118]
[0119] Among them, if the node device is not configured with a health detection suite, the health of the node device is 100. After the health detection suite is configured, the health detection module on the node device will feedback the health detected by the corresponding health detection suite. The detection method and parameters of the health detection suite depend on the user configuration. In this embodiment, the health detection suite is not the health of a single node device, but the health of the node device in each business group, as the member health of the business group member. Each node device can report the current member health when the health changes, or it can periodically report the health of all its members according to a certain period, that is, the health of all business groups.
[0120] The above parameters are only exemplary. In other embodiments, the service-related parameters of each service group may be other parameters, which will not be described in detail here.
[0121] After parameter configuration, the management master device needs to determine the service master device and service backup device of each service group when receiving a service request, so as to schedule the service master device of each service group to execute different services. In other embodiments, the management master device may first determine the service master device and service backup device of each service group, and then schedule the service master device of each service group to execute different services when receiving a service request.
[0122] In this embodiment, multiple redundant management backup devices are provided in the management group, and redundancy is also achieved in the business group. Compared with dual-machine hot standby, this embodiment has more nodes, can support flexible networking forms such as 1:N and 1+N, and can achieve multi-machine hot standby of management master devices and business master devices, with a higher degree of redundancy. When the management master device fails, the management backup device can quickly select a new management master device to perform business scheduling and node device management; at the same time, when the business master device fails, it can also be quickly switched under the monitoring of the management master device, ensuring the normal operation of the cluster and timely completion of business.
[0123] When cluster networking is performed, cluster management parameters and service-related parameters of each service group are configured in two stages. Simple cluster management parameters are manually configured on each node device, and complex service-related parameters are synchronously configured through the management master device to reduce configuration complexity.
[0124] In one embodiment, step S10, that is, determining the service master device of each service group according to the status information of each node device, specifically includes the following steps:
[0125] S11: The management master device determines the status information of each node device according to the heartbeat message of each node device.
[0126] After the cluster is enabled, each node device sends a heartbeat message at a preset frequency. The heartbeat message is sent in the form of multicast so that other node devices can receive its heartbeat message and determine its online status.
[0127] After receiving the service request, the management master device determines the online status of each node device according to the heartbeat message of each node device, and determines one or more information such as the member health, member priority, and load of each node device according to the pre-configured service-related parameters, and obtains the status information of each node device. That is, the status information of each node device includes one or more information such as online status, member health, member priority, load, node number (node ID), etc. Among them, the member priority is the priority of each node device in the current business group, and this priority is the pre-set device priority. The same node device has different priorities in different business groups. The member health of a node device refers to the health of the node device in the business group. The member health depends on the configuration of the health detection kit and may reflect the health of one or some interfaces.
[0128] S12: The management master device determines a service master device from all node devices in the service group according to at least one of the member health, member priority and load of each node device in the service group, and multicasts a notification to all node devices.
[0129] The management master device determines the service master device from all the node devices in the service group according to at least one of the member health, member priority and load of each node device in the service group. After determining the service master device of the service group, all the node devices are notified by multicast.
[0130] After determining the status information of each node device, the management master device determines the service master device among all the node devices in the service group according to the online status and member priority of each node device in the service group, wherein the service master device is the node device that is online and has the highest member priority. For example, the online node devices in the service group can be determined according to the online status of each node device in the service group; the node device with the highest member priority in the service group can be determined according to the member priority to obtain the service master device of the service group. The service master device is the node device that is online and has the highest member priority, so that the corresponding service can be processed by the service master device expected by the user.
[0131] If there is only one online node device in the service group, the online node device is commanded to switch to the service master device.
[0132] After determining the service master device of the service group, the management master device informs all node devices in a multicast manner that the current service master device of the service group has been determined, and informs relevant information of the service master device.
[0133] In this embodiment, by determining the status information of each node device, according to at least one of the member health, member priority and load of each node device in the service group, the service master device is determined among all the node devices in the service group, and multicast notification is sent to all the node devices. The service master device is selected from multiple dimensions, and a suitable service master device can be selected to execute the service according to different needs.
[0134] In addition, by determining or switching the service master device in each service group through the management master device, each node device in the service group does not need to monitor the status of the service master device in real time, nor does it need to execute the service master device recommendation logic, which reduces the data processing volume of each node device and effectively improves system reliability. Since the management master device adopts multicast communication, all node devices can be notified at once to switch the service master device, which speeds up service convergence.
[0135] In one embodiment, before determining the status information of each node device, the management master device may first determine whether it has received a service master device switching instruction sent by the user. If a service master device switching instruction is received, it will respond to the service master device switching instruction and switch the service master device of the corresponding business group to the node device specified by the instruction.
[0136] In one embodiment, step S12, that is, determining a service master device from all node devices in the service group according to at least one of the member health, member priority, and load of each node device in the service group, specifically includes the following steps:
[0137] SA121: The management master device determines the online node devices in the business group according to the online status of each node device in the business group;
[0138] SA122: The management master device determines the service master device of the service group based on the member priority and load of each online node device.
[0139] First, the management master device determines the online node devices in the business group according to the online status of each node device in the business group, and then determines the business master device of the business group based on the member priority and load of each online node device. The load of the node device is the number of the node device as the business master device in other business groups.
[0140] Among them, the business master device is the online node device with the highest member priority and the smallest load. That is, after determining the online node devices in the business group, if there are two or more online node devices, the online node device with the highest member priority is determined to obtain the priority device; if there are two or more priority devices, that is, there are multiple online node devices with the highest member priority, then the priority device with the smallest load is determined to obtain the business master device of the business group. If there is only one priority device, that is, there is only one online node device with the highest member priority, then the online node device with the highest member priority is clearly switched to the business master device without further judging the load situation.
[0141] In this embodiment, the online node devices in the business group are determined according to the online status of each node device in the business group; the business master device of the business group is determined based on the member priority and load of each online node device, and the business master device is set as the online node device with the highest member priority and the smallest load, thereby reducing the load of each business master device, thereby improving the speed of the business master device in processing business, and further enabling different businesses to be undertaken by different node devices, thereby increasing the effect of load sharing.
[0142] In one embodiment, step S12, that is, determining a service master device from all node devices in the service group according to at least one of the member health, member priority, and load of each node device in the service group, specifically includes the following steps:
[0143] SB121: The management master device determines the online node devices in the business group according to the online status of each node device in the business group;
[0144] SB122: The management master device determines the business master device of the business group based on the member health, member priority and load of each online node device.
[0145] Specifically, based on the member health, member priority and load of each online node device, the business main device of the business group is determined, including: determining the online node device with the highest member health in the business group to obtain the first device; when there are two or more first devices, determining the first device with the highest member priority in the business group to obtain the second device; when there are two or more second devices, determining the second device with the smallest load in the business group to obtain the business main device of the business group.
[0146] The management master device needs to determine the online node device with the highest member health in the business group to obtain the first device. When there are two or more first devices, determine the first device with the highest member priority in the business group to obtain the second device; when there are two or more second devices, determine the second device with the smallest load in the business group, and command the second device with the smallest load, that is, switch the online node device with the highest member health, the highest member priority, and the smallest load to the business master device of the business group, ensuring that the business master device is the node device in the best state in the business group and can execute business normally and quickly, further improving the business execution efficiency of the business master device.
[0147] In addition, when there is only one first device, the first device, that is, the online node device with the highest member health, is commanded to switch to the service master device of the service group. When there is only one second device, the second device, that is, the online node device with the highest member health and the highest member priority, is commanded to switch to the service master device of the service group. Direct and simple, no further judgment is required.
[0148] In this embodiment, the service master device of the service group is determined based on the member health, member priority and load of each online node device, and the node device with the best status is selected from multiple dimensions to switch to the service master device, which is more accurate.
[0149] In one embodiment, each service group can be divided according to the interface type (interface usage) in the node device. Each interface type on the node device can be divided into different service groups to execute different services. The role switching process between the service master device and the service backup device in each service group can be as follows: Figure 7 shown.
[0150] like Figure 7 As shown, the cluster in this embodiment includes three online node devices: device A, device B and device C. Device A, device B and device C all have GE1, GE2, GE3 and GE4 interfaces. Each interface is configured with a VRRP entry and can be divided into three service groups. Service group 1 uses the GE1 interface, service group 2 uses the GE2 interface, and service group 3 uses the GE3 and GE4 interfaces.
[0151] like Figure 7As shown in (a) in the figure, initially, the service master devices of service group 1, service group 2, and service group 3 are device A, device B, and device C, respectively, and the other devices in the service group are all service backup devices Slave. When the GE1 interface of device A fails (the health of the member of device A decreases), the service master device of service group 1 needs to be switched. The member priority of device B in service group 1 is greater than the member priority of device C. At this time, the master of service group 1 can be switched to device B, and device A is switched to Slave in service group 1. Figure 7 as shown in (b).
[0152] When the entire device B of service group 1 fails, that is, all interfaces of device B are unavailable, and the GE1 interface of device A has not recovered, the master of service group 1 can only be switched to device C. At this time, it is found that the master of service group 1 and service group 3 is device C. Considering that the load of device C is large and the GE2 interface of device A is normal, the master of service group 2 is switched to device A. Figure 7 As shown in (c), the normal execution of business group 2 is not affected.
[0153] like Figure 7 As shown in (d), when the GE1 interface of device A returns to normal, if the member priority of device A in service group 1 is higher than the member priority of devices B and C, and device A is set to preempt the master of the service group, then when the GE1 interface of device A returns to normal, the master of service group 1 is switched back to device A.
[0154] In this embodiment, since each node device will multicast a heartbeat message and report the status to the management master device, the status information of each node device can be kept synchronized. No additional detection election or status collection process is required. The management master device actively switches the business main device and the business backup device, and the role switching converges quickly.
[0155] In one embodiment, the status information also includes the node ID of the node device. The node ID is a node number uniformly assigned by the management master device, and is a unique identifier of the node. The node ID is functionally equivalent to the MAC address, but is more convenient to use. When there are two or more second devices, after determining the second device with the smallest load in the business group, the second device with the smallest load in the business group is recorded as the third device. When there are two or more third devices, the third device with the smallest node ID is determined as the business master device of the business group. That is, the online node device with the highest member health, the highest member priority, the smallest load and the smallest node ID is switched to the business master device of the business group.
[0156] In one embodiment, before step S10, that is, before determining the service master device of each service group, the following steps are specifically included:
[0157] S101: When it is necessary to update parameters of each node device, the management master device synchronously configures service-related parameters including VRRP rules to each node device, and updates to obtain two or more service groups.
[0158] Before determining the service master device of each service group, the management master device needs to determine whether it is necessary to update the parameters of each node device. For example, when the initial management master device is just determined during cluster networking, each node device has not been grouped into service groups and service-related parameters have not been configured, so it is necessary to update the parameters of each node device. Alternatively, when the service-related parameter configuration needs to be updated, such as when the service group is re-divided, it is necessary to update the parameters of each node device.
[0159] When it is determined that each node device needs to update parameters, the service-related parameters including VRRP rules are synchronously configured to each node device to obtain two or more new service groups. VRRP rules and service-related parameters are shown in Table 2 and Table 3 above and will not be described here.
[0160] S101: The management master device determines a service master device for each service group based on the updated service groups.
[0161] After obtaining two or more service groups, the management master device determines the service master device of each service group based on the updated service groups.
[0162] In this embodiment, when it is necessary to update the parameters of each node device, the service-related parameters including VRRP rules are synchronously configured to each node device, and two or more service groups are updated. Based on the updated service groups, the service master device of each service group is determined. When there is a need to update parameters, the parameter update configuration is performed in time, so as to update a new service group, and then the service master device of each service group is determined to meet the different usage requirements of users.
[0163] In one embodiment, after step S10, that is, after scheduling the service master devices of each service group to execute different services, the method further specifically includes the following steps:
[0164] S31: Each node device obtains the heartbeat message multicasted by other node devices at a preset frequency.
[0165] During cluster operation, each node device, including the management master device, needs to obtain the heartbeat message multicasted by other node devices at a preset frequency. In the cluster, each node device (including the management master device) sends messages according to the TRP protocol, that is, multicasts the heartbeat message at a preset frequency, so that each node device can negotiate and elect the management master device.
[0166] During cluster operation, each node device will obtain the heartbeat message multicast by each node device at a preset frequency.
[0167] S32: Each node device determines whether it is necessary to switch the management master device according to the heartbeat message of the management master device.
[0168] Then, each node device as a management standby device will determine whether to switch the management master device according to the heartbeat message of the management master device. In other implementations, when the management master device finds a heartbeat message from another management master device, it determines that the management master device needs to be switched.
[0169] S33: If it is determined that the management master device needs to be switched, each node device obtains the status ranking data of all node devices, and switches the node device ranked first in the status ranking data to be the new management master device.
[0170] If it is determined that the management master device needs to be switched, each node device needs to obtain the status sorting data of all other node devices. The status sorting data is obtained by sorting all node devices in descending order according to the status information of other node devices. Then, if the node device itself is the first node device in the status sorting data, it will switch itself to the new management master device, otherwise it will switch itself to the management backup device, slave. In any case, the node device ranked first in the status sorting data will be recorded as the management master of the cluster.
[0171] In other embodiments, when the current management master device receives a management master switching instruction from the user and determines that the management master device needs to be switched, it responds to the management master switching instruction to switch itself to a management backup device, and multicasts a notification that the node device specified in the management master switching instruction is the new management master device, so that each node device responds in a timely manner according to the notification, and the designated node device switches it to the management master device in a timely manner.
[0172] In this embodiment, according to the heartbeat message of the management master device, it is determined whether the management master device needs to be switched. If it is determined that the management master device needs to be switched, the management master device is switched to the management standby device. When necessary, the role is switched in time so that the new management master device can better perform cluster management and service scheduling and accelerate service convergence.
[0173] In one embodiment, in step S32, determining whether it is necessary to switch the management master device according to the heartbeat message of the management master device specifically includes the following steps:
[0174] S321: If the heartbeat message of the management master device is not received within a timeout period, each node device determines the number of timeouts of the heartbeat message of the management master device;
[0175] S321: When the number of heartbeat message timeouts of the management master device reaches a preset number, each node device determines that the management master device needs to be switched.
[0176] During cluster operation, each node device, including the management master device, needs to obtain the heartbeat message multicasted by other node devices at a preset frequency. If the heartbeat message of the management master device is not received within a timeout period, each node device, as a management backup device, needs to determine the number of heartbeat message timeouts of the management master device. When the number of heartbeat message timeouts of the management master device reaches a preset number (such as 3 times), each node device determines that the management master device is offline (failed) and determines that the management master device needs to be switched.
[0177] For example, the heartbeat message of each node device is multicast once per second, and the (total) timeout period is 3 seconds. The heartbeat message timeout times of the node device that times out and fails to report the heartbeat message are increased by 1 every 1 second. Each time a heartbeat message of a node device is received, the heartbeat message timeout times are reset to zero. After 3 timeouts, the node device is marked as offline (offline).
[0178] In this embodiment, each node device determines whether to switch the management master device according to the number of heartbeat message timeouts of the management master device. The specific situation in which the management master device needs to be switched is clarified. When the management master device fails (such as being offline), the management master device is switched in time to accelerate service convergence.
[0179] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0180] In one embodiment, a network device is provided, which corresponds one-to-one with the above cluster management method. Figure 8 As shown, the network device includes a role switching module 801 and a service scheduling module 802. Each functional module is described in detail as follows:
[0181] The role switching module 801 is used to determine the service master device of each service group according to the status information of each node device;
[0182] The service scheduling module 802 is used to schedule the service master devices of each service group to execute different services.
[0183] Optionally, after scheduling the service master devices of each service group to execute different services, the role switching module 801 is further used to dynamically switch the master and backup roles of each node device in the service group according to the status information of each service master device to ensure that the service master device of each service group completes the corresponding service.
[0184] Optionally, before determining the service master device of each service group, the role switching module 801 is further configured to:
[0185] When it is necessary to update the parameters of each node device, the service-related parameters including VRRP rules are synchronously configured to each node device, and two or more service groups are updated;
[0186] Based on the updated information of each service group, a service master device of each service group is determined.
[0187] Optionally, the role switching module 801 is further configured to:
[0188] Determine whether to switch the service master device of the service group according to the status information of the service master device;
[0189] When the service master device of the service group needs to be switched, the service backup device with the best status in the service group is determined according to the status information of all service backup devices in the service group, and the target node device is obtained;
[0190] Switch the target node device to the service master device and multicast the notification to all node devices.
[0191] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0192] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0193] The present application also provides a network device, such as Fig. 9 As shown, the network device 2 includes: at least one processor 20, a memory 21, and a computer program 23 stored in the memory 21 and executable on at least one processor 20. The processor 20 may include one or more processors such as a central processing unit, an application processor (AP), and a baseband processor. The processor 20 may be the nerve center and command center of the wireless router. The processor 20 may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. The processor 20 executes various functional applications and data processing of the network device by running the computer program stored in the memory 21. The memory may include a program storage area and a data storage area, such as a storage area for generated or used data. For example, the memory may be a double rate synchronous dynamic random access memory DDR or a flash memory Flash.
[0194] The network device 2 also includes a communication module and a power management module, etc., which are not shown. The communication module can provide solutions for communication including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth, Zigbee, mobile communication networks, global navigation satellite systems (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc., which are applied to network devices. The communication module can be one or more devices integrating at least one communication processing module. The communication module can include an antenna, which can have only one array element or an antenna array including multiple array elements. The communication module can receive electromagnetic waves through the antenna, frequency modulate and filter the electromagnetic wave signal, and send the processed signal to the processor. The communication module can also receive the signal to be sent from the processor, frequency modulate and amplify it, and convert it into electromagnetic waves for radiation through the antenna.
[0195] The power management module can receive input from a battery and / or a charger to power the processor, memory, and communication module, etc.
[0196] It should be noted that the above figure does not constitute a limitation on the structure of the network device 2, and it may include more or fewer components than shown in the figure, or a combination of certain components, or different components.
[0197] An embodiment of the present application further provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0198] An embodiment of the present application provides a computer program product. When the computer program product runs on a network device, a mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0199] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0200] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0201] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0202] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0203] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0204] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some of the technical features therein by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A cluster management method, It is characterized in that There is a management master device among the multiple node devices of the cluster, the multiple node devices are divided into two or more service groups, each of the service groups includes two or more node devices, and a single node device belongs to one or more service groups; the method includes: The management master device determines the service master device of each service group according to the status information of each node device, and schedules the service master device of each service group to execute different services.
2. The cluster management method according to claim 1, It is characterized in that The determining the service master device of each service group according to the status information of each node device includes: The management master device determines the service master device from among all the node devices in the service group according to at least one of the member health, member priority and load of each of the node devices in the service group.
3. The cluster management method according to claim 2, It is characterized in that The determining the service master device among all the node devices in the service group according to at least one of the member health, member priority and load of each of the node devices in the service group comprises: The management master device determines the online node device in the service group according to the online status of each node device in the service group; The management master device determines the node device with the highest member priority in the service group according to the member priority, and obtains the service master device of the service group.
4. The cluster management method according to claim 2, It is characterized in that The determining the service master device among all the node devices in the service group according to at least one of the member health, member priority and load of each of the node devices in the service group comprises: After determining the online node devices in the service group according to the online status of each node device in the service group, the management master device determines the online node device with the highest member priority to obtain the priority device; When there are two or more priority devices, the management master device determines the priority device with the smallest load to obtain the service master device of the service group.
5. The cluster management method according to any one of claims 2 to 4, It is characterized in that The determining the service master device among all the node devices in the service group according to at least one of the member health, member priority and load of each of the node devices in the service group comprises: After determining the online node device in the service group according to the online status of each node device in the service group, the management master device determines the online node device with the highest member health in the service group to obtain a first device; When there are two or more first devices, the management master device determines the first device with the highest member priority in the service group to obtain the second device; When there are two or more second devices, the management master device determines the second device with the smallest load in the service group to obtain the service master device of the service group.
6. The cluster management method according to any one of claims 1 to 5, It is characterized in that After scheduling the service master devices of each service group to execute different services, the method further includes: Each of the node devices determines whether it is necessary to switch the management master device according to the heartbeat message of the management master device; If it is determined that the management master device needs to be switched, each of the node devices obtains the status ranking data of all the node devices, and switches the node device ranked first in the status ranking data to be the new management master device.
7. The cluster management method according to claim 6, It is characterized in that The determining whether the management master device needs to be switched according to the heartbeat message of the management master device includes: If the heartbeat message of the management master device is not received within a timeout period, each of the node devices determines the number of timeouts of the heartbeat message of the management master device; When the number of heartbeat message timeouts of the management master device reaches a preset number, each of the node devices determines that the management master device needs to be switched.
8. A cluster management system, It is characterized in that The cluster includes a plurality of node devices; there is a management master device among the plurality of node devices, the plurality of node devices are divided into two or more service groups, each of the service groups includes two or more of the node devices, and a single node device belongs to one or more of the service groups; The management master device is used to determine the service master device of each service group according to the status information of each node device, and schedule the service master device of each service group to execute different services.
9. A network device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the cluster management method according to any one of claims 1 to 7 or the functions of each device in the cluster management system according to claim 8 are implemented.
10. A readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the cluster management method according to any one of claims 1 to 7 or the functions of each device in the cluster management system according to claim 8 are implemented.
Citation Information
Cited By
Main and standby CPE system, CPE main and standby implementation method and communication equipment
CN119561661A
Master-slave cpe system, cpe master-slave implementation method and communication device
CN119561661B
Flow execution efficiency adjusting method and device based on data analysis
CN120125004A
Dynamic node management method and device for intelligent optical fiber distribution equipment cluster
CN121792887A
