Applies to:
Linux Kernel – Version: 2.6.9.42 to 2.6.9.55
Red Hat Advanced Server
Checked for relevance on 27-Jul-2009
Goal
You need to create two different bonding configurations.
If you are using the “max_bonds=”
tag the options cannot be set differently for each bond interface.
For example, you need bond0 which is eth0,eth2 to be mode=1 (active-backup) and bond1 which is eth1,eth3 to be mode=0 (round-robin). So below would need to be appended to /etc/modprobe.conf:
install bond0 /sbin/modprobe bonding -o bond0 mode=1 miimon=50 downdelay=100 updelay=150 primary=eth0 install bond1 /sbin/modprobe bonding -o bond1 mode=0 miimon=100 downdelay=100 updelay=100 primary=eth1
Each configured bond interface needs an entry in /etc/modprobe.conf.
For more information refer to /usr/src/linux-<kernel>/Documentation/networking/bonding.txt file and
section 3.3.1 Configuring Multiple Bonds Manually.
Solution
1. Edit /etc/modprobe.conf and append following two lines:
install bond0 /sbin/modprobe bonding -o bond0 mode=1 miimon=50 downdelay=100 updelay=150 primary=eth0 install bond1 /sbin/modprobe bonding -o bond1 mode=0 miimon=100 downdelay=100 updelay=100 primary=eth1
2. Set up bond interfaces:
- bond0:
# vi /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 BOOTPROTO=dhcp ONBOOT=yes TYPE=Ethernet
- bond1:
# vi /etc/sysconfig/network-scripts/ifcfg-bond1 DEVICE=bond1 BOOTPROTO=none BROADCAST=10.0.0.255 IPADDR=10.0.0.1 NETMASK=255.255.255.0 NETWORK=10.0.0.0 ONBOOT=yes TYPE=Ethernet
3. Configure ethernet interfaces:
- For bond0:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 USERCTL=no MASTER=bond0 ONBOOT=no SLAVE=yes BOOTPROTO=none # vi /etc/sysconfig/network-scripts/ifcfg-eth2 DEVICE=eth2 USERCTL=no MASTER=bond0 ONBOOT=no SLAVE=yes BOOTPROTO=none
- For bond1:
# vi /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 USERCTL=no MASTER=bond1 ONBOOT=no SLAVE=yes BOOTPROTO=none # vi /etc/sysconfig/network-scripts/ifcfg-eth3 DEVICE=eth3 USERCTL=no MASTER=bond1 ONBOOT=no SLAVE=yes BOOTPROTO=none
4. Reboot the system for the changes to take effect –or– manually restart the network.
# service network restart Shutting down loopback interface: [ OK ] Setting network parameters: [ OK ] Bringing up loopback interface: ip_tables: (C) 2000-2002 Netfilter core team [ OK ] Bringing up interface bond0: ip_tables: (C) 2000-2002 Netfilter core team bonding: Warning: failed to get speed/duplex from eth0, speed forced to 100Mbps, duplex forced to Full. bonding: Warning: failed to get speed/duplex from eth2, speed forced to 100Mbps, duplex forced to Full. [ OK ] Bringing up interface bond1: ip_tables: (C) 2000-2002 Netfilter core team bonding: Warning: failed to get speed/duplex from eth1, speed forced to 100Mbps, duplex forced to Full. bonding: Warning: failed to get speed/duplex from eth3, speed forced to 100Mbps, duplex forced to Full. [ OK ]
5. Check Setup.
Will show the bonding module is loaded twice which is required for this type of configuration.
# lsmod |grep bond bond1 65128 0 bond0 65128 0
- bond0:
# cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v2.6.3 (June 8, 2005) Bonding Mode: fault-tolerance (active-backup) Primary Slave: eth0 Currently Active Slave: eth0 MII Status: up MII Polling Interval (ms): 50 Up Delay (ms): 150 Down Delay (ms): 100 Slave Interface: eth0 MII Status: up Link Failure Count: 0 Permanent HW addr: 00:0c:29:ec:e2:34 Slave Interface: eth2 MII Status: up Link Failure Count: 0 Permanent HW addr: 00:0c:29:ec:e2:48
- bond1:
# cat /proc/net/bonding/bond1 Ethernet Channel Bonding Driver: v2.6.3 (June 8, 2005) Bonding Mode: load balancing (round-robin) MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 100 Down Delay (ms): 100 Slave Interface: eth1 MII Status: up Link Failure Count: 0 Permanent HW addr: 00:0c:29:ec:e2:3e Slave Interface: eth3 MII Status: up Link Failure Count: 0 Permanent HW addr: 00:0c:29:ec:e2:52
- ifconfig:
# ifconfig -a
bond0 Link encap:Ethernet HWaddr 00:0C:29:EC:E2:34
inet addr:dhcp ip Bcast:dhcp bcast Mask:255.255.252.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:3467 errors:0 dropped:0 overruns:0 frame:0
RX packets:55 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:278409 (271.8 KiB) TX bytes:7856 (7.6 KiB)
bond1 Link encap:Ethernet HWaddr 00:0C:29:EC:E2:3E
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:3193 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:251288 (245.3 KiB) TX bytes:210 (210.0 b)
eth0 Link encap:Ethernet HWaddr 00:0C:29:EC:E2:34
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1757 errors:0 dropped:0 overruns:0 frame:0
TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:142647 (139.3 KiB) TX bytes:7646 (7.4 KiB)
Interrupt:177 Base address:0x1400
eth1 Link encap:Ethernet HWaddr 00:0C:29:EC:E2:3E
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1595 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:125570 (122.6 KiB) TX bytes:210 (210.0 b)
Interrupt:185 Base address:0x1480
eth2 Link encap:Ethernet HWaddr 00:0C:29:EC:E2:34
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1710 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:135762 (132.5 KiB) TX bytes:210 (210.0 b)
Interrupt:193 Base address:0x1800
eth3 Link encap:Ethernet HWaddr 00:0C:29:EC:E2:3E
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1598 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:125718 (122.7 KiB) TX bytes:0 (0.0 b)
Interrupt:169 Base address:0x1880
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:584 errors:0 dropped:0 overruns:0 frame:0
TX packets:584 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17264 (16.8 KiB) TX bytes:17264 (16.8 KiB)
- ping:
# ping -I bond1 10.0.0.2 PING 10.0.0.2 (10.0.0.2) from 10.0.0.1 bond1: 56(84) bytes of data. 64 bytes from 10.0.0.2: icmp_seq=0 ttl=64 time=144 ms 64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=2.03 ms --- 10.0.0.2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1003ms rtt min/avg/max/mdev = 2.030/73.179/144.328/71.149 ms, pipe 2 # ping -I bond0 oracle.com PING oracle.com (141.146.8.66) from <dhcp ip> bond0: 56(84) bytes of data. 64 bytes from bigip-otn-portal.oracle.com (141.146.8.66): icmp_seq=0 ttl=247 time=41.8 ms 64 bytes from bigip-otn-portal.oracle.com (141.146.8.66): icmp_seq=1 ttl=247 time=39.4 ms --- oracle.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1003ms rtt min/avg/max/mdev = 39.432/40.653/41.875/1.238 ms, pipe 2
© 2009, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.
相关文章 | Related posts:
- gc lost blocks diagnostics
- How to Configure RHEL/OEL 5 32-bit for Very Large Memory with ramfs and HugePages
- Linux Ethernet Bonding Driver
- Checklist for Performance Problems with Parallel Execution
- Tracing Parallel Execution with _px_trace. Part I
- Automatic PGA Memory Management
- THE GAINS AND PAINS OF NOLOGGING OPERATIONS
- Script to Detect Tablespace Fragmentation
- How To Calculate The Required Network Bandwidth Transfer Of Archivelogs In Dataguard Environments




最新评论