免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6671 | 回复: 1
打印 上一主题 下一主题

[Lustre] lustre分布式文件系统安装配置指南 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-09 09:03 |只看该作者 |倒序浏览

linux系统:fedora 6
安装
确认系统支持:
确认所有操作系统的版本,内核版本,在所有节点上执行下面命令
[root@xys ~]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
[root@CLS ~]# uname -a
Linux CLS 2.6.9-42.0.3.EL #1 SMP Thu Jan 11 17:55:05 MST 2007 i686 i686 i386 GNU/Linux
确认所有系统软件支持,软件版本, 在所有节点上执行下面命令
[root@CLS ~]# perl -v
This is perl, v5.8.5 built for i386-linux-thread-multi
[root@CLS ~]# python -V
Python 2.3.4 (#1, Feb 2 2005, 11:44:49)
[GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2
安装必要的lustre 包
下载e2fsprogs 包,版本最好是大于1.38。
安装PyXML
下载PyXML, PyXML 点击这里: http://sourceforge.net/project/showfiles.php?group_id=6473
[root@CLS ~]# tar –zxvf PyXML-0.8.4.tar.gz
[root@xys lustre]# cd PyXML-0.8.4
[root@xys PyXML-0.8.4]# python setup.py build
[root@xys PyXML-0.8.4]# python setup.py install
rpm包下载地址:http://www.sun.com/software/products/lustre/get.jsp   版本 1.6.2 readhat5 i686
首先运行e2fsprogs-devel-1.40.2.cfs1-0redhat.i386.rpm 若下面的过程中出现如下错误:
libdb-4.2.so
1.40.2.cfs1
需先rpmbuild源码rpm包,并要加--force执行以下命令,否则不用
[root@xys~]# rpmbuild --rebuild e2fsprogs-1.40.2.cfs1-0redhat.src.rpm
[root@xys~]# yum install libdb-4.2.so
[root@xys~]# rpm -ivh --force e2fsprogs-1.40.2.cfs1-0redhat.i386.rpm    //在重复安装或产生冲突的情况下,采用加 --force的方式 强制
                                                                     //覆盖以前版本 ,下述过程一般不用加--force的方式进行
[root@xys~]# rpm -ivh --force e2fsprogs-devel-1.40.2.cfs1-0redhat.i386.rpm
[root@xys~]# rpm -ivh --force e2fsprogs-debuginfo-1.40.2.cfs1-0redhat.i386.rpm
[root@xys~]# rpm -ivh --force kernel-lustre-smp-2.6.18-8.1.8.el5_lustre.1.6.2.i686.rpm
[root@xys~]# rpm -ivh --force kernel-lustre-source-2.6.18-8.1.8.el5_lustre.1.6.2.i686.rpm
[root@xys~]# rpm -ivh --force lustre-ldiskfs-3.0.0-2.6.18_8.1.8.el5_lustre.1.6.2smp.i686.rpm
[root@xys~]# rpm -ivh --force lustre-ldiskfs-debuginfo-3.0.0-2.6.18_8.1.8.el5_lustre.1.6.2smp.i686.rpm
[root@xys~]# rpm -ivh --force lustre-modules-1.6.2-2.6.18_8.1.8.el5_lustre.1.6.2smp.i686.rpm
[root@xys~]# yum install tcl expect
[root@xys~]# rpm -ivh --force lustre-1.6.2-2.6.18_8.1.8.el5_lustre.1.6.2smp.i686.rpm
[root@xys~]# rpm -ivh --force lustre-source-1.6.2-2.6.18_8.1.8.el5_lustre.1.6.2smp.i686.rpm
[root@xys~]# rpm -ivh --force lustre-debuginfo-1.6.2-2.6.18_8.1.8.el5_lustre.1.6.2smp.i686.rpm
NODE: 以上操作在每一个节点都执行, 这样节点系统就全部安装了lustre 软件。
--系统设置
模块配置
首要要设置network 模块,在配置文件添加lnet 的定义
[root@xys ~]# vi /etc/modprobe.conf
alias eth0 pcnet32
alias eth1 pcnet32
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptscsih
# add by wangriyou, Module options for networking
options lnet networks=tcp
域名问题
如果有域名对系统的路由将会有另外的对应设置, 目前本次测试没有。所以在每一个系统配置hosts文件。目前系统有3 台服务器, 客户端 1 (CLS), MD 服务器1 (MDS), OS 服务器1 (OBS)。
[root@xys ~]# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost   //(实际配置如下)
192.168.178.203     MDS
192.168.178.203     CLS1
192.168.178.203     OST1
192.168.178.208     OST2
192.168.178.208     CLS2
192.168.178.208     OST3
192.168.178.202     OST4
在客户端服务器上执行
[root@CLS ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=CLS
[root@CLS ~]# hostname CLS
在MD 服务器上执行
[root@CLS ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=MDS
[root@CLS ~]# hostname MDS
在OS 服务器上执行
[root@CLS ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=OST
[root@CLS ~]# hostname OST
启动选项
编修grub.conf 文件,使得启动lustre 补丁内核
[root@xys ~]# vi /boot/grub/grub.conf
# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux AS (2.6.9-42.0.3.EL_lustre.1.5.97smp)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.0.3.EL_lustre.1.5.97smp ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.9-42.0.3.EL_lustre.1.5.97smp.img
title Red Hat Enterprise Linux AS (2.6.9-22.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.EL ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.9-22.EL.img
现在就可以重启动系统了。
时间同步
以CLS 为时间同步服务器, 其他服务器为同步客户端。 也可以在本地设立时间同步服务器,这里就省略… …
Part 4. 调试
等全部lustre 架构成员系统启动后,测试hosts 文件的域名映射是否通信正常。可以用 ping 工具来测试。如果不能做到互相通信,请确认问题。
创建并且启动文件系统
在MD 服务器上执行以下操作
mkfs.lustre --fsname=testfs --mdt --mgs /dev/hda7  (若此前已经格式化,需加参数--reformat)
mkdir -p /mnt/test/mdt
mount -t lustre /dev/hda7 /mnt/test/mdt (再次使用直接mount即可,不需前述步骤)
cat /proc/fs/lustre/devices
0 UP mgs MGS MGS 5
1 UP mgc MGC192.168.0.163@tcp e51f834d-c2e3-4c27-806b-cb66b7807420 5
2 UP mdt MDS MDS_uuid 3
3 UP lov testfs-mdtlov testfs-mdtlov_UUID 4
4 UP mds testfs-MDT0000 testfs-MDT0000_UUID 3
在OST1 服务器上执行以下操作
mkfs.lustre --fsname=testfs --ost --mgsnode=MDS@tcp0 /dev/hda8
mkdir -p /mnt/test/ost1
mount -t lustre /dev/hda8 /mnt/test/ost1    (再次使用 直接mount即可,不需前述步骤)
****************************************************************************************************************************
************************************* 此处下部为注释部分 **************************************************************
****************************************************************************************************************************
挂载OST的lustre系统时出现错误:
failed to mount  input/output error
查询/var/log/messages发现如下错误:
Apr  1 09:13:07 OST3 avahi-daemon[2452]: Recieved repsonse with invalid source port 2414 on interface 'eth0.0'
Apr  1 09:13:07 OST3 avahi-daemon[2452]: Invalid legacy unicast query packet.
解决办法:关掉防火墙设置selinux  iptables  ip6tables
selinux:
    修改/etc/selinux/config. SELINUX=disabled
iptables:
    用root用户登陆然后输入命令
    [root@Map ~]# service iptables stop
    [root@Map ~]# chkconfig iptables off
    [root@Map ~]# chkconfig --list |grep iptables
    iptables        0off   1off   2off   3off   4off   5off   6off  
    这就表示关了,如果你想再次启动的话就
    [root@Map ~]# chkconfig iptables on
    [root@Map ~]# chkconfig --list |grep iptables
    iptables        0ff   1ff   2on   3:on   4:on   5:on   6:off
ip6tables:方法如iptables,只需要将iptables改为ip6tables即可
****************************************************************************************************************************
*************************************   此处上部为注释部分  ************************************************************
****************************************************************************************************************************
在OST2 服务器上执行以下操作
mkfs.lustre --fsname=testfs --ost --mgsnode=MDS@tcp0 /dev/hda7
mkdir -p /mnt/test/ost2
mount -t lustre /dev/hda7 /mnt/test/ost2    (再次使用 直接mount即可,不需前述步骤)
在OST3 服务器上执行以下操作
mkfs.lustre --fsname=testfs --ost --mgsnode=MDS@tcp0 /dev/hda8
mkdir -p /mnt/test/ost3
mount -t lustre /dev/hda8 /mnt/test/ost3    (再次使用 直接mount即可,不需前述步骤)
在OST3 服务器上执行以下操作
mkfs.lustre --fsname=testfs --ost --mgsnode=MDS@tcp0 /dev/hda8
mkdir -p /mnt/test/ost4
mount -t lustre /dev/hda8 /mnt/test/ost4    (再次使用 直接mount即可,不需前述步骤)
在客户端服务器上CLS1执行一下操作
mkdir -p /mnt/testfs
mount -t lustre MDS@tcp0:/testfs /mnt/testfs
mount
192.168.178.203@tcp:/testfs on /mnt/testfs type lustre (rw)
在客户端服务器上CLS2执行一下操作
mkdir -p /mnt/testfs
mount -t lustre MDS@tcp0:/testfs /mnt/testfs
mount
192.168.178.208@tcp:/testfs on /mnt/testfs type lustre (rw)
停止lustre
[root@CLS ~]# umount /mnt/testfs
****************************************************************************************************************************
************************************* 下部为数据传输测试 **************************************************************
****************************************************************************************************************************
可以看到客户端已经挂载了lustre 文件系统, 也可以同样用OS 服务器挂载。 在客户端上testfs 文件系统上创建test.txt 文件, 在OS 服务器同时能看到test.txt 文件的创建。
补充.在client 服务器上执行
dd if=/dev/zero of=test1 bs=1024 count=40000
40000+0 records in
40000+0 records out
40960000 bytes (41 MB) copied, 2.85257 s, 14.4 MB/s
在 ost1服务器 执行 df -lh查看
/dev/sdb1            1004M   57M  897M   6% /opt
在 ost2 服务器 执行 df -lh  查看
/dev/sdb1            1004M   17M  897M   2% /opt
明显 ost1 写入了 40M 的数据 而 ost2没有
在次执行 dd if=/dev/zero of=test2 bs=1024 count=40000
40000+0 records in
40000+0 records out
40960000 bytes (41 MB) copied, 4.66784 s, 8.8 MB/s
在ost1服务器 执行 df -lh  查看
/dev/sdb1            1004M   57M  897M   6% /opt
没有变动
在ost2服务器 执行 df -lh 查看
/dev/sdb1            1004M   57M  897M   6% /opt
ost2 被写入了 40M 数据!
停止lustre
[root@CLS ~]# umount /mnt/testfs
查看服务是否正常
在 client 节点运行
# lfs check servers
zds-MDT0000-mdc-c1222a00 active.
zds-OST0000-osc-c1222a00 active.
zds-OST0001-osc-c1222a00 active.
如出现上述信息,并且查看每个节点的系统日志,如果没的报错,说明正常启动。
服务器启动顺序
MDS-------OST---------CLIENT

仅供学习 拒绝转载  有不明白的 或 希望共同学习的 可联系QQ:552043106  以上为我的安装配置过程总结 花了一些心血的 呵呵..



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/95652/showart_1990229.html

论坛徽章:
0
2 [报告]
发表于 2010-01-15 13:46 |只看该作者
1. qq群:(超级活跃,都是分布式文件系统的用户和爱好者)
   102082446  (通关密码:我爱分布式文件系统)
2. bbs讨论:
    mfs权威指南(moosefs)分布式文件系统一站式解决方案(部署,性能测试)不断更新ing
     http://bbs.chinaunix.net/thread-1644309-1-1.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP