Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Referring to fig. 1, fig. 1 is a flow chart of a method provided by the present invention. The method is applied to the super-fusion management equipment. As shown in fig. 1, the method may include:
and 101, when the current election time is determined, selecting a main device, a standby device and a standby device from the device and other super-convergence management devices in the network.
In the present application, the election time may be set in advance as one embodiment.
As another example, the election time may also be determined dynamically, as described in more detail below.
As to how to select the master device, the standby device, and the standby device from the present device and other super convergence management devices, the following description will be made in detail, and details are not repeated here.
And 102, controlling all other super-convergence management equipment in the network when the equipment is elected as the main equipment, working according to the control of the main equipment when the equipment is elected as the standby equipment, and working according to the control of the main equipment when the equipment is elected as the standby equipment.
In this application, although the super-convergence management device elected as the standby device and the super-convergence management device elected as the standby device operate according to the control of the master device, the master device controls the super-convergence management device elected as the standby device differently from the super-convergence management device elected as the standby device in specific implementation, specifically based on actual requirement control, and is not described one by one.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow shown in fig. 1, in the present application, by dynamically electing the roles (main device, standby device) of each super-convergence management device in the network, each super-convergence management device works according to its own role, thereby avoiding the problems of mutual exclusion, management resource waste, and the like caused by the completely same authority of different super-convergence management devices.
Further, in the invention, the role of each super-fusion management device in the network is dynamically elected, the super-fusion management device elected as the main device controls the super-fusion management devices elected as the standby device and the standby device to work, so that a user only needs to operate the super-fusion management device elected as the main device, the super-fusion management device elected as the main device controls the super-fusion management devices elected as the standby device and the standby device to work by relying on the user operation, the user entrance is simplified, and the address setting for each super-fusion management device is not needed.
Furthermore, in the invention, by dynamically electing the role of each super-convergence management device in the network, the super-convergence management device elected as the main device controls the super-convergence management devices elected as the standby device and the standby device to work, thereby reducing the forwarding and processing quantity of protocol messages in the network and improving the resource utilization rate.
In this application, when the super-convergence management device is powered on or is restored to factory configuration, the state of the super-convergence management device is initialized (Init) at this time.
When the state of the super-fusion management equipment is Init, a timer is started, and the overtime time of the timer is preset.
Based on this, as an embodiment, the electing time determined by the super-fusion management device in step 101 is a time-out of a timer started when the state of the device is Init.
When the state of the super-convergence management device is Init, the super-convergence management device does not work, but periodically sends the notification message. The notification message is a message under a data center management protocol specially designed for adaptation of the hyper-convergence management equipment. The notification message carries two types of TLV information, and the first type of TLV information is used for carrying the state of the super-fusion management equipment. Fig. 2 shows the structure of the first type TLV information. As an embodiment, at this time, the state of the super-convergence management device is Init, and then the first type TLV information carried in the notification packet sent by the super-convergence management device is an identifier, such as 1, used for representing Init. The second type of TLV information is used to carry election parameters, which may be device priority, MAC address, as an embodiment of the present invention. Fig. 3 illustrates the structure of the second type TLV information by taking the election parameter as the device priority and the MAC address as an example.
When the state of the super-convergence management device is Init, the super-convergence management device also receives notification messages sent by other super-convergence management devices. The received notification messages sent by other super-convergence management devices carry the states of the other super-convergence management devices. And the state of other super convergence management devices may be Init, or Master or Backup.
In the present application, the super convergence management device elected as the Master device has a device state of Master (Master), the super convergence management device elected as the standby device has a device state of standby (Backup), and the super convergence management device elected as the standby device has a device state of standby (Waiting). When the super-convergence management equipment is elected as the main equipment, an announcement message carrying a state Master of the equipment is periodically sent; when the super-convergence management device is elected as a standby device, periodically sending an announcement message carrying the status Backup of the device; when the super-convergence management device is elected as a standby device, the notification message carrying the state Waiting of the device is periodically sent. Here, the format of the notification message transmitted by the super convergence management device elected as the master device, the super convergence management device elected as the standby device, and even the super convergence management device elected as the standby device is as described above.
In this application, the super convergence management device elected as the master device may also periodically receive notification messages sent by the super convergence management devices elected as the standby devices and the other standby devices. The super-convergence management device elected as the standby device also periodically receives notification messages sent by the super-convergence management devices elected as the main devices and the standby devices. The super-convergence management device elected as the standby device also periodically receives notification messages sent by other super-convergence management devices elected as the main device, the standby device and other standby devices.
As an embodiment, the election time determined by the super-fusion management device in step 101 may also be: when the state of the equipment is Init, the equipment receives an announcement message carrying the state of Master or Backup.
In the present application, when the master device, the slave device, and the standby device are elected, the elected master device and the elected slave device are not stable and do not change, and they dynamically change. As an embodiment, the election time determined by the super-fusion management device in step 101 may also be: the state of the super convergence management device with the state of Master or Backup in the network changes, that is, the Master device and the standby device in the network change.
As an embodiment, the change in the state of the super convergence management device in the state of Master or Backup in the network includes, but is not limited to, the following cases:
case 1), more than one super convergence management device with Master or Backup state is newly added in the network. That is, more than one super convergence management device serving as a master device or a standby device is newly added in the network.
Case 2), the state of the super convergence management device elected as the master device or the standby device in the network is updated. That is, the super convergence management device elected as the Master device in the network no longer maintains the original Master, that is, the super convergence management device is no longer used as the Master device, or the super convergence management device elected as the slave device in the network no longer maintains the original Backup, that is, the super convergence management device is no longer used as the slave device.
Case 3), the set time does not receive the notification message carrying the state of Master or Backup.
Based on the above description, the state change of any hyper-convergence management device will transition as shown in fig. 4.
In the above-described notification packet, in step 102, the process of selecting the main device, the standby device, and the standby device from the local device and other super convergence management devices includes the following steps:
referring to fig. 5, fig. 5 is a flow chart of elections provided by the present application. The process is applied to the super-fusion management equipment, and specifically comprises the following steps:
in step 501, the super-convergence management device selects one device from the candidate devices of the master device as the master device.
Here, the candidates of the master device are: if more than one super-convergence management device with the state of Master exists in the network, the super-convergence management device with the state of Master is a candidate device of the main device, otherwise, all super-convergence management devices in the network are candidate devices of the main device;
with the above-described structure of the notification message, the super-convergence management device can acquire the states of other super-convergence management devices by collecting the notification messages sent by other super-convergence management devices. The collected notification messages sent by the other super-convergence management devices may be the latest notification message up to the present.
As an embodiment, in step 501, one device is elected from the candidate devices of the master device as the master device, and election can be performed according to priority. Specifically, the selecting of one device from the candidates of the master device as the master device according to the priority may include: one device with the highest priority is selected from the candidate devices of the master device. When the number of devices with the highest priority selected from the candidate devices of the master device is 1, the device with the highest priority is selected as the master device, and when the number of devices with the highest priority selected is greater than 1, the device with the lowest MAC address among the devices with the highest priority is selected as the master device. And finally, only one hyper-convergence management device is selected as a main device.
Step 502, when the super-convergence management device is not elected as the master device, setting the state of the super-convergence management device as Backup.
When the state of the device is set to Backup by the hyper-convergence management device, the hyper-convergence management device defaults the device to be a standby device.
Step 503, the super-convergence management device selects one device from the candidate devices of the standby devices as the standby device, where the candidate devices of the standby device are: and all the super fusion management devices with the status of Backup.
In the present application, the election in step 503 is similar to the election in step 501, and is also election according to priority. The method specifically comprises the following steps: and selecting a device with the highest priority from the candidate devices of the standby devices according to the priority. It should be noted that when the number of devices with the highest priority is 1, the device with the highest priority is elected as the standby device, otherwise, the device with the smallest MAC address in the devices with the highest priority is elected as the standby device. And finally, only one hyper-convergence management device is selected as a standby device.
Step 504, when the super-convergence management device is not elected as the standby device, setting the state of the device to Waiting.
When the state of the device is set to Waiting by the hyper-convergence management device, that is, the hyper-convergence management device defaults that the device is a standby device.
The flow shown in fig. 5 is completed. Through the flow shown in fig. 5, election of the super-convergence management device is finally completed.
It should be noted that, as a specific example, if there is only one super convergence management device in the network, the election process shown in fig. 5 in the present application need not be executed.
It should be noted that, in the present application, the super convergence management device selected as the standby device may further include: when detecting that the super-convergence management equipment with the state of Master is abnormal, upgrading the equipment into main equipment, updating the state of the equipment into Master, carrying the updated state of the equipment in an announcement message, and sending the announcement message to other super-convergence management equipment in the network.
In the above description, the detecting of the abnormality of the super convergence management device in the Master state mainly includes: setting time without receiving a notification message sent by the super-convergence management equipment with the Master state; or the super convergence management device elected as the standby device actively initiates detection to detect the abnormality of the super convergence management device in the state of Master. The exception here may include the disappearance or failure of the super convergence management device in the state of Master.
The methods provided herein are described above. The following describes the apparatus provided by the present invention:
referring to fig. 6, fig. 6 is a structural view of the apparatus according to the present invention. The device is applied to super integration management equipment, and comprises:
the election unit is used for electing main equipment, standby equipment and standby equipment from the equipment and other super-convergence management equipment in the network when the current election time is determined;
the processing unit is used for controlling all other super-convergence management equipment in the network to work when the equipment is elected as the main equipment; when the equipment is elected as the standby equipment, the equipment works according to the control of the main equipment; when the device is a standby device, the device operates under the control of the master device.
Preferably, the apparatus further comprises:
a sending unit, configured to periodically send an announcement message carrying a state Master of the device when the device is elected as a Master device; periodically sending an announcement message carrying the status Backup of the equipment when the equipment is elected as the standby equipment; and when the equipment is elected as standby equipment, periodically sending an announcement message carrying the state Waiting of the equipment.
Preferably, the election time includes:
the state of the equipment is that a timer started when Init is initialized is overtime; alternatively, the first and second electrodes may be,
when the state of the equipment is Init, receiving an announcement message carrying the state of Master or Backup; alternatively, the first and second electrodes may be,
the state of the super convergence management equipment with the state of Master or Backup in the network changes.
As an embodiment, the state of the super convergence management device in the state of Master or Backup in the network is changed, which includes but is not limited to:
more than one super convergence management device with Master or Backup state is newly added in the network;
updating the state of the super-convergence management equipment elected as the main equipment or the standby equipment in the network;
and the set time does not receive the notification message carrying the state of Master or Backup.
Preferably, when the device is elected as a standby device, the processing unit further detects that the super convergence management device in the Master state disappears or is abnormal, upgrades the device to the Master device, updates the Master device in the state of the device, and sends the updated state of the device to other super convergence management devices in the network by carrying the updated state of the device in the notification message.
Preferably, the electing unit elects a main device, a standby device, and a standby device from the device and other super-convergence management devices, and includes:
selecting one device from candidate devices of a master device as the master device, wherein the candidate devices of the master device are as follows: if more than one super-convergence management device with the state of Master exists in the network, the super-convergence management device with the state of Master is a candidate device of the main device, otherwise, all super-convergence management devices in the network are candidate devices of the main device;
when the equipment is not elected as the main equipment, setting the state of the equipment as Backup;
selecting one device as a standby device from candidate devices of the standby device, wherein the candidate devices of the standby device are as follows: all the super-convergence management devices with the status of Backup;
when the equipment is not elected as the standby equipment, setting the state of the equipment to Waiting
As an embodiment, the selecting one device from the candidates of the master device as the master device includes: selecting the equipment with the highest priority from the candidate equipment of the main equipment; if the number of the devices with the highest election priority is 1, electing the device with the highest election priority as a main device, and if not, electing the device with the lowest MAC address in the devices with the highest election priority as the main device;
the selecting one device from the candidate devices of the slave device as the slave device comprises: and selecting the equipment with the highest priority from the candidate equipment of the standby equipment, wherein when the number of the selected equipment with the highest priority is 1, the equipment with the highest priority is selected as the standby equipment, and otherwise, the equipment with the lowest MAC address in the equipment with the highest priority is selected as the standby equipment.
Thus, the description of the apparatus shown in fig. 6 is completed.
Correspondingly, the invention also provides a hardware structure of the device shown in FIG. 6. Referring to fig. 7, fig. 7 is a schematic diagram of a hardware structure of the apparatus shown in fig. 6 provided in the present application. The device comprises:
the memory is used for storing the program instruction operated by the election unit and the program instruction operated by the processing unit;
and the processor is used for executing the program instruction operated by the election unit and executing the program instruction operated by the processing unit. The processor executes the operation executed by the program instruction executed by the election unit, and the operation executed by the processor executes the operation executed by the program instruction executed by the processing unit, wherein the operation executed by the processor is the operation executed by the processing unit.
As shown in fig. 7, the hardware architecture may also include a power component configured to perform power management of the device, a wired or wireless network interface configured to connect the device to a network, and an input-output (I/O) interface.
Up to this point, the description of the hardware configuration shown in fig. 7 is completed.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.