Summary of the invention
Main purpose of the present invention is for providing a kind of method and Heterogeneous Cluster Environment of realizing the isomeric group device synchronization, is intended to make the configuration of the network interface of cluster device in group system can be synchronous, thereby reduces the complexity that Heterogeneous Cluster Environment is set up.
The invention provides a kind of method that realizes the isomeric group device synchronization, comprise step:
According to the quantity of the network interface of the first cluster device, the second cluster device is configured to a plurality of virtual network interfaces with its network interface; The quantity of the network interface of described the first cluster device is greater than the quantity of the network interface of described the second cluster device;
When the second cluster device detects the first cluster device and breaks down, the configuration correspondence of the network interface of the first cluster device is switched to the network interface of the second cluster device;
The second cluster device receiving network protocol stack is sent to the packet of its network interface, and described packet delivery to corresponding network interface is processed.
Preferably, the IP address of the configuration packet includes network interface of described network interface and type of service corresponding to this network interface.
Preferably, the quantity of described network interface according to the first cluster device, the second cluster device specifically comprises the step that its network interface is configured to a plurality of virtual network interfaces:
Quantity according to the network interface of the first cluster device, the second cluster device is configured to a plurality of virtual network interfaces with its at least one network interface, makes the second cluster device comprise that the quantity of network interface of described virtual network interface is identical with the quantity of the network interface of described the first cluster device.
Preferably, after described the second cluster device is configured to the step of a plurality of virtual network interfaces with its network interface, also comprise:
The second cluster device is the corresponding MAC Address of a plurality of described virtual network interface configuration.
Preferably, described the second cluster device receiving network protocol stack is sent to the packet of network interface, and the step that described packet delivery is processed to corresponding network interface comprises:
The second cluster device receiving network protocol stack is sent to the packet of network interface, judge whether described network interface disposes a plurality of described virtual network interfaces, if, the virtual network interface MAC Address corresponding according to described packet, process packet delivery to corresponding virtual network interface.
The present invention also provides a kind of Heterogeneous Cluster Environment, comprises the first cluster device and the second cluster device, wherein:
The quantity of the network interface of described the first cluster device is greater than the quantity of the network interface of described the second cluster device;
Described the second cluster device comprises:
The interface configuration module, be used for the quantity according to the network interface of the first cluster device, and its network interface is configured to a plurality of virtual network interfaces;
Handover module, when to the first cluster device, breaking down, switch to the second cluster device with the configuration correspondence of the network interface of the first cluster device and comprise the network interface of described virtual network interface;
Distribution module, be used for the receiving network protocol stack and be sent to the packet of network interface, and described packet delivery to corresponding network interface is processed.
Preferably, the IP address of the configuration packet includes network interface of described network interface and type of service corresponding to this network interface.
Preferably, described interface configuration module specifically is used for:
Quantity according to the network interface of the first cluster device, its at least one network interface is configured to a plurality of virtual network interfaces, makes the second cluster device comprise that the quantity of network interface of described virtual network interface is identical with the quantity of the network interface of described the first cluster device.
Preferably, described the second cluster device also comprises:
The address configuration module, be used to the corresponding MAC Address of a plurality of described virtual network interface configuration.
Preferably, described distribution module specifically comprises:
Judge module, be used for the receiving network protocol stack and be sent to the packet of network interface, judges whether described network interface disposes a plurality of described virtual network interfaces;
The distribution submodule, be used for the virtual network interface MAC Address corresponding according to described packet, and packet delivery to corresponding virtual network interface is processed.
The present invention is by the quantity of the network interface according to the first cluster device, the network interface of the second cluster device of the negligible amounts of network interface is configured to a plurality of virtual network interfaces, makes the quantity of its network interface identical with the quantity of the first cluster device network interface; When the first cluster device being detected and break down, the configuration correspondence of the network interface of the first cluster device is switched to the second cluster device comprise the network interface of virtual network interface, and the packet of the network interface receiving network protocol stack transmission after passing through to switch, and packet is processed accordingly, make the configuration of the network interface of cluster device in group system can be synchronous, thereby reduced the complexity that Heterogeneous Cluster Environment is set up.
Embodiment
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The invention provides a kind of method that realizes the isomeric group device synchronization.The quantity of the network interface of the cluster device more according to network interface, network interface on the cluster device that network interface is less is configured to a plurality of virtual network interfaces, and the quantity of the network interface of the cluster device that the quantity that makes its total network interface and network interface are more is identical.When breaking down, the configuration correspondence of the network interface of the cluster device that network interface is more switches to the network interface that comprises virtual network interface on the less cluster device of network interface, realizes synchronous between isomeric group equipment.
With reference to Fig. 2, Fig. 2 is the schematic flow sheet that the present invention realizes method first embodiment of isomeric group device synchronization.
The method that realizes the isomeric group device synchronization that the present embodiment provides comprises:
Step S10, according to the quantity of the network interface of the first cluster device, the second cluster device is configured to a plurality of virtual network interfaces with its network interface; The quantity of the network interface of the first cluster device is greater than the quantity of the network interface of the second cluster device;
When setting up Heterogeneous Cluster Environment, can comprise at least two cluster devices, jointly complete the service processing function of group system by these a plurality of cluster devices, a plurality of cluster devices can arrange the network interface of varying number.In the present embodiment, take Heterogeneous Cluster Environment, comprise that the first cluster device and two cluster devices of the second cluster device describe as example.In the Heterogeneous Cluster Environment that comprises the first cluster device and the second cluster device, be provided with a plurality of for network, carrying out mutual network interface on the first cluster device and the second cluster device.When setting up Heterogeneous Cluster Environment, because the ardware model number possibility of the cluster device that adopts is different, the quantity of the network interface that cluster device is external is likely different, in the present embodiment, suppose that the quantity of network interface of the first cluster device is greater than the quantity of the network interface of the second cluster device, and as primary cluster device, and the second cluster device is as the trim set group facility with the first cluster device.
When setting up Heterogeneous Cluster Environment, quantity according to the network interface of the first cluster device, the second cluster device turns to a plurality of logic network interfaces with its at least one network interface is virtual, be about to network interface and be configured to a plurality of virtual network interfaces, these a plurality of virtual network interfaces share the IP address of a network interface, make the second cluster device comprise that the quantity of network interface of virtual network interface is identical with the quantity of the network interface of the first cluster device.
When step S20, the second cluster device detect the first cluster device and break down, the configuration correspondence of the network interface of the first cluster device is switched to the second cluster device comprise the network interface of virtual network interface;
In the process of the first cluster device work, when as the second cluster device, by corresponding testing mechanism, the first cluster device being detected and break down, quantity according to the network interface of the first cluster device, with the configuration of the network interface of the first cluster device, correspondence switches to the second cluster device and comprises the network interface of virtual network interface.In the present embodiment, the configuration of network interface can comprise the IP address of each network interface, and the corresponding type of service that service can be provided of this network interface.When switching, the IP address of each network interface of the first cluster device and its type of service are switched to corresponding network interface on the second cluster device.
Step S30, the second cluster device receiving network protocol stack is sent to the packet of its network interface, and packet delivery to corresponding network interface is processed.
The second cluster device is completed after the corresponding switching of the configuration of the network interface of the first cluster device, by its network interface, replaces network interface and the network protocol stack of the first cluster device to carry out the transmitting-receiving of packet.Be sent to the packet of its network interface when the receiving network protocol stack after, with the extremely corresponding network interface of received packet delivery, so that it is processed.
The present embodiment is by the quantity of the network interface according to the first cluster device, the network interface of the second cluster device of the negligible amounts of network interface is configured to a plurality of virtual network interfaces, makes the quantity of its network interface identical with the quantity of the first cluster device network interface; When the first cluster device being detected and break down, the configuration correspondence of the network interface of the first cluster device is switched to the second cluster device comprise the network interface of virtual network interface, and the packet of the network interface receiving network protocol stack transmission after passing through to switch, and packet is processed accordingly, make the configuration of the network interface of cluster device in group system can be synchronous, thereby reduced the complexity that Heterogeneous Cluster Environment is set up.
With reference to Fig. 3, Fig. 3 is the schematic flow sheet that the present invention realizes method second embodiment of isomeric group device synchronization.
Realize in the present invention on the basis of method the first embodiment of isomeric group device synchronization, after execution step S10, the method also comprises:
Step S40, the second cluster device are the corresponding MAC Address of a plurality of virtual network interface configuration.
At the second cluster device with the quantity of its network interface according to the network interface of the first cluster device, after being configured to a plurality of virtual network interfaces, for the configuration of each virtual network interface unique independently be used for the MAC Address of this virtual network interface of sign.Receive the packet of network protocol stack transmission when network interface after,, according to the target MAC (Media Access Control) address of packet, can distinguish the packet which virtual network interface this packet is.In the present embodiment, virtual network interface receives the ARP(Address Resolution Protocol from network interface, address resolution protocol) while asking, use the MAC Address of virtual network interface to return to arp reply to network interface; And the source MAC of the packet that sends out by virtual network interface uses the MAC Address of virtual network interface.
After the second cluster device is configured to a plurality of virtual network interfaces with its network interface, the MAC Address that is used for this virtual network interface of sign for each virtual network interface configuration, when carrying out the transmitting-receiving of packet, can be by the corresponding relation of MAC Address recognition data bag and virtual network interface, thus further guaranteed to realize the network interface of cluster device in group system configuration synchronously.
With reference to Fig. 4, Fig. 4 is that the present invention realizes in the method for isomeric group device synchronization the schematic flow sheet of packet delivery to corresponding network interface.
Realize method the first embodiment and second embodiment of isomeric group device synchronization based on the invention described above, step S30 specifically comprises:
Step S31, the second cluster device receiving network protocol stack is sent to the packet of network interface, judges whether network interface disposes a plurality of virtual network interfaces, if perform step S32;
Step S32, the virtual network interface MAC Address corresponding according to packet, process packet delivery to corresponding virtual network interface.
Complete the configuration of the network interface of the first cluster device after corresponding switching at the second cluster device, by its network interface, replace network interface and the network protocol stack of the first cluster device to carry out the transmitting-receiving of packet.Due to the corresponding corresponding network interface of each packet, after receiving network protocol stack and being sent to the packet of network interface, at first judge whether this network interface disposes a plurality of virtual network interfaces, as no, this network interface, according to its type of service that service can be provided, is directly processed packet accordingly; And as network interface, dispose a plurality of virtual network interfaces, the virtual network interface MAC Address corresponding according to packet, to corresponding virtual network interface, virtual network interface can provide the type of service of service to process accordingly packet according to it with packet delivery.
The present invention also provides a kind of Heterogeneous Cluster Environment.
With reference to Fig. 5, Fig. 5 is the structural representation of Heterogeneous Cluster Environment the first embodiment of the present invention.
The Heterogeneous Cluster Environment that the present embodiment provides, comprise the first cluster device 10 and the second cluster device 20, and wherein, the quantity of the network interface of the first cluster device 10 is greater than the quantity of the network interface of the second cluster device 20;
The second cluster device 20 comprises:
Interface configuration module 201, be used for the quantity according to the network interface of the first cluster device, and its network interface is configured to a plurality of virtual network interfaces;
Handover module 202, when to the first cluster device, breaking down, switch to the second cluster device with the configuration correspondence of the network interface of the first cluster device and comprise the network interface of virtual network interface;
Distribution module 203, be used for the receiving network protocol stack and be sent to the packet of network interface, and packet delivery to corresponding network interface is processed.
When setting up Heterogeneous Cluster Environment, can comprise at least two cluster devices, jointly complete the service processing function of group system by these a plurality of cluster devices, a plurality of cluster devices can arrange the network interface of varying number.In the present embodiment, take Heterogeneous Cluster Environment, comprise that the first cluster device 10 and 20 two cluster devices of the second cluster device describe as example.In the Heterogeneous Cluster Environment that comprises the first cluster device 10 and the second cluster device 20, be provided with a plurality of for network, carrying out mutual network interface on the first cluster device 10 and the second cluster device 20.When setting up Heterogeneous Cluster Environment, because the ardware model number possibility of the cluster device that adopts is different, the quantity of the network interface that cluster device is external is likely different, in the present embodiment, suppose that the quantity of network interface of the first cluster device 10 is greater than the quantity of the network interface of the second cluster device 20, and as primary cluster device, and the second cluster device 20 is as the trim set group facility with the first cluster device 10.
When setting up Heterogeneous Cluster Environment, quantity according to the network interface of the first cluster device 10, the interface configuration module 201 of the second cluster device 20 turns to a plurality of logic network interfaces with its at least one network interface is virtual, be about to network interface and be configured to a plurality of virtual network interfaces, these a plurality of virtual network interfaces share the IP address of a network interface, make the second cluster device 20 comprise that the quantity of network interface of virtual network interface is identical with the quantity of the network interface of the first cluster device 10.
In the process of the first cluster device 10 work, when as the second cluster device 20, by corresponding testing mechanism, the first cluster device 10 being detected and break down, the handover module 202 of the second cluster device 20 is according to the quantity of the network interface of the first cluster device 10, with the configuration of the network interface of the first cluster device 10, correspondence switches to the second cluster device 20 and comprises the network interface of virtual network interface.In the present embodiment, the configuration of network interface can comprise the IP address of each network interface, and the corresponding type of service that service can be provided of this network interface.When switching, the IP address of each network interface of the first cluster device 10 and its type of service are switched to corresponding network interface on the second cluster device 20.
The second cluster device 20 is completed after the corresponding switching of the configuration of the network interface of the first cluster device 10, by its network interface, replaces network interface and the network protocol stack of the first cluster device 10 to carry out the transmitting-receiving of packet.Be sent to the packet of its network interface when the receiving network protocol stack after, the distribution module 203 of the second cluster device 20 is with the extremely corresponding network interface of received packet delivery, so that it is processed.
The present embodiment is by the quantity of the network interface according to the first cluster device 10, the network interface of the second cluster device 20 of the negligible amounts of network interface is configured to a plurality of virtual network interfaces, makes the quantity of its network interface identical with the quantity of the first cluster device 10 network interfaces; When the first cluster device 10 being detected and break down, the configuration correspondence of the network interface of the first cluster device 10 is switched to the second cluster device 20 comprise the network interface of virtual network interface, and the packet of the network interface receiving network protocol stack transmission after passing through to switch, and packet is processed accordingly, make the configuration of the network interface of cluster device in group system can be synchronous, thereby reduced the complexity that Heterogeneous Cluster Environment is set up.
With reference to Fig. 6, Fig. 6 is the structural representation of Heterogeneous Cluster Environment the second embodiment of the present invention.
On the basis of Heterogeneous Cluster Environment the first embodiment of the present invention, the second cluster device 20 also comprises:
Address configuration module 204, be used to the corresponding MAC Address of a plurality of virtual network interface configuration.
At the second cluster device 20 with the quantity of its network interface according to the network interface of the first cluster device 10, after being configured to a plurality of virtual network interfaces, the address configuration module 204 of the second cluster device 20 for the configuration of each virtual network interface unique independently be used for the MAC Address of this virtual network interface of sign.Receive the packet of network protocol stack transmission when network interface after,, according to the target MAC (Media Access Control) address of packet, can distinguish the packet which virtual network interface this packet is.In the present embodiment, virtual network interface receives the ARP(Address Resolution Protocol from network interface, address resolution protocol) while asking, use the MAC Address of virtual network interface to return to arp reply to network interface; And the source MAC of the packet that sends out by virtual network interface uses the MAC Address of virtual network interface.
After the second cluster device 20 is configured to a plurality of virtual network interfaces with its network interface, the MAC Address that is used for this virtual network interface of sign for each virtual network interface configuration, when carrying out the transmitting-receiving of packet, can be by the corresponding relation of MAC Address recognition data bag and virtual network interface, thus further guaranteed to realize the network interface of cluster device in group system configuration synchronously.
With reference to Fig. 7, Fig. 7 is the distribution module structural representation of Heterogeneous Cluster Environment the second cluster device of the present invention.
Based on Heterogeneous Cluster Environment the first embodiment of the present invention and the second embodiment, the distribution module 203 of the second cluster device 20 specifically comprises:
Judge module 2031, be used for the receiving network protocol stack and be sent to the packet of network interface, judges whether network interface disposes a plurality of virtual network interfaces;
Distribution submodule 2032, be used for the virtual network interface MAC Address corresponding according to packet, and packet delivery to corresponding virtual network interface is processed.
Complete the configuration of the network interface of the first cluster device after corresponding switching at the second cluster device, by its network interface, replace network interface and the network protocol stack of the first cluster device to carry out the transmitting-receiving of packet.Due to the corresponding corresponding network interface of each packet, after receiving network protocol stack and being sent to the packet of network interface, at first judge module 2031 judges whether this network interface disposes a plurality of virtual network interfaces, as no, this network interface, according to its type of service that service can be provided, is directly processed packet accordingly; And as network interface, dispose a plurality of virtual network interfaces, by the distribution submodule 2032 virtual network interface MAC Address corresponding according to packet, to corresponding virtual network interface, virtual network interface can provide the type of service of service to process accordingly packet according to it with packet delivery.
The foregoing is only the preferred embodiments of the present invention; not thereby limit the scope of the claims of the present invention; every equivalent structure or equivalent flow process conversion that utilizes specification of the present invention and accompanying drawing content to do; or directly or indirectly be used in other relevant technical fields, all in like manner be included in scope of patent protection of the present invention.