天天看點

Yum安裝支援InfiniBand的lustre——Install Lustre with InfiniBand Support By Yum

前言:實驗室需要搭建一套Lustre,我在使用了網上各種教程之後總是不成功,于是嘗試了使用Lustre的yum庫來安裝,作如下總結

安裝支援InfiniBand的lustre

note:lustre的編譯安裝太容易出問題,是以這裡選用的是yum安裝,請確定您的伺服器能夠連接配接到相應網絡

server端(包括mds與osd)

首先解除安裝已經安裝了的infiniband(未安裝可不選)
sudo yum remove neohost-backend
sudo /sbin/ofed_uninstall.sh
#解除安裝已經安裝了的lustre元件
sudo yum remove "*lustre*"
           

請确認沒有多删之後再按y

添加lustre-server的yumrepo
sudo vim /etc/yum.repos.d/lustre-server.repo
           

寫入如下内容

[lustre-server]
name=lustre-server
baseurl=https://downloads.whamcloud.com/public/lustre/lustre-2.12.0-ib/MOFED-4.5-1.0.1.0/el7/server
gpgcheck=0
           

從lustre網站上安裝infiniband相關元件

sudo yum --enablerepo=lustre-server install "*OFED*" "*mlnx*" ibutils
           

同樣,請檢查以上包來自于lustre-client而不是其他的鏡像源

啟動ib
sudo modprobe -rv ib_isert rpcrdma ib_srpt
sudo service openibd start
           

關于infiniband的config部分我是用的我們實驗室的規定,可以根據自己情況修改

如果讀者不知道怎麼弄,如下操作

/etc/sysconfig/network-scripts/ifcfg-ib0
TYPE=InfiniBand
DEVICE=ib0
NAME=System ib0
BOOTPROTO=static
IPADDR=10.0.0.1
NETMASK=255.255.255.0
BROADCAST=10.0.0.255
NETWORK=10.0.0.0
ONBOOT=yes
           

請将

10.0.0.1

修改為每台機器對應的位址

添加e2fsprogs的yumrepo
sudo vim /etc/yum.repos.d/e2fsprogs.repo
           

寫入

[e2fsprogs-el7-x86_64]
name=e2fsprogs-el7-x86_64
baseurl=https://downloads.whamcloud.com/public/e2fsprogs/latest/el7/
enabled=1
priority=1
           

note:最好打開浏覽器手動核對url連結,確定與你的伺服器版本對應

安裝打過lustre更新檔的核心
sudo yum install kernel-3.10.0-957.el7_lustre  kernel-debuginfo-3.10.0-957.el7_lustre kernel-debuginfo-common-x86_64-3.10.0-957.el7_lustre kernel-devel-3.10.0-957.el7_lustre kernel-headers-3.10.0-957.el7_lustre
uname -r
#檢查核心是否是3.10.0-957.el7_lustre,不是的話設定手動核心啟動子產品
sudo reboot
           
安裝lustre
sudo yum --nogpgcheck --enablerepo=lustre-server install kmod-lustre-osd-ldiskfs kmod-lustre lustre lustre-osd-ldiskfs-mount lustre-iokit lustre-tests kmod-lustre-tests
           

裝lustre應該會自動裝上e2fsprogs,沒有的話就手動yum裝一下好了

為lustre添加ib網卡:這一步很重要
sudo vim /etc/modprobe.d/lustre.conf
#寫入以下内容
options lnet networks="o2ib0(ib0)"
sudo modprobe -v lustre 無error說明大功告成
           

如何配置mgs,mdt,ost我會新開一個頁面來寫,不混在一起。(其實是我累了

client端

首先解除安裝已經安裝了的infiniband
sudo yum remove neohost-backend
sudo /sbin/ofed_uninstall.sh
           
解除安裝已經安裝了的lustre元件
sudo yum remove "*lustre*"
           

請确認沒有多删之後再按y

添加lustre-client的yumrepo
sudo vim /etc/yum.repos.d/lustre-client.repo
           

寫入

[lustre-client]
name=Lustre Client
gpgcheck=0
baseurl=https://downloads.whamcloud.com/public/lustre/lustre-2.12.0-ib/MOFED-4.5-1.0.1.0/el7/client/
           

note:最好打開浏覽器手動核對url連結,確定與你的伺服器版本對應

安裝infiniband相關元件
sudo yum --enablerepo=lustre-client install "*OFED*" "*mlnx*" ibutils
           

同樣,請檢查以上包來自于lustre-client而不是其他的鏡像源

啟動ib
sudo modprobe -rv ib_isert rpcrdma ib_srpt
sudo service openibd start
           

關于infiniband的config與上一段相似

安裝lustre的client
sudo yum install kmod-lustre-client  kmod-lustre-client-tests lustre-client  lustre-client-debuginfo lustre-client-tests  lustre-iokit pcp-pmda-lustre pcp-pmda-lustrecomm
           

如果有一些奇怪的東西混進來了,可以手動指定版本号重新執行yum install

為lustre添加ib網卡
sudo vim /etc/modprobe.d/lustre.conf
#寫入以下内容
options lnet networks="o2ib0(ib0)"
sudo modprobe -v lustre 
           

無error說明大功告成

建立40個client并挂載上去(請確定伺服器available,如果你還沒挂載mds與osd請不要這麼做,沒有用)

for ((i=0; i<40;i++)); do sudo mkdir /mnt/lustre-client-$i; sudo chown user:group lustre-client-$i; sudo mount -t lustre [email protected]:[email protected]:/lustre  /mnt/lustre-client-$i; done
           

這個

chown user:group

自己換一下

繼續閱讀