ceph集群绑定多网卡

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

环境:ubuntu16.04 LTS 四个万兆光纤网口,搭建ceph集群,ceph集群网绑定两个网卡,ceph公共网绑定两个网卡,绑定模式mode=4,交换机用华为万兆S6720

一、配置服务端网口配置文件

1、安装ifenslave

apt-get install ifenslave-2.6

2、网口配置文件如下

# The primary network interface
auto enP2p1s0f1
iface enP2p1s0f1 inet manual
    bond-master bond0
iface enP2p1s0f2 inet manual
    bond-master bond0
auto enP2p1s0f3
iface enP2p1s0f3 inet manual
    bond-master bond1
auto enP2p1s0f4
iface enP2p1s0f4 inet manual
    bond-master bond1
auto bond0
iface bond0 inet static
    address 10.33.0.40
    netmask 255.255.0.0
    network 10.33.0.0
    broadcast 10.33.255.255
    gateway 10.33.0.254
    dns-nameservers 172.16.2.1
    bond-mode 4
    bond-miimon 100
    bond-lacp-rate 1
    bond-slaves enP2p1s0f1 enP2p1s0f2
auto bond1
iface bond1 inet static
    address 192.168.3.40
    netmask 255.255.255.0
    network 192.168.3.0
    broadcast 192.168.3.255
    bond-mode 4
    bond-miimon 100
    bond-lacp-rate 1
    bond-slaves enP2p1s0f3 enP2p1s0f4

 

3、重启网络

systemctl restart networking

4、查看网络状态
 用ip addr可以看到bond0和bond1也slave网卡有相同的mac地址。

5、查看绑定网卡状态

cat /proc/net/bonding/bond0

cat /proc/net/bonding/bond1

如果配置正确的话在输出内容中可以看到网卡是up状态。

参考 https://help.ubuntu.com/community/UbuntuBonding

二、交换机配置

1、交换机需要使能lacp功能,并配置trunk,其中一个端口配置如下:

interface Eth-Trunk1
 port link-type access
 port default vlan 330                    
 mode lacp

 

转载于:https://my.oschina.net/u/2326998/blog/822199

你可能感兴趣的:(ceph集群绑定多网卡)