Chinaunix首页 | 论坛 | 博客
  • 博客访问: 517123
  • 博文数量: 137
  • 博客积分: 3170
  • 博客等级: 中校
  • 技术积分: 1455
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-17 11:47
文章分类

全部博文(137)

文章存档

2015年(2)

2013年(1)

2012年(6)

2011年(5)

2010年(62)

2009年(61)

我的朋友

分类: LINUX

2009-05-26 13:51:09


                              

Lustre配置(LustreCFG2.0)

注:LustreCFGLustre Configure 的缩写,代表Lustre的一种配置方案。

一.lustre介绍

    lustre是一种在linux平台上运行的集群文件系统,它具有高性能,支持不同网络,容错性好,支持Posix标准的特点。

二.  整体架构

    一个Lustre文件系统主要包括以下四个组件:管理服务器Management Server(mgs), 元数据服务器Meta Data Target(mdt), 对象存储服务器Object Storge Target(ost) ,客户端Lustre clients(lc)

1.LustreCFG1.0:

LustreCFG1.0中,将mgsmdt设置在同一台服务器上,ost独立占用一台服务器,一个客户端lc。三个节点分别用mds,ost,lc表示。

配置环境à操作系统:3redhat5企业版 ,选择完全安装,每台都有唯一的硬盘,三者都是运行在VMware Workstation 5.5.3 build-34685

注:每台机器硬盘在分区时,先留出一块空闲分区(如何确定留出的分区大小目前还没有固定方案,我留出了2G),该空闲分区在后面需要挂载lustre文件系统(具体方法见后面说明)。

2.LustreCFG2.0:

LustreCFG2.0中,仍将mgsmdt设置在同一台服务器上(mgsmd非性能瓶颈,一般无必要分离)4ost节点,2个客户端lc节点。

配置基本环境同上1.LustreCFG1.0

三.  LustreCFG1.0介绍

1.在每个节点需要做的工作

【1】    关闭防火墙和SELINUX

在桌面上点击系统à管理à安全级别和防火墙。里面有防火墙和SELINUX的选项,选择“禁用”即可。另外,关闭SELINUX也可以修改配置文件/etc/selinux/config,设置SELINUX的值为SELINUX=disabled。通过修改配置文件来关闭防火墙目前还不会,嘿嘿。

【2】    确认系统支持

# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 5 (Tikanga)

 

# uname -a

Linux mds 2.6.18-8.1.14.el5_lustre.1.6.3smp #1 SMP Sun Oct 7 20:29:00 EDT 2007 i686 i686 i386 GNU/Linux

 

# perl -v

 

This is perl, v5.8.8 built for i386-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the

GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on

this system using "man perl" or "perldoc perl".  If you have access to the

Internet, point your browser at the Perl Home Page.

 

# python -V

Python 2.4.3

【3】    安装e2fsprogs

安装e2fsprogs-devel-1.40.2.cfs5-0redhat.i386.rpm e2fsprogs-1.40.2.cfs5-0redhat.i386.rpm两个包。

# rpm  -Uvh  --nodeps e2fsprogs-devel-1.40.2.cfs5-0redhat.i386.rpm

#rpm  -Uvh  --nodeps  –-force  e2fsprogs-1.40.2.cfs5-0redhat.i386.rpm

注意:e2fsprogs-1.40.2.cfs5-0redhat.i386.rpm需要强制安装。--nodeps  –-force参数的前面是两条横线。

【4】    安装PyXML

#  tar –zxvf  PyXML-0.8.4.tar.gz

#  cd  Py.XML-0.8.4

#  python setup.py build

#  python setup.py install

【5】    安装lustre

#  rpm   -ivh  kernel-lustre-smp-2.6.18-8.1.14.el5_lustre.1.6.3.i686.rpm

#  rpm   -ivh  kernel-lustre-source-2.6.18-8.1.14.el5_lustre.1.6.3.i686.rpm

#  rpm   -ivh  lustre-modules-1.6.3-2.6.18_8.1.14.el5_lustre.1.6.3smp.i686.rpm

#  rpm   -ivh  lustre-1.6.3-2.6.18_8.1.14.el5_lustre.1.6.3smp.i686.rpm

#  rpm   -ivh  lustre-source-1.6.3-2.6.18_8.1.14.el5_lustre.1.6.3smp.i686.rpm

# rpm  -ivh  lustre-debuginfo-1.6.3-2.6.18_8.1.14.el5_lustre.1.6.3smp.i686.rpm

#  rpm   -ivh  lustre-ldiskfs-3.0.2-2.6.18_8.1.14.el5_lustre.1.6.3smp.i686.rpm

注意:以上包的安装顺序参考于王日友的安装手册,另外,有些包需要使用命令参量 --force --nodeps 进行强制安装。有没有更好的安装顺序?

