Intel Omni-Path客户端与Mellonax InfiniBand Lustre存储路由配置


Lustre利用LNet支持多种协议之间的互通,比如InfiniBand(IB)、Intel Omni-Path(OPA)与以太网等,并且支持多路由冗余等,本文主要介绍IB与OPA之间的互通。

  1. 拓扑 |
    - 服务端(IB) NID:10.10.100.1@o2ib1(IP地址@网络类型)
    - 客户端(OPA) NID:10.11.135.1@o2ib2
    - LNet端(IB、OPA) NID:
    - IB:10.10.100.11@o2ib1
    - OPA:10.11.100.11@o2ib2
    | | Lustre 路由转发 - 图1 | | —- | —- | —- |

  2. 注意:服务端与客户端的网络类型要不同,如分别为o2ib1和o2ib2,LNet端与服务端和客户端互联的类型要分别一一对应。

  3. 所有节点关闭防火墙和SELinux

    • 关闭防火墙
    • 关闭SELinux
      • setenforce 0使得当前启动后的系统禁止SELinux,系统重启后此设置失效。
      • 编辑/etc/sysconfig/selinux,将SELINUX=enforcing变为SELINUX=disabled,以便使系统重启后禁止SELinux。
    • 服务端(IB)
      • IP:10.10.100.1/16
      • 设置路由(对Lustre可不设置,只用于IB与OPA的IP地址通,方便SSH等访问)
      • 查看路由:ip rdefault via 192.168.100.254 dev eno1 proto static metric 100 10.10.0.0/16 dev ib0 proto kernel scope link src 10.10.100.1 10.11.0.0/16 via 10.10.100.11 dev ib0 169.254.0.0/16 dev ib0 scope link metric 1007 192.168.0.0/16 dev eno1 proto kernel scope link src 192.168.100.1 metric 100
      • 设置Lustre模块参数:编辑/etc/modprobe.d/lustre.conf
      • 重新加载Lustre模块
      • 生成MDT和OST等(两个冗余节点):
      • 查看Lustre网络ID:lctl list_nids10.10.100.1@o2ib1
      • 查看Lustre网络:lnetctl net shownet: - net type: lo local NI(s): - nid: 0@lo status: up - net type: o2ib1 local NI(s): - nid: 10.10.100.1@o2ib1 status: up interfaces: 0: ib0
      • 查看Lustre路由:lnetctl route showroute: - net: o2ib2 gateway: 10.10.100.11@o2ib1 - net: o2ib2 gateway: 10.10.100.12@o2ib1
    • LNet节点(IB, OPA)
      • IP
        • IB:10.10.100.11/16
        • OPA:10.11.100.11/16
      • 查看路由:ip rdefault via 192.168.100.254 dev ens5 proto static metric 100 10.10.0.0/16 dev ib0 proto kernel scope link src 10.10.100.11 metric 150 10.11.0.0/16 dev ib1 proto kernel scope link src 10.11.100.11 metric 150 192.168.0.0/16 dev ens5 proto kernel scope link src 192.168.100.11 metric 100
      • 设置路由转发
      • 设置Lustre模块:编辑/etc/modprobe.d/lustre.conf
      • 重新加载Lustre模块
      • 显示Lustre网络ID:lctl list_nids10.10.100.11@o2ib1 10.11.100.11@o2ib2
      • 显示Lustre网络:lnetctl net shownet: - net type: lo local NI(s): - nid: 0@lo status: up - net type: o2ib1 local NI(s): - nid: 10.10.100.11@o2ib1 status: up interfaces: 0: ib0 - net type: o2ib2 local NI(s): - nid: 10.11.100.11@o2ib2 status: up interfaces: 0: ib1
    • 显示Lustre路由:lnetctl route show,此时无输出是正常的。
    • 客户端(OPA)
      • 设置路由(对Lustre可不设置,只用于IB与OPA的IP地址通,方便SSH等访问)
      • 显示路由:ip rdefault via 192.168.100.254 dev enp2s0f0 proto static metric 100 10.10.0.0/16 via 10.11.100.11 dev ib0 10.11.0.0/16 dev ib0 proto kernel scope link src 10.11.135.1 169.254.0.0/16 dev ib0 scope link metric 1004 192.168.0.0/16 dev enp2s0f0 proto kernel scope link src 192.168.135.1 metric 100
      • 设置Lustre模块:编辑/etc/modprobe.d/lustre.conf
      • 重新加载Lustre模块
      • 显示Lustre网络ID:lctl list_nids10.11.135.1@o2ib2
      • 显示Lustre网络:lnetctl net shownet: - net type: lo local NI(s): - nid: 0@lo status: up - net type: o2ib2 local NI(s): - nid: 10.11.135.1@o2ib2 status: up interfaces: 0: ib0
      • 显示Lustre路由:lnetctl route showroute: - net: o2ib1 gateway: 10.11.100.11@o2ib2 - net: o2ib1 gateway: 10.11.100.12@o2ib2
      • 加载Lustre文件目录
      • 查看加载情况:df /home,将显示Filesystem 1K-blocks Used Available Use% Mounted on 10.10.100.1@o2ib1:/lxfs 7341068688 143568 6970159092 1% /home
    • 互通性测试
      • IB服务端 -> OPA客户端:traceroute 10.11.135.1traceroute to 10.11.135.1 (10.11.135.1), 30 hops max, 60 byte packets 1 10.10.100.11 (10.10.100.11) 0.097 ms 0.064 ms 0.048 ms 2 10.11.135.1 (10.11.135.1) 0.146 ms 0.135 ms 0.126 ms
      • OPA客户端 -> IB服务端:traceroute 10.10.100.1traceroute to 10.10.100.1 (10.10.100.1), 30 hops max, 60 byte packets 1 10.11.100.11 (10.11.100.11) 0.105 ms 0.082 ms 0.066 ms 2 bio1 (10.10.100.1) 0.149 ms 0.147 ms 0.145 ms
      • IB服务端 -> LNet IB: lctl ping 10.10.100.11@o2ib112345-0@lo 12345-10.10.100.11@o2ib1 12345-10.11.100.11@o2ib2
      • IB服务端 -> OPA客户端: lctl ping 10.11.135.1@o2ib212345-0@lo 12345-10.11.135.1@o2ib2
      • OPA客户端 -> IB服务端: lctl ping 10.10.100.1@o2ib112345-0@lo 12345-10.10.100.1@o2ib1
    • 常用命令

      • 添加Lustre路由:lnetctl route add —net o2ib2 —gateway 10.10.100.11@o2ib1
      • 删除Lustre路由:lnetctl route del —net o2ib2 —gateway 10.10.100.11@o2ib1

        1. systemctl disable firewalld
        2. systemctl stop firewalld
        1. ip route add 10.11.0.0/16 via 10.10.100.11

        上述设置系统重启后会失效,可以添加到启动脚本/etc/rc.local中设置成设成永久有效:

        1. #选项 lnet networks="本机IB网络类型(网卡)" routes="客户端OPA网络类型 LNet节点对应本地服务端IB的IP@网络类型"
        2. options lnet networks="o2ib1(ib0)" routes="o2ib2 10.10.100.[11-12]@o2ib1"
        1. lustre_rmmod
        2. modprobe -v lustre
        1. mkfs.lustre --fsname=lxfs --mgs --mdt --index=0 --servicenode=10.10.100.1@o2ib1 --servicenode=10.10.100.2@o2ib1 --reformat /dev/mapper/mpathb
        2. mkfs.lustre --fsname=lxfs --mgsnode=10.10.100.1@o2ib1 --mgsnode=10.10.100.2@o2ib1 --servicenode=10.10.100.1@o2ib1 --servicenode=10.10.100.2@o2ib1 --ost --reformat --index=1 /dev/mapper/mpathc
        3. mkfs.lustre --fsname=lxfs --mgsnode=10.10.100.1@o2ib1 --mgsnode=10.10.100.2@o2ib1 --servicenode=10.10.100.1@o2ib1 --servicenode=10.10.100.2@o2ib1 --ost --reformat --index=2 /dev/mapper/mpathd
        1. echo 1 > /proc/sys/net/ipv4/conf/ib0/forwarding
        2. echo 1 > /proc/sys/net/ipv4/conf/ib1/forwarding

        上述设置系统重启后会失效,编辑/usr/lib/sysctl.d/00-system.conf设成永久有效(仅对ib0和ib1的IPv4进行转发):

        1. #选项 lnet networks="本机IB网络类型(IB网卡),本机OPA网络类型(OPA网卡)" forwarding="启用"
        2. options lnet networks="o2ib1(ib0),o2ib2(ib1)" forwarding="enabled"
        1. lustre_rmmod
        2. modprobe -v lustre
        1. ip route add 10.10.0.0/16 via 10.11.100.11

        上述设置系统重启后会失效,可以采用以下两种方法之一设置成设成永久有效:

        • 添加到启动脚本/etc/rc.local中
        • 添加到/etc/sysconfig/network-scripts/route-ib0
          1. echo "ip route add 10.11.0.0/16 via 10.10.100.11">>/etc/rc.local
          1. 10.10.0.0/16 via 10.11.100.11 dev ib0
          1. #选项 lnet networks="本机客户端OPA网络类型(网卡)" routes="服务端IB网络类型 LNet节点对应客户端OPA的IP@网络类型"
          2. options lnet networks="o2ib2(ib0)" routes="o2ib1 10.11.100.[11-12]@o2ib2"
          1. lustre_rmmod
          2. modprobe -v lustre
          1. mount -v -t lustre 10.10.100.1@o2ib1:/lxfs /home
          参考文档:Intel ® Omni-Path Storage Router(http://www.intel.com/content/dam/support/us/en/documents/network-and-i-o/fabric-products/Intel_OP_Storage_Router_DG_H99668_v2_0.pdf)