靜態(tài)網(wǎng)站制作模板代寫文章
1.搭建雙機lustre高可用集群:
1.環(huán)境說明:
主機名 | 系統(tǒng) | 掛載情況 | IP地址 | Lustre集群名 | 內(nèi)存 |
---|---|---|---|---|---|
mds001 | Centos7.9 | (共享磁盤)1個mgs,1個MDT,2個OST | 192.168.10.21/209.21 | global | 1G |
mds002 | Centos7.9 | (共享磁盤)1個mgs,1個MDT,2個OST | 192.168.10.22/209.22 | global | 1G |
client | Centos7.9 | 無 | 192.168.10.41 | 無 | 1G |
mds01,mds02作為mds的同時 也做oss,做5個共享盤:1個mgs,2個mdt,2個ost,搭建一套高可用的lustre服務集群
2.兩個虛擬機使用共享磁盤:
-
前提:兩臺虛擬機沒有拍攝快照
-
在mds001主機中:
-
添加五塊5G的硬盤
SCSI > 創(chuàng)建新虛擬磁盤 > 指定磁盤容量 ,立即分配所有磁盤空間,將虛擬磁盤存儲為單個文件
-
-
在mds001和mds002的虛擬機目錄下,找個后綴名為vmx的文件,在文件末尾添加一下內(nèi)容:
scsi1.sharedBus = "virtual" disk.locking = "false" diskLib.dataCacheMaxSize = "0" diskLib.dataCacheMaxReadAheadSize = "0" diskLib.dataCacheMinReadAheadSize = "0" diskLib.dataCachePageSize = "4096" diskLib.maxUnsyncedWrites = "0" disk.EnableUUID = "TRUE"
-
重啟兩臺虛擬機發(fā)現(xiàn),添加成功
[root@mds001 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 20G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 19G 0 part ├─centos-root 253:0 0 17G 0 lvm /└─centos-swap 253:1 0 2G 0 lvm [SWAP] sdb 8:16 0 5G 0 disk sdc 8:32 0 5G 0 disk sdd 8:48 0 5G 0 disk sde 8:64 0 5G 0 disk sdf 8:80 0 5G 0 disk sr0 11:0 1 9.5G 0 rom /mnt/cdrom
3.安裝和配置Lustre:
-
兩臺主機都需要下載OSS服務器所需要的包:E2fsprogs包只是在Ext4的原版RPM包基礎上增加了對Lustre?持
mkdir ~/e2fsprogs && cd ~/e2fsprogs wget -c -r -nd https://downloads.whamcloud.com/public/e2fsprogs/1.44.5.wc1/el7/RPMS/x86_64/ rm -rf index.html* unknown.gif *.gif sha256sum
-
全部rpm安裝:
[root@mds001 e2fsprogs]# cd ~/e2fsprogs && rpm -Uvh * 準備中... ################################# [100%] 正在升級/安裝... 1:libcom_err-1.42.12.wc1-4.el7.cent################################# [ 8%] 2:e2fsprogs-libs-1.42.12.wc1-4.el7.################################# [ 15%] 3:libcom_err-devel-1.42.12.wc1-4.el################################# [ 23%] 4:libss-1.42.12.wc1-4.el7.centos ################################# [ 31%] 5:e2fsprogs-1.42.12.wc1-4.el7.cento################################# [ 38%] 6:libss-devel-1.42.12.wc1-4.el7.cen################################# [ 46%] 7:e2fsprogs-devel-1.42.12.wc1-4.el7################################# [ 54%] 8:e2fsprogs-static-1.42.12.wc1-4.el################################# [ 62%] 9:e2fsprogs-debuginfo-1.42.12.wc1-4################################# [ 69%] 正在清理/刪除... 10:e2fsprogs-1.42.9-19.el7 ################################# [ 77%] 11:e2fsprogs-libs-1.42.9-19.el7 ################################# [ 85%] 12:libss-1.42.9-19.el7 ################################# [ 92%] 13:libcom_err-1.42.9-19.el7 ################################# [100%]
-
兩臺主機都需要下載MDS服務器所需要的包:
wget命令參數(shù) 說明 -c 斷點續(xù)傳 -r 遞歸下載 -nd 不分層,所有文件下載到當前目錄下 rpm包 說明 kernel-*.el7_lustre.x86_64.rpm 帶 Lustre 補丁的 Linux 內(nèi)核 kmod-lustre-*.el7.x86_64.rpm Lustre 補丁內(nèi)核模塊 kmod-lustre-osd-ldiskfs-*.el7.x86_64.rpm 基于 ldiskfs 的 Lustre 后端文件系統(tǒng)工具 lustre-*.el7.x86_64.rpm Lustre 軟件命令行工具 lustre-osd-ldiskfs-mount-*.el7.x86_64.rpm 基于ldiskfs 的 mount.lustre和mkfs。lustre相關(guān)幫助文檔 mkdir ~/lustre2.12.1 && cd ~/lustre2.12.1 yum install -y wget wget \ https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/kernel-3.10.0-957.10.1.el7_lustre.x86_64.rpm \ https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/kmod-lustre-2.12.1-1.el7.x86_64.rpm \ https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/kmod-lustre-osd-ldiskfs-2.12.1-1.el7.x86_64.rpm \ https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/lustre-2.12.1-1.el7.x86_64.rpm \ https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/lustre-osd-ldiskfs-mount-2.12.1-1.el7.x86_64.rpm
-
安裝依賴(否則報錯error: Failed dependencies:):
yum clean all && yum repolist yum install -y linux-firmware dracut selinux-policy-targeted kexec-tools libyaml perl
-
全部rpm安裝:(如果無法安裝就強行安裝)
cd ~/lustre2.12.1 && rpm -ivh *.rpm --force
-
重啟服務器:
init 6
-
檢查內(nèi)核:
[root@master ~]# uname -r 3.10.0-957.el7_lustre.x86_64
-
加載Lustre模塊(此為臨時加載,重啟失效):
[root@master ~]# modprobe lustre && lsmod | grep lustre lustre 758679 0 lmv 177987 1 lustre mdc 232938 1 lustre lov 314581 1 lustre ptlrpc 2264705 7 fid,fld,lmv,mdc,lov,osc,lustre obdclass 1962422 8 fid,fld,lmv,mdc,lov,osc,lustre,ptlrpc lnet 595941 6 lmv,osc,lustre,obdclass,ptlrpc,ksocklnd libcfs 421295 11 fid,fld,lmv,mdc,lov,osc,lnet,lustre,obdclass,ptlrpc,ksocklnd
-
查看lustre版本:
[root@mds001 ~]# modinfo lustre filename: /lib/modules/3.10.0-957.10.1.el7_lustre.x86_64/extra/lustre/fs/lustre.ko license: GPL version: 2.12.1 description: Lustre Client File System author: OpenSFS, Inc. <http://www.lustre.org/> retpoline: Y rhelversion: 7.6 srcversion: E50D950B04B4044ABCBCFA3 depends: obdclass,ptlrpc,libcfs,lnet,lmv,mdc,lov vermagic: 3.10.0-957.10.1.el7_lustre.x86_64 SMP mod_unload modversions
-
只有在某個節(jié)點掛載上了,才表明MGS,MDT或者是OST被創(chuàng)建了
-
五個硬盤都在mds001服務器上格式化,因為是共享硬盤,所以在mds002服務器上可以查看到格式化類型:
格式化參數(shù) 說明 --fsname 設置Lustre集群的名稱,Lustre文件系統(tǒng)的標識,必須唯一 --servicenode mgs節(jié)點的IP地址,Lnet網(wǎng)絡 --mgsnode mgs節(jié)點的IP地址,Lnet網(wǎng)絡 --mgs 將分區(qū)格式化為MGS,MGS(ManaGe Server)是?來記錄整個Lustre狀態(tài)的服務 --mdt 將分區(qū)格式化為MDT,MDT(MetaData Target)是存放Lustre元數(shù)據(jù)服務的設備 --ost 將分區(qū)格式化為OST,OST(Object Storage Target)則是存儲Lustre數(shù)據(jù)的設備 --index 設置設備的在lustre集群中的標簽值,如:--mdt --index=1,LABEL="global-MDT0001",在同集群具有唯一性 --reformat 跳過檢查,防止格式化操作清除已有的數(shù)據(jù) --replace 替換 # 關(guān)于MDT和OST,--index的值要從0開始?