CN105049284A - Linux system-based network redundancy testing method and device - Google Patents

Linux system-based network redundancy testing method and device Download PDF

Info

Publication number
CN105049284A
CN105049284A CN201510400430.7A CN201510400430A CN105049284A CN 105049284 A CN105049284 A CN 105049284A CN 201510400430 A CN201510400430 A CN 201510400430A CN 105049284 A CN105049284 A CN 105049284A
Authority
CN
China
Prior art keywords
bond0
network interface
network
server
link
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510400430.7A
Other languages
Chinese (zh)
Inventor
王文悦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201510400430.7A priority Critical patent/CN105049284A/en
Publication of CN105049284A publication Critical patent/CN105049284A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a Linux system-based network redundancy testing method and device. The method includes the following steps that: S1, two servers are determined, and a plurality of network cards configured for the servers are bound as a main standby mode, and the network cards are connected with one another in a one-to-one correspondence manner; S2, when the two servers are in Ping communication with each other, a working link in connected links and a first transmission rate corresponding to the working link are determined, and the determine working link is disconnected; S3, a reselection link in the connected links and a second transmission rate corresponding to the reselection link are determined, and the difference value of the first transmission rate and the second transmission rate are compared, and when the difference value obtained through comparison is not smaller than a set value, a network card corresponding to the reselection link is adjusted, so that the difference value can be smaller than the set value; and S4, the determined reselection link is disconnected, and S3 is executed until connected links do not exist between the two servers. With the Linux system-based network redundancy testing method and device provided by the technical schemes of the invention adopted, network redundancy testing of the Linux system can be realized.

Description

A kind of network redundancy method of testing based on linux system and device
Technical field
The present invention relates to field of computer technology, particularly a kind of network redundancy method of testing based on linux system and device.
Background technology
Along with the develop rapidly of computer technology, the requirement of user to server network is more and more higher, especially to the requirement of server network connection reliability.For realizing these requirements, linux system that performance is more stable can be adopted as the operational environment of server.But when the network interface card of server goes wrong, or link occurs fault, server can not normally be accessed, thus affects the normal operation of enterprise.
In order to improve the reliability that network connects, the general network redundancy technology adopting server, each server configures multiple network interface card, by network redundancy technology, multiple network interface card is invented a network interface card to provide services on the Internet.When net card failures some in multiple network interface card, then in time normal network interface card can be replaced fault network interface card, not be interrupted with the network service of Deterministic service device.
But, if all network interface cards that server configures all break down, then still can cause the network service outages of server, therefore, in order to prevent the network interruption of server, be badly in need of the method for testing that a kind of network redundancy is provided, to detect multiple network interface cards that server configures.
Summary of the invention
In view of this, the invention provides a kind of network redundancy method of testing based on linux system and device, detect with the multiple network interface cards realized server configures.
Embodiments provide a kind of network redundancy method of testing based on linux system, comprising:
S1: determine two servers, for each server, be active-standby mode by the multiple network card bindings configured for current server, and the multiple network interface cards two servers being respectively its configuration are carried out one_to_one corresponding and are connected, wherein, the corresponding link of every a pair network interface card be connected;
S2: when ping leads to mutually between two servers, determine active link in the link be connected, and the first transmission rate corresponding to described active link, and the described active link determined is disconnected;
S3: determine gravity treatment link and the second transmission rate described in this corresponding to gravity treatment link in the link be connected, more described first efficiency of transmission and described second efficiency of transmission difference, when the difference of comparative result is not less than set point, adjust the network interface card corresponding to described gravity treatment link, be less than set point to make comparative result;
S4: by determine this described in gravity treatment link disconnect, and continue perform S3, until do not comprise the link be connected between two servers.
Preferably,
Comprise further: presetting Binding Model is active-standby mode, and server will be restarted or restart network service and be set to bonding module loading mode;
Described is active-standby mode by multiple network card bindings of configuring for current server, comprising: the configuration file building bond0 virtual unit, to set up bond0 virtual unit; Wherein, the configuration file of bond0 virtual unit comprises the IP address of bond0 virtual unit; The original configuration file of each network interface card configured for current server is revised as network profile, to make each network interface card amended by the control of bond0 virtual unit institute; Mode according to restarting server or restarting network service loads bonding module, to make bond0 virtual unit by each network card binding of configuring for current server for active-standby mode;
Comprise further: the IP address in the configuration file of the bond0 virtual unit built respectively for two servers is in the same network segment.
Preferably, comprise further:
Check the state of bond0, whether the MIIStatus corresponding to each network interface card of the state determination current server of bond0 is up, if so, then determines that the state of bond0 is normal; If the MIIStatus comprising target network interface card is down, then described target network card is repaired, to make the MIIStatus of described target network interface card for up.
Preferably, comprise further:
Check the network interface card connection status between two servers, the bond0 in each server comprises IP address, when being comprised the MAC Address identical with bond0 by each network interface card of bond0 control, for characterizing the network interface card successful connection between two servers.
Preferably, when not comprising the link be connected between two servers in S4, comprise further:
Delete the configuration file of bond0 virtual unit in each server, and the original configuration file before the network profile of each network interface card on each server is revised as binding; Delete the start of bonding module and automatically load setting; And restart network service or server, when bond0 disappears, and each network interface card all has different IP and MAC Address, then determine that each network interface card recovers normal condition.
The embodiment of the present invention additionally provides a kind of network redundancy testing apparatus based on linux system, comprising:
Processing unit, for determining two servers, for each server, be active-standby mode by the multiple network card bindings configured for current server, and the multiple network interface cards two servers being respectively its configuration are carried out one_to_one corresponding and are connected, wherein, the corresponding link of every a pair network interface card be connected;
Determining unit, for when ping leads to mutually between two servers, determines active link in the link be connected, and the first transmission rate corresponding to this active link, and is disconnected by this active link determined;
Comparing unit, for determining the second transmission rate corresponding to gravity treatment link and this gravity treatment link in the link be connected, relatively the first efficiency of transmission and the second efficiency of transmission difference, when the difference of comparative result is not less than set point, network interface card corresponding to adjustment gravity treatment link, is less than set point to make comparative result;
Detecting unit, disconnects for this gravity treatment link that will determine, and continuation triggering comparing unit operates, until do not comprise the link be connected between two servers.
Preferably,
Comprising further: memory cell, is active-standby mode for prestoring Binding Model, and will restart server or restart network service and be stored as bonding module loading mode;
Described processing unit, for building the configuration file of bond0 virtual unit, to set up bond0 virtual unit; Wherein, the configuration file of bond0 virtual unit comprises the IP address of bond0 virtual unit; The original configuration file of each network interface card configured for current server is revised as network profile, to make each network interface card amended by the control of bond0 virtual unit institute; Mode according to restarting server or restarting network service loads bonding module, to make bond0 virtual unit by each network card binding of configuring for current server for active-standby mode;
Described processing unit, for the IP address in the configuration file of bond0 virtual unit that builds respectively for two servers in the same network segment.
Preferably, comprise further:
First checks unit, and for checking the state of bond0, whether the MIIStatus corresponding to each network interface card of the state determination current server of bond0 is up, if so, then determines that the state of bond0 is normal; If the MIIStatus comprising target network interface card is down, then described target network card is repaired, to make the MIIStatus of described target network interface card for up.
Preferably, comprise further:
Second checks unit, for checking the network interface card connection status between two servers, bond0 in each server comprises IP address, when being comprised the MAC Address identical with bond0 by each network interface card of bond0 control, for characterizing the network interface card successful connection between two servers.
Preferably, comprise further:
Delete cells, for deleting the configuration file of bond0 virtual unit in each server, and the original configuration file before the network profile of each network interface card on each server is revised as binding; Delete the start of bonding module and automatically load setting; And restart network service or server, when bond0 disappears, and each network interface card all has different IP and MAC Address, then determine that each network interface card recovers normal condition.
Embodiments provide a kind of network redundancy method of testing based on linux system and device, by being active-standby mode by the multiple network card bindings on each server in two servers, can normally access with the network service of Deterministic service device, by the network interface card on two servers is connected one to one, using between two servers can ping leads to mutually time transmission rate as a standard value, when determining gravity treatment link and current transmission rate after often disconnecting active link, standard of comparison value and current transmission rate comparative result, if comparative result exceeds set point, show net card failure corresponding to this gravity treatment link, then can adjust this fault network interface card in time, thus the test achieved network redundancy on server, avoid the network interruption of server.
Accompanying drawing explanation
Fig. 1 is the method flow diagram that the embodiment of the present invention provides;
Fig. 2 is the method flow diagram that another embodiment of the present invention provides;
Fig. 3 is the schematic diagram that server a that the embodiment of the present invention provides is connected with server b card of surfing Internet one_to_one corresponding;
Fig. 4 be the embodiment of the present invention provide bonding module loading success time display result schematic diagram;
Fig. 5 be bond0 state that the embodiment of the present invention provides normal time display result schematic diagram;
Fig. 6 is the network interface card connection status schematic diagram that the embodiment of the present invention provides;
Fig. 7 is the test result schematic diagram that the embodiment of the present invention provides;
Fig. 8 is the apparatus structure schematic diagram that the embodiment of the present invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described.Obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
As shown in Figure 1, embodiments provide a kind of network redundancy method of testing based on linux system, the method can comprise the following steps:
Step 101: determine two servers, for each server, be active-standby mode by the multiple network card bindings configured for current server, and the multiple network interface cards two servers being respectively its configuration are carried out one_to_one corresponding and are connected, wherein, the corresponding link of every a pair network interface card be connected.
Step 102: when ping leads to mutually between two servers, determine active link in the link be connected, and the first transmission rate corresponding to this active link, and this active link determined is disconnected.
Step 103: determine gravity treatment link and this second transmission rate corresponding to gravity treatment link in the link be connected, relatively the first efficiency of transmission and the second efficiency of transmission difference, when the difference of comparative result is not less than set point, network interface card corresponding to adjustment gravity treatment link, is less than set point to make comparative result.
Step 104: this gravity treatment link determined is disconnected, and continue to perform step 103, until do not comprise the link be connected between two servers.
According to such scheme, by being active-standby mode by the multiple network card bindings on each server in two servers, can normally access with the network service of Deterministic service device, by the network interface card on two servers is connected one to one, using between two servers can ping leads to mutually time transmission rate as a standard value, when determining gravity treatment link and current transmission rate after often disconnecting active link, standard of comparison value and current transmission rate comparative result, if comparative result exceeds set point, show net card failure corresponding to this gravity treatment link, then can adjust this fault network interface card in time, thus the test achieved network redundancy on server, avoid the network interruption of server.
Owing to including the bonding module for binding in linux system, therefore, can use is active-standby mode by the network card binding in server in the following manner: the configuration file building bond0 virtual unit, to set up bond0 virtual unit; Wherein, the configuration file of bond0 virtual unit comprises the IP address of bond0 virtual unit; The original configuration file of each network interface card configured for current server is revised as network profile, to make each network interface card amended by the control of bond0 virtual unit institute; Mode according to restarting server or restarting network service loads bonding module, to make bond0 virtual unit by each network card binding of configuring for current server for active-standby mode.
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with drawings and the specific embodiments, the present invention is described in further detail.
As shown in Figure 2, embodiments provide a kind of network redundancy method of testing based on linux system, the method can comprise the following steps:
Step 201: determine two servers, for each server installs multiple network interface card, to ensure each server comprises multiple network interface, the multiple network interface cards two servers being respectively its configuration are carried out one_to_one corresponding and is connected, wherein, the corresponding link of every a pair network interface card be connected.
In the present embodiment, two servers determined are server to be detected, and what install in these two servers is linux system, i.e. the kernel of Linux2.4.x.Wherein when installing linux system, can use PXE server automatically for these two servers install linux system, this linux system can be Redhat6.4 system.
Wherein, network interface card is the networking component being operated in link layer, is the network interface connecting computer and transmission medium in local area network (LAN).
In the present embodiment, comprise three network interface cards for each server and be described in detail to network redundancy test of the present invention, the network interface that these three network interface cards provide respectively can be eth0, eth1 and eth2.
As shown in Figure 3, for the schematic diagram that server a is connected with server b card of surfing Internet one_to_one corresponding, wherein, server a is connected with the eth0 of server b, server a is connected with the eth1 of server b, server a is connected with the eth2 of server b, and every a pair network interface card corresponding a link, i.e. link 0, link 1 and the link 2 that are connected.
Step 202: be active-standby mode by the multiple network card bindings in server a and server b respectively.
In the present embodiment, can be active-standby mode by the multiple network card bindings in each server as follows:
1, the configuration file of bond0 virtual unit is built, with newly-built bond0 virtual unit.
Wherein, the configuration file of the bond0 virtual unit of structure comprises for its IP address of specifying, and this IP address can be 10.10.10.10.
It should be noted that: the IP address of bond0 constructed in server a and server b needs to be arranged on the same network segment.Such as, the IP address of constructed in server b bond0 is 10.10.10.100.
In the present embodiment, the configuration file building bond0 virtual unit comprises following content:
#vi/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.10.10.10
USERCTL=no
It should be noted that, not specifying its MAC Address when building the configuration file of bond0.
2, the original configuration file of each network interface card in server is revised as network profile, to make each network interface card amended by the control of bond0 virtual unit institute.
Wherein, the original configuration file of each network interface card is as follows:
#vi/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
In the present embodiment, for the network interface card eth0 that network interface card is corresponding, following amendment is made to the original configuration file of network interface card, is described to obtain network profile:
#vi/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
Wherein, MASTER=bond0 is for characterizing eth0 by bond0 control, and SLAVE=yes is controlled for characterizing eth0.
In the present embodiment, according to above-mentioned alter mode, the original configuration file of eth1 and eth2 is modified.
3, load bonding module, all bind active-standby mode to make bond0 virtual unit by for each network interface card in server a and server b.
In the present embodiment, setting Binding Model is in the following way active-standby mode: #modprobebondingmiimon=100mode=1.
In the present embodiment, bonding module loading mode can be set to by restarting server or restarting network service.Further, also need bond0 to add modprobe, and configure Binding Model.Wherein, method to set up is as follows: #vi/etc/modprobe.conf, if do not have this file, then #vi/etc/modprobe.d/dist.conf adds following two row in end of file:
aliasbond0bonding
optionsbond0miimon=100mode=1
4, restart network service or restart server.
In the present embodiment, NetworkManager service should first be closed before needing to restart network service:
#serviceNetworkManagerstop
Wherein, to forever close this service, after namely restarting, this service remains closed condition, can input following order again:
#chkconfigNetworkManageroff
In the present embodiment, can use and to restart network service as issued orders or restart server:
#servicenetworkrestart or/etc/init.d/networkrestart
5, bonding module loading state is checked.
In the present embodiment, can use and check as issued orders:
#lsmod|grepbonding
As shown in Figure 4, be the display result schematic diagram during success of bonding module loading.
6, the state of bond0 is checked.
In the present embodiment, the state of checking bond0 as issued orders can be used:
#cat/proc/net/bonding/bond0
As shown in Figure 5, for bond0 state normal time display result schematic diagram.Wherein, if bond0 state is normal, then bond0 all network interface MIIStatus item all should be up, and bondingMode place should be shown as fault-tolerance (active-backup).
If comprise the MIIStatus=down of certain network interface card in display result, represent that this network interface card cannot interconnection network, now should check whether this network interface card has following problem: 1, whether netting twine is plugged; 2, whether netting twine damages; 3, whether network card configuration is correct; 4, whether network interface card is not plugged; 5, whether network interface card damages.And by solving the problem be checked through, to realize the reparation to this network interface card, make the MIIStatus=up of this network interface card after repairing.
7, the network interface card connection status between two servers is checked.
In the present embodiment, can use and check network interface card connection status as issued orders:
#ifconfig
As shown in Figure 6, be network interface card connection status schematic diagram.Wherein, if network interface card connects normal, so only have bond0 to comprise IP address, and the MAC Address of all network interfaces is all consistent with bond0.
Step 203: server a and server b is closed fire compartment wall.
In the present embodiment, use and as given an order the fire compartment wall of server closed:
#serviceiptablesstop
Wherein, then to rerun as issued orders to forever close fire compartment wall (after restarting system namely, fire compartment wall is all closed conditions):
#chkconfigiptablesoff
Step 204: determine whether server a and server b can lead to by ping.
In the present embodiment, used by server a link 0, link 1 and link 2 to send message to server b respectively, the response message that server b returns if all can receive in setting-up time section, then specification server a can lead to server b by ping.Correspondingly, if server b uses link 0, link 1 and link 2 to send message to server a respectively, the response message that server a returns if all can receive in setting-up time section, then characterizing server b can lead to server a by ping.
Wherein, can use and carry out ping detection as issued orders:
Server aping server b:#ping10.10.10.100
Server bping server a:#ping10.10.10.10
Wherein, if can not lead to by ping between server a and server b, then characterizing can not the logical link failure of ping.
Step 205: determine active link in the link be connected, and the first transmission rate corresponding to this active link, and this active link determined is disconnected.
In the present embodiment, can by the equal installation testing software of difference on server a and server b, determine active link, wherein, this testing software can be iperf testing software.
In the present embodiment, install under iperf testing software iperf-2.0.5.tar.gz can being copied linux system, can use and install as issued orders:
#tar-zxvfiperf-2.0.5.tar.gz
#cdiperf-2.0.5/src
#make
#makeinstall
Server a and server b, by running iperf testing software, determines active link.Wherein, server a can be held as server, server b holds as client, and allows testing software by following form:
Server a uses as given an order:
#cdiperf-2.0.5/src
#./iperf-s
Server b uses as given an order:
#cdiperf-2.0.5/src
#./iperf-c10.10.10.10-i-t10000-w1024K-P3
And utilization checks test result as given an order:
#cat/proc/net/bonding/bond0
As shown in Figure 7, be test result schematic diagram; Wherein, be link 0 according to the known active link determined of Fig. 7, the first transmission rate is 1000MB/s.
Step 206: determine gravity treatment link and this second transmission rate corresponding to gravity treatment link in the link be connected, relatively the first efficiency of transmission and the second efficiency of transmission difference, when the difference of comparative result is not less than set point, network interface card corresponding to adjustment gravity treatment link, is less than set point to make comparative result.
In the present embodiment, due to the active-standby mode of the network card configuration in server, when link 0 is disconnected, server can calculate optimal link as gravity treatment link, proceed network service, such as link 1 is attached most importance to select chain road, and the second transmission rate of link 1 can be 1000MB/s.
In the present embodiment, when disconnect current using link time, check that current network connection state and network transmission speed should be constant simultaneously.But network transmission speed should be identical with the first transmission rate of standard in theory, and the second transmission rate will reach the first transmission rate more than 90%.
In the present embodiment, can set point 100MB/s be set, if when the difference of the first transmission rate-the second transmission rate is not less than 100MB/s, then determine that the network interface card of link 1 and correspondence is normal; If difference is less than 100MB/s, then determine the net card failure of this link 1 correspondence.
Step 207: this gravity treatment link determined is disconnected, and continue to perform step 206, until do not comprise the link be connected between two servers.
Step 208: the configuration file deleting bond0 virtual unit in each server, and the original configuration file before the network profile of each network interface card on each server is revised as binding; Delete the start of bonding module and automatically load setting; And restart network service or server, when bond0 disappears, and each network interface card all has different IP and MAC Address, then determine that each network interface card recovers normal condition.
Wherein, use and as given an order bond0 configuration file deleted:
#rm/etc/sysconfig/network-scripts/ifcfg-bond0
#yes
Uses and modify as given an order, and the original configuration file before the network profile of each network interface card is revised as binding comprises:
#vi/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=6C:92:BF:05:CD:6B
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes
Use as the deletion bonding module start that gives an order loads setting automatically:
#vi/etc/modprobe.conf, if do not have this file, #vi/etc/modprobe.d/dist.conf
Following for end of file two row are deleted:
aliasbond0bonding
optionsbond0miimon=100mode=1
And proceed as follows after deletion:
Restart network service: #servicenetworkrestart
Restart server: #reboot
In the present embodiment, network card status is checked by such as giving an order:
#ifconfig
When bond0 disappears, and each network interface card all has different IP and MAC Address to characterize each network interface card recovers normal condition.
According to such scheme, by being active-standby mode by the multiple network card bindings on each server in two servers, can normally access with the network service of Deterministic service device, by the network interface card on two servers is connected one to one, using between two servers can ping leads to mutually time transmission rate as a standard value, when determining gravity treatment link and current transmission rate after often disconnecting active link, standard of comparison value and current transmission rate comparative result, if comparative result exceeds set point, show net card failure corresponding to this gravity treatment link, then can adjust this fault network interface card in time, thus the test achieved network redundancy on server, avoid the network interruption of server.
As shown in Figure 8, the embodiment of the present invention additionally provides a kind of network redundancy testing apparatus based on linux system, comprising:
Processing unit 801, for determining two servers, for each server, be active-standby mode by the multiple network card bindings configured for current server, and the multiple network interface cards two servers being respectively its configuration are carried out one_to_one corresponding and are connected, wherein, the corresponding link of every a pair network interface card be connected;
Determining unit 802, for when ping leads to mutually between two servers, determines active link in the link be connected, and the first transmission rate corresponding to this active link, and is disconnected by this active link determined;
Comparing unit 803, for determining the second transmission rate corresponding to gravity treatment link and this gravity treatment link in the link be connected, relatively the first efficiency of transmission and the second efficiency of transmission difference, when the difference of comparative result is not less than set point, network interface card corresponding to adjustment gravity treatment link, is less than set point to make comparative result;
Detecting unit 804, disconnects for this gravity treatment link that will determine, and continuation triggering comparing unit operates, until do not comprise the link be connected between two servers.
Comprising further: memory cell 805, is active-standby mode for prestoring Binding Model, and will restart server or restart network service and be stored as bonding module loading mode;
Described processing unit 801, for building the configuration file of bond0 virtual unit, to set up bond0 virtual unit; Wherein, the configuration file of bond0 virtual unit comprises the IP address of bond0 virtual unit; The original configuration file of each network interface card configured for current server is revised as network profile, to make each network interface card amended by the control of bond0 virtual unit institute; Mode according to restarting server or restarting network service loads bonding module, to make bond0 virtual unit by each network card binding of configuring for current server for active-standby mode;
Described processing unit 801, for the IP address in the configuration file of bond0 virtual unit that builds respectively for two servers in the same network segment.
Comprise further:
First checks unit 806, and for checking the state of bond0, whether the MIIStatus corresponding to each network interface card of the state determination current server of bond0 is up, if so, then determines that the state of bond0 is normal; If the MIIStatus comprising target network interface card is down, then described target network card is repaired, to make the MIIStatus of described target network interface card for up.
Comprise further:
Second checks unit 807, for checking the network interface card connection status between two servers, bond0 in each server comprises IP address, when being comprised the MAC Address identical with bond0 by each network interface card of bond0 control, for characterizing the network interface card successful connection between two servers.
Comprise further:
Delete cells 808, for deleting the configuration file of bond0 virtual unit in each server, and the original configuration file before the network profile of each network interface card on each server is revised as binding; Delete the start of bonding module and automatically load setting; And restart network service or server, when bond0 disappears, and each network interface card all has different IP and MAC Address, then determine that each network interface card recovers normal condition.
To sum up, the embodiment of the present invention at least can realize following beneficial effect: by being active-standby mode by the multiple network card bindings on each server in two servers, can normally access with the network service of Deterministic service device, by the network interface card on two servers is connected one to one, using between two servers can ping leads to mutually time transmission rate as a standard value, when determining gravity treatment link and current transmission rate after often disconnecting active link, standard of comparison value and current transmission rate comparative result, if comparative result exceeds set point, show net card failure corresponding to this gravity treatment link, then can adjust this fault network interface card in time, thus the test achieved network redundancy on server, avoid the network interruption of server.
The content such as information interaction, implementation between each unit in the said equipment, due to the inventive method embodiment based on same design, particular content can see in the inventive method embodiment describe, repeat no more herein.
It should be noted that, in this article, the relational terms of such as first and second and so on is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element " being comprised a 〃 〃 〃 〃 〃 〃 " limited by statement, and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical factor.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that program command is relevant, aforesaid program can be stored in the storage medium of embodied on computer readable, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium in.
Finally it should be noted that: the foregoing is only preferred embodiment of the present invention, only for illustration of technical scheme of the present invention, be not intended to limit protection scope of the present invention.All any amendments done within the spirit and principles in the present invention, equivalent replacement, improvement etc., be all included in protection scope of the present invention.

Claims (10)

1., based on a network redundancy method of testing for linux system, it is characterized in that, comprising:
S1: determine two servers, for each server, be active-standby mode by the multiple network card bindings configured for current server, and the multiple network interface cards two servers being respectively its configuration are carried out one_to_one corresponding and are connected, wherein, the corresponding link of every a pair network interface card be connected;
S2: when ping leads to mutually between two servers, determine active link in the link be connected, and the first transmission rate corresponding to described active link, and the described active link determined is disconnected;
S3: determine gravity treatment link and the second transmission rate described in this corresponding to gravity treatment link in the link be connected, more described first efficiency of transmission and described second efficiency of transmission difference, when the difference of comparative result is not less than set point, adjust the network interface card corresponding to described gravity treatment link, be less than set point to make comparative result;
S4: by determine this described in gravity treatment link disconnect, and continue perform S3, until do not comprise the link be connected between two servers.
2. method according to claim 1, is characterized in that,
Comprise further: presetting Binding Model is active-standby mode, and server will be restarted or restart network service and be set to bonding module loading mode;
Described is active-standby mode by multiple network card bindings of configuring for current server, comprising: the configuration file building bond0 virtual unit, to set up bond0 virtual unit; Wherein, the configuration file of bond0 virtual unit comprises the IP address of bond0 virtual unit; The original configuration file of each network interface card configured for current server is revised as network profile, to make each network interface card amended by the control of bond0 virtual unit institute; Mode according to restarting server or restarting network service loads bonding module, to make bond0 virtual unit by each network card binding of configuring for current server for active-standby mode;
Comprise further: the IP address in the configuration file of the bond0 virtual unit built respectively for two servers is in the same network segment.
3. method according to claim 1, is characterized in that, before S2, comprises further:
Check the state of bond0, whether the MIIStatus corresponding to each network interface card of the state determination current server of bond0 is up, if so, then determines that the state of bond0 is normal; If the MIIStatus comprising target network interface card is down, then described target network card is repaired, to make the MIIStatus of described target network interface card for up.
4. method according to claim 1, is characterized in that, before S2, comprises further:
Check the network interface card connection status between two servers, the bond0 in each server comprises IP address, when being comprised the MAC Address identical with bond0 by each network interface card of bond0 control, for characterizing the network interface card successful connection between two servers.
5., according to described method arbitrary in claim 1-4, it is characterized in that, when not comprising the link be connected between two servers in S4, comprise further:
Delete the configuration file of bond0 virtual unit in each server, and the original configuration file before the network profile of each network interface card on each server is revised as binding; Delete the start of bonding module and automatically load setting; And restart network service or server, when bond0 disappears, and each network interface card all has different IP and MAC Address, then determine that each network interface card recovers normal condition.
6., based on a network redundancy testing apparatus for linux system, it is characterized in that, comprising:
Processing unit, for determining two servers, for each server, be active-standby mode by the multiple network card bindings configured for current server, and the multiple network interface cards two servers being respectively its configuration are carried out one_to_one corresponding and are connected, wherein, the corresponding link of every a pair network interface card be connected;
Determining unit, for when ping leads to mutually between two servers, determines active link in the link be connected, and the first transmission rate corresponding to this active link, and is disconnected by this active link determined;
Comparing unit, for determining the second transmission rate corresponding to gravity treatment link and this gravity treatment link in the link be connected, relatively the first efficiency of transmission and the second efficiency of transmission difference, when the difference of comparative result is not less than set point, network interface card corresponding to adjustment gravity treatment link, is less than set point to make comparative result;
Detecting unit, disconnects for this gravity treatment link that will determine, and continuation triggering comparing unit operates, until do not comprise the link be connected between two servers.
7. the network redundancy testing apparatus based on linux system according to claim 6, is characterized in that,
Comprising further: memory cell, is active-standby mode for prestoring Binding Model, and will restart server or restart network service and be stored as bonding module loading mode;
Described processing unit, for building the configuration file of bond0 virtual unit, to set up bond0 virtual unit; Wherein, the configuration file of bond0 virtual unit comprises the IP address of bond0 virtual unit; The original configuration file of each network interface card configured for current server is revised as network profile, to make each network interface card amended by the control of bond0 virtual unit institute; Mode according to restarting server or restarting network service loads bonding module, to make bond0 virtual unit by each network card binding of configuring for current server for active-standby mode;
Described processing unit, for the IP address in the configuration file of bond0 virtual unit that builds respectively for two servers in the same network segment.
8. the network redundancy testing apparatus based on linux system according to claim 6, is characterized in that, comprise further:
First checks unit, and for checking the state of bond0, whether the MIIStatus corresponding to each network interface card of the state determination current server of bond0 is up, if so, then determines that the state of bond0 is normal; If the MIIStatus comprising target network interface card is down, then described target network card is repaired, to make the MIIStatus of described target network interface card for up.
9. the network redundancy testing apparatus based on linux system according to claim 6, is characterized in that, comprise further:
Second checks unit, for checking the network interface card connection status between two servers, bond0 in each server comprises IP address, when being comprised the MAC Address identical with bond0 by each network interface card of bond0 control, for characterizing the network interface card successful connection between two servers.
10., according to the described network redundancy testing apparatus based on linux system arbitrary in claim 6-9, it is characterized in that, comprise further:
Delete cells, for deleting the configuration file of bond0 virtual unit in each server, and the original configuration file before the network profile of each network interface card on each server is revised as binding; Delete the start of bonding module and automatically load setting; And restart network service or server, when bond0 disappears, and each network interface card all has different IP and MAC Address, then determine that each network interface card recovers normal condition.
CN201510400430.7A 2015-07-09 2015-07-09 Linux system-based network redundancy testing method and device Pending CN105049284A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510400430.7A CN105049284A (en) 2015-07-09 2015-07-09 Linux system-based network redundancy testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510400430.7A CN105049284A (en) 2015-07-09 2015-07-09 Linux system-based network redundancy testing method and device

Publications (1)

Publication Number Publication Date
CN105049284A true CN105049284A (en) 2015-11-11

Family

ID=54455505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510400430.7A Pending CN105049284A (en) 2015-07-09 2015-07-09 Linux system-based network redundancy testing method and device

Country Status (1)

Country Link
CN (1) CN105049284A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989125A (en) * 2018-08-10 2018-12-11 郑州云海信息技术有限公司 A kind of device and method automatically configuring network interface bond
CN109450726A (en) * 2018-11-01 2019-03-08 郑州云海信息技术有限公司 A kind of bonding test method of the double network interfaces of integrated network card
CN111490909A (en) * 2020-03-08 2020-08-04 苏州浪潮智能科技有限公司 Method for testing server NIC function
CN112003764A (en) * 2020-08-07 2020-11-27 苏州浪潮智能科技有限公司 Method and device for detecting network packet error of distributed storage nodes
CN113949494A (en) * 2021-10-13 2022-01-18 上海许继电气有限公司 Linux system based monitoring system and method for double network card binding
CN114039907A (en) * 2021-10-22 2022-02-11 西安超越申泰信息科技有限公司 Method for improving link stability based on network card binding

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080253295A1 (en) * 2007-04-12 2008-10-16 Hitachi, Ltd. Network system and node apparatus
CN101610283A (en) * 2009-07-17 2009-12-23 浪潮电子信息产业股份有限公司 A kind of method of dynamically balancing received load under network card binding state
CN101800669A (en) * 2009-02-06 2010-08-11 英业达股份有限公司 Network port test system and method
CN102457540A (en) * 2010-10-25 2012-05-16 成都谛听科技有限公司 Low-cost network-attached storage (NAS) integration equipment bandwidth multiplication method
CN104468388A (en) * 2014-11-04 2015-03-25 浪潮电子信息产业股份有限公司 Method for testing load balancing of network card based on Linux system
CN104539469A (en) * 2014-11-27 2015-04-22 盛科网络(苏州)有限公司 Method and device of testing master-slave switching time based on test messages

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080253295A1 (en) * 2007-04-12 2008-10-16 Hitachi, Ltd. Network system and node apparatus
CN101800669A (en) * 2009-02-06 2010-08-11 英业达股份有限公司 Network port test system and method
CN101610283A (en) * 2009-07-17 2009-12-23 浪潮电子信息产业股份有限公司 A kind of method of dynamically balancing received load under network card binding state
CN102457540A (en) * 2010-10-25 2012-05-16 成都谛听科技有限公司 Low-cost network-attached storage (NAS) integration equipment bandwidth multiplication method
CN104468388A (en) * 2014-11-04 2015-03-25 浪潮电子信息产业股份有限公司 Method for testing load balancing of network card based on Linux system
CN104539469A (en) * 2014-11-27 2015-04-22 盛科网络(苏州)有限公司 Method and device of testing master-slave switching time based on test messages

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
STEFAN AUST ET AL.: "Evaluation of Linux Bonding Features", 《PROCEEDINGS OF 2006 10TH INTERNATIONAL CONFERENCE ON COMMUNICATION TECHNOLOGY》 *
胡修林等: "多网卡链路绑定策略的研究与实现", 《小型微型计算机系统》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989125A (en) * 2018-08-10 2018-12-11 郑州云海信息技术有限公司 A kind of device and method automatically configuring network interface bond
CN109450726A (en) * 2018-11-01 2019-03-08 郑州云海信息技术有限公司 A kind of bonding test method of the double network interfaces of integrated network card
CN111490909A (en) * 2020-03-08 2020-08-04 苏州浪潮智能科技有限公司 Method for testing server NIC function
CN111490909B (en) * 2020-03-08 2022-04-26 苏州浪潮智能科技有限公司 Method for testing server NIC function
CN112003764A (en) * 2020-08-07 2020-11-27 苏州浪潮智能科技有限公司 Method and device for detecting network packet error of distributed storage nodes
CN112003764B (en) * 2020-08-07 2021-10-22 苏州浪潮智能科技有限公司 Method and device for detecting network packet error of distributed storage nodes
CN113949494A (en) * 2021-10-13 2022-01-18 上海许继电气有限公司 Linux system based monitoring system and method for double network card binding
CN114039907A (en) * 2021-10-22 2022-02-11 西安超越申泰信息科技有限公司 Method for improving link stability based on network card binding

Similar Documents

Publication Publication Date Title
CN105049284A (en) Linux system-based network redundancy testing method and device
US9817721B1 (en) High availability management techniques for cluster resources
CN102622298B (en) Software testing system and method
US9282021B2 (en) Method and apparatus for simulated failover testing
CN103200036B (en) A kind of automation collocation method of electric power system cloud computing platform
CN108959045B (en) Method and system for testing fault switching performance of NAS cluster
CN109587331B (en) Method and system for automatically repairing cloud mobile phone fault
CN108984349B (en) Method and device for electing master node, medium and computing equipment
CN109274537B (en) Continuous network virtualization platform system
CN111274077A (en) Disk array reliability testing method, system, terminal and storage medium
CN104036043A (en) High availability method of MYSQL and managing node
CN105550056A (en) System reconfiguration based fault self-recovery system and realization method therefor
CN112380062A (en) Method and system for rapidly recovering system for multiple times based on system backup point
CN116089011A (en) Method and device for creating mirror warehouse, storage medium and electronic equipment
CN115632706A (en) FC link management method, device, equipment and readable storage medium
US11044148B2 (en) Optimistic and failsafe network configuration
CN111813605A (en) Disaster recovery method, platform, electronic device, and medium
CN111124749A (en) Method and system for automatically repairing BMC (baseboard management controller) system of tightly-coupled high-performance computer system
CN111988169B (en) Method, system, equipment and medium for cleaning and repairing abnormal disk of cloud platform
US10754753B1 (en) Performance of virtual machine instances using machine recognition of screenshot images
US7865766B2 (en) Providing increased availability of I/O drawers during concurrent I/O hub repair
CN115098324A (en) Hard disk maintenance method, device, equipment and storage medium
CN110798347B (en) Service state detection method, device, equipment and storage medium
CN113987065A (en) Database drifting method, system, electronic device and storage medium
CN112035250A (en) High-availability local area network service management method, equipment and deployment architecture

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20151111