When you are running bonding in active-backup mode, you can detect which slave is active by listing /proc/net/bonding/bond0. How to change active slave?
[root@rs01 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 250
ARP IP target/s (n.n.n.n form): 10.0.0.1, 10.0.0.2, 10.0.0.3, 10.0.0.200
Slave Interface: eth1
MII Status: up
Link Failure Count: 2
Permanent HW addr: 00:1b:21:46:64:42
Slave Interface: eth0
MII Status: up
Link Failure Count: 2
Permanent HW addr: 00:24:81:26:c1:43
To switch to other slave, just remove active interface from bonding configuration
echo -eth1 > /sys/class/net/bond0/bonding/slaves
Bonding will continue with other interface, which becomes active. Now you can put interface eth1 back to bonding
echo +eth1 > /sys/class/net/bond0/bonding/slaves
Thanks a lot! I avoided unnecessary restart of my proxmox host!
Best regards!
Marcin
Thanks for the trick, worked perfectly!
Thanks this worked .
ifenslave can be used as well:
http://linux.die.net/man/8/ifenslave
ifenslave –change-active bond0 eth1
You might as well just bring the interface down so that failover can happen. This should work fine as the bond interface is in active-backup configuration.
Consider a Clustered Database server so will it affect my cluster causing it to failover??? Will i loose network connection???
No, you should not lose network connection.
If i have a Clustered Database and if I apply it on Active node will it failover??? Will i loose network connection??
It “WILL” not loose network connection
This is more better and safer solution
Try it out
http://www.setuptips.com/unix/linux-bonding/