论坛风格切换切换到宽版
  • 1433阅读
  • 5回复

[问题求助][RedHat] linux 双网卡,设置为两个bonding 设备的问题 [复制链接]

上一主题 下一主题
 
发帖
2108
C币
-235176
威望
396
贡献值
1
银元
-2
铜钱
4672
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
物理.网卡两个: eth0和eth1.
设置bond0已经实现。
现在想设置第二个bonding设备,尝试了一下,启用bond1时提示.设备不存在.,无法启用。配置文件如下:.


QUOTE:bond1设备配置文.件    美容
# cat if.cfg-bond1域名
#This file set. the. bond0 network interface域名
DEVICE=bond1
ONBOOT=yes
BOOTP.ROTO=static           建材
IPADDR=172.30.25..11          婚庆
NETMASK=255.255.2.55.0.
GATEWAY=.172.30.25.1.

eth0:1设备配置文件
#. cat ifcfg-eth0:1.
# Adv.anced Micro Devices [AMD] 79c.970 [PCnet32 LANCE].
DEVICE=eth0
HWADDR=08:.00:27:65:d9:ea            杀毒
ONBOOT=yes
BOOTPROTO=none
MASTER=bond1
SLAVE=yes

eth1:1设备配置文件
# cat ifcfg-eth.1:1    美容
#. Advanced Micro Devices [AMD] 79c970 [PCnet32 LA.NCE]服务器
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
HWADDR=08:00:27:bc:72:.d3.
MASTER=bond1
SLAVE=yes


在./etc/modprobe.conf.文件内添加了以下配置:[成人用品]


QUOTE:# cat /etc/m.odprobe.co.nf电脑
ali.as eth0 pcnet32教育
alias eth1 pcnet.32.
alias bo.nd0 bonding.
alia.s bond1 bonding.
#Th.e mode=0 means round-rob.in服务器
option.s bond0 miimon=100 .mode=0.
options bond.1 miimon.=100 mode=0          婚庆


现在启用bond1设备.时提示如下:外贸


Q..UOTE:bonding device bond1 does not seem to be pre.sent, delaying initialization.



请问有兄弟知道怎么回事吗?

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线justinwei.
发帖
2072
C币
-140234
威望
368
贡献值
1
银元
-2
铜钱
4597
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
Re:[RedHat]
看了几遍确定,eth0:1设备配置文件和eth1:1设备配置文件的MASTER=bond1???

离线kaobo.
发帖
2065
C币
-60356
威望
403
贡献值
1
银元
-2
铜钱
4722
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-13
Re:[RedHat]
看你四篇精华帖,再看看你的文章,俺就不敢多说了,拿出我以前做的文档吧。

1、/etc/sysconfig/network-scripts/ifcfg-bond0
        DEVICE=bond0
        ONBOOT=yes
        BOOTPROTO=static
        IPADDR=192.168.0.1
        NETMASK=255.255.255.0
        GATEWAY=192.168.0.254
        USERCTL=no

2、/etc/sysconfig/network-scripts/ifcfg-eth0
        DEVICE=eth0
        ONBOOT=yes
        BOOTPROTO=static
        MASTER=bond0
        SLAVE=yes
        USERCTL=no

3、/etc/sysconfig/network-scripts/ifcfg-eth1
        DEVICE=eth1
        ONBOOT=yes
        BOOTPROTO=static
        MASTER=bond0
        SLAVE=yes
        USERCTL=no

4、/etc/modprobe.conf,添加:
        alias bond0 bonding
        options bond0 miimon=100 mode=1
建议使用1,即负载均衡模式;不建议使用0,即高可用;
因为我在测试的时候,明显的发现,0时,拔掉一个网线,网络就断开了,只有当服务器ping下面客户机之后网络才会好(有时)。

离线ac2004.
发帖
2062
C币
-60745
威望
376
贡献值
1
银元
-1
铜钱
4591
人人网人气币
0
只看该作者 地板  发表于: 2010-04-13
Re:[RedHat]
冒昧的问一句:
你这eth0、eth1咋一会变成eth0:1、eth:1了?

还有:
alias bond0 bonding
alias bond1 bonding
#The mode=0 means round-robin
options bond0 miimon=100 mode=0
options bond1 miimon=100 mode=0
中的bond0又是咋回事?

离线linyanqi.
发帖
2152
C币
-604665
威望
405
贡献值
2
银元
-1
铜钱
4817
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-13
Re:[RedHat]
先描述一下我的想法,以此回答一下上面兄弟的问题:
1、我只有2张网卡,需要使用2个IP,最简单的方法当然是一个网卡一个IP了。但是,我希望这两张网卡能:负载均衡并热备。所以需要:双网卡设置两个bonding设备。
2、我的想法是,eth0与eth1模拟一个bond0,然后eth0:1与eth1:1模拟一个bond1,这样就达到目的了。
3、原帖的第二行说了“设置bond0已经实现。”,现在碰到的问题是bond1无法实现,所以后面的文字,都是针对bond1来描述的,可能造成了上面兄弟的疑惑。


再详细看了一下文档:
http://www.mjmwired.net/kernel/D ... working/bonding.txt


QUOTE:max_bonds

        Specifies the number of bonding devices to create for this
        instance of the bonding driver.  E.g., if max_bonds is 3, and
        the bonding driver is not already loaded, then bond0, bond1
        and bond2 will be created.  The default value is 1.  Specifying
        a value of 0 will load bonding, but will not create any devices.

原来要在/etc/modprobe.conf的options内指定数量的。默认是1,所以bond1我创建不起来。

再然后,再看下一节:


QUOTE:3.1.2 Configuring Multiple Bonds with Sysconfig
-----------------------------------------------

        The sysconfig network initialization system is capable of
handling multiple bonding devices.  All that is necessary is for each
bonding instance to have an appropriately configured ifcfg-bondX file
(as described above).  Do not specify the "max_bonds" parameter to any
instance of bonding, as this will confuse sysconfig.  If you require
multiple bonding devices with identical parameters, create multiple
ifcfg-bondX files.

        Because the sysconfig scripts supply the bonding module
options in the ifcfg-bondX file, it is not necessary to add them to
the system /etc/modules.conf or /etc/modprobe.conf configuration file.


这里说,使用sysconfig脚本来初始化网络的系统,可以直接识别多个bonding设备,只需要设置多个ifcfg-bondX文件就好了。

看起来有点矛盾了吧?那我到底在/etc/modprobe.conf内要不要增加:
options bond1 miimon=100 mode=0
这行呢?
在options里面,要不要添加 max_bonds=2参数呢?

我需要再测试一下。
有条件的兄弟现在可以测试测试,我手上暂时没环境,要回家才可以。

离线zymxs.
发帖
2008
C币
-193636
威望
349
贡献值
1
银元
-4
铜钱
4362
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-13
Re:[RedHat]
我可以肯定的告诉你,在虚机上测试是有问题的,

如果您真的有需要做bonding,请不要用虚机
快速回复
限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
上一个 下一个