6 设置network模块

#  vi  /etc/modprobe.conf

添加如下语句:

      options   lnet  networks=tcp

7】域名问题

#  vi  /etc/hosts

添加如下语句:

192.168.0.158   mds

192.168.0.159   ost

192.168.0.160   lc

 

#  vi  /etc/sysconfig/network

修改HOSTNAME=域名

例如:   mds  修改HOSTNAME=mds。可以通过ping 主机名(mds,ost,lc)来检测各主机互联互通问题。

8 修改启动项

#  vi  /boot/grub/grub.conf

修改为:    default=0

            timeout=5

9 挂载空闲分区

 利用fdisk  /dev/sda命令将空闲分区创建为一个新的分区,LustreCFG1.0中将空闲分区创建为/dev/sda5

10】重启问题

执行完上面的【9】就可以重启操作系统了,但是重启时,可能会遇到 libdb-4.2.so : No such file or directory的启动错误,因此在重启前最好搜索一下/lib目录下有无libdb-4.2.so,若无,则执行如下命令:

        cp    libdb-4.3.so   libdb-4.2.so

至此需要安装的包安装毕!,将三个节点重新启动。

2.在mds上执行如下操作:

#mkfs.lustre  --fsname=testfs  --mdt  --mgs  /dev/sda5

#mkdir  –p  /mnt/test/mds    //创建一个目录以挂载lustre

#mount  –t  lustre  /dev/sda5  /mnt/test/mds

#cat  /proc/fs/lustre/devices

3.在ost上执行以下操作:

     # mkfs.lustre  –fsname=testfs  --ost   --mgsnode=mds@tcp0  /dev/sda5

     # mkdir  –p  /mnt/test/ost   //创建一个目录以挂载lustre

     # mount  –t  luster  /dev/sda5  /mnt/test/ost

4.在客户端lc上执行以下操作:

# mkdir –p  /mnt/testfs

# mount –t  luster  mds@tcp0:/testfs  /mnt/testfs

至此,客户端已经挂载了lustre文件系统,在客户端testfs文件系统上创建test.txt,在ost上就能看到test.txt的创建,一般在ost节点可以通过df –l知道容量的变化(文件要比较大)。另外,在一个客户端拷入文件,在另一个客户端也可以看到该文件。

5.停止lustre系统:

lc上执行命令:

    #  umount   /mnt/testfs

6.后记

对于lustre还有很多问题有待研究,比如时间同步问题,lustre的适用范围,以及调优。

 

四.  LustreCFG2.0介绍

整体架构如下:

192.168.0.158   mds

192.168.0.159   ost01

192.168.0.160   ost02

192.168.0.161   ost03

192.168.0.163   ost04

192.168.0.164   lc01

192.168.0.165   lc02

1.在每个节点需要做的工作

lustreCFG1.0在每个节点需要做的工作。

2.在mds上:

    #  mkfs.lustre  --fsname  datafs  --mdt  –mgs  /dev/sda5

    #  mkdir  -p  /mnt/data/mds

#  mount  -t  lustre /dev/sda5  /mnt/data/mds

3.在ost上:

    #  mkfs.lustre  --fsname testfs  --ost  --mgsnode=mds@tcp0  /dev/sda5

#  mkfs.lustre  --fsname testfs  --ost  --mgsnode=mds@tcp0  /dev/sdd5

#  mkfs.lustre  --fsname testfs  --ost  --mgsnode=mds@tcp0  /dev/sda5

#  mkfs.lustre  --fsname testfs  --ost  --mgsnode=mds@tcp0  /dev/sda5

 

#  mkdir -p  /mnt/test/ost01

#  mount -t  lustre  /dev/sda5  /mnt/test/ost01

#  mkdir -p  /mnt/test/ost02

#  mount –t  lustre  /dev/sda5  /mnt/test/ost02

#  mkdir -p  /mnt/test/ost03

#  mount –t  lustre  /dev/sda5 /mnt/test/ost03

#  mkdir -p  /mnt/test/ost04

#  mount –t  lustre /dev/sda5  /mnt/test/ost04

4.在lc上:

    #   mount –t  lustre  mds@tcp0:/testfs  /mnt/testfs

    #   mount –t  lustre  mds@tcp0:testfs  /mnt/testfs

5.后记:

    目前来讲只是对如何配置lustre有了一定的经验,下一步需要在真机上进行严格的测试比对,以选出最适合的配置方案。

 

 

 

 

 

 

阅读(2980) | 评论(1) | 转发(0) |
0

上一篇:gcc/g++使用

下一篇:ldd export find grep

给主人留下些什么吧!~~

chinaunix网友2009-06-07 23:48:16

哇,这么复杂啊,你还真是个有心人,应该向你学习!