天天看點

centos lustre 簡單 安裝教程

原文:http://www.weiruoyu.cn/?p=524

感謝rainbird2哥們,我是在他的基礎上改進的,增加了測試功能。

因為業務需要,需要做一個分布式的lustre,提高I/O性能。

測試環境:centos5.6 32位,核心:2.6.18-238.el5

mds 192.168.229.155

ost1 192.168.229.156

ost2 192.168.229.157

client 192.168.229.158

1.下載下傳安裝包,去官網下就可以:

http://downloads.lustre.org/public/lustre/v1.8/lustre_1.8.7/rhel5-i686/

需要下載下傳7個包:我的是1.87版本

e2fsprogs-1.41.12.2.ora1-0redhat.rhel5.i386.rpm

kernel-2.6.18-194.17.1.el5_lustre.1.8.7.i686.rpm

lustre-1.8.7-2.6.18_194.17.1.el5_lustre.1.8.7.i686.rpm

lustre-client-1.8.7-2.6.18_194.17.1.el5_lustre.1.8.7.i686.rpm

lustre-client-modules-1.8.7-2.6.18_194.17.1.el5_lustre.1.8.7.i686.rpm

lustre-ldiskfs-3.1.6-2.6.18_194.17.1.el5_lustre.1.8.7.i686.rpm

lustre-modules-1.8.7-2.6.18_194.17.1.el5_lustre.1.8.7.i686.rpm

2.安裝

将下載下傳的軟體包拷貝到四台機器上,執行指令:

rpm -ivh -aid --force *.rpm

安裝完成後,grub被自動修改為已經修改過核心的啟動項,直接重新開機機器即可。

3.配置

1)在mds伺服器執行以下操作

modprobe lustre

modprobe ldiskfs

modprobe lnet 'network="tcp0(eth0)"'

mkfs.lustre --fsname=test --reformat --mdt --mgs /dev/sdb

注:如果硬碟沒有被格式化或者裡面有資料的話需要加 --reformat參數格式化!

mkdir /mnt/lustre

mount.lustre /dev/sdb /mnt/lustre

2)在兩台 ost 上執行以下操作

mkfs.lustre --fsname=test --ost --reformat--mgsnode=192.168.229.155@tcp0 /dev/sdb1

#同樣如果 sdb1 沒有被格式化或者有資料必須加 --reformat參數

mkdir /mnt/lustremount.lustre /dev/sdb1 /mnt/lustre

另一台機器上,也執行同樣的操作,這樣就把lustre的分布檔案系統建立起來了。

3)在 client伺服器上執行

mount.lustre 192.168.229.155@tcp0:/test /mnt

4.測試:

client:

[root@localhost ~]# dd if=/dev/zero of=/mnt/test.img bs=1M count=4500

4500+0 records in

4500+0 records out

4718592000 bytes (4.7 GB) copied, 83.8186 seconds, 56.3 MB/s

mds上

[root@localhost ~]# dd if=/dev/zero of=/tmp/test.img bs=1M count=4500

4718592000 bytes (4.7 GB) copied, 19.5914 seconds, 241 MB/s

其中一台ost上

[root@localhost ~]# dd if=/dev/zero of=/tmp/test.img bs=1M count=3000

3000+0 records in

3000+0 records out

3145728000 bytes (3.1 GB) copied, 38.8462 seconds, 81.0 MB/s

一台真實的IBM伺服器:

[root@bogon ~]# dd if=/dev/zero of=/tmp/test.img bs=1M count=4500

4718592000 bytes (4.7 GB) copied, 5.7876 seconds, 815 MB/s

=====================================================================

可能是用虛拟機做的,效果還沒有單台機器快,可能是vm的網絡受限。

5.停止lustre檔案系統

剩下更詳細請參考:http://www.weiruoyu.cn/?p=524

繼續閱讀