消防装备小发明小创造:安装配置Lustre集群文件系统(修订)

来源:百度文库 编辑:偶看新闻 时间:2024/05/03 15:53:36
前言
这篇文章是给一个大客户写的测试报告,很可惜客户没有采用,发出来让大家看看。Lustre集群文件系统一般用在大型的集群环境中,本文主要内容是安装、配置以及同我们HA软件的结合。Lustre文件系统
缩写词
CFS Cluster File System, Inc. 集群文件系统
dcache Directory Cache 目录缓存
ID Identification 验证符
LMC Lustre Configuration Maker Lustre配置工具
LOV Logical Object Volume 逻辑对象卷
LUG Lustre Usrs Group Lustre用户组
MDS Metadata Server 元数据服务器
MSCP Mass Storage Communications Protocol 大容量存储器通信协议
NAL Network Abstraction Layer 网络提取层
nid Network ID 网络ID
OBD Object Based Devices 基本对象设备
OSS Object Storage Servers 对象存储服务器
OST Object Storage Target 对象存储目标
SCA System Communication Architecture 系统通信架构
VFS Virtual File System 虚拟文件系统
术语
LOV 逻辑存储卷用来收集OST信息到单一卷中
MDS 元数据服务器保证高质量传输文件
NAL 网络提取层支持多种类型的网络文件传输
OSS 目标存储服务器是在服务器节点上运行的Lustre软件包Lustre是基于Linux平台的一个可扩展的集群文件系统,它使用基于对象的(存储)设备管理,用来替代以往的磁盘块管理方法。Lustre系统的组件主要有三部分构成:MDS(元数据服务器)、OSS(目标存储服务器)和Lustre客户端。安装Lustre需要的系统软件 readline
libxml2
Python
PyXML
先要确定以上软件已安装,否则在配置、启动Lustre时会报错。在SuSE系统中通过YaST安装。
安装
根据操作系统下载对应的内核等安装文件,下载地址:http://downloads.clusterfs.com/dl/83ba9fbdea4af3ba23a1f5536832b221/
需要下载三个基本文件:
kernel-bigsmp-2.6.5-7.252_lustre.1.4.6.1.i686.rpm
lustre-1.4.6.1-2.6.5_7.252_lustre.1.4.6.1bigsmp.i686.rpm
lustre-modules-1.4.6.1-2.6.5_7.252_lustre.1.4.6.1bigsmp.i686.rpm
如果想要编译内核文件,则还需要下载安装kernel-source文件。
安装内核
hatest01:~ # rpm ?ivh lustre-modules-1.4.6.1-2.6.5_7.252_lustre.1.4.6.1bigsmp.i686.rpm
安装完内核后,系统会提示更新grub文件,查看/boot目录中新的Lustre内核和映像文件,/boot/grum/menu.lst文件内容如下:
title Lustre
kernel (hd0,0)/boot/vmlinuz-2.6.5-7.252_lustre.1.4.6.1bigsmp root=/dev/hda1 vga=0x314 selinux=0 splash=silent resume=/dev/hda2 elevator=cfq showopts
initrd (hd0,0)/boot/initrd-2.6.5-7.252_lustre.1.4.6.1bigsmp
重新启动系统,使新的内核生效:
hatest01:~ # reboot
安装lustre
hatest01:~ # lustre-modules-1.4.6.1-2.6.5_7.252_lustre.1.4.6.1bigsmp.i686.rpm
hatest01:~ # lustre-1.4.6.1-2.6.5_7.252_lustre.1.4.6.1bigsmp.i686.rpm
SUSE安装Lustre
(1)安装SP3补丁光盘
然后安装软件:
lustre-lite-1.2.1.13.4-1.8
lustre-doc-1.2.1.13.4-1.8
lustre-ldap-1.2.1.13.4-1.8
km_lustre-lite-1.2.1.13.4-1.8
(2)编译lustre
powersite:~ # cd /usr/src/kernel-modules/lustre-lite/sources
powersite:~ # cp /boot/config-`uname -r` .config
powersite:~ # make oldconfig || make menuconfig# 2.6内核
powersite:~ # make include/asm
powersite:~ # make include/linux/version.h
powersite:~ # make SUBDIRS=scripts
# 2.4内核
powersite:~ # make dep
/usr/src/kernel-modules/lustre-lite/sources
(3)配置文件中的分区类型在2.6内核中不能设置为“ext3”,要改为“ldiskfs”
配置Lustre
正确安装Lustre后,如果没有报错,下面就要来配置Lustre文件系统了。一般情况下,如果是测试环境,可以将Lustre的三部分MDS, OSS和客户端全放在一台机器上,也可分别设置多台机器。下面的两个例子演示了单机和多机的配置方法
单机测试
MDS、OSS和Client全部放在一台机器上,做单机测试。配置/etc/hosts文件
先修改/etc/hosts文件中的内容,将“127.0.0.1 localhost”一行去掉,否则在启动、挂载Lustre服务器时会报些莫名其妙的错误。这是测试机的hosts文件内容,设置本机名为hatest01。
hatest01:~ # cat /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
192.168.0.200 hatest01
设置好hosts文件后,创建目录,因为/etc/init.d/lustre脚本需要在这个目录中启动配置文件。
hatest01:~ # mkdir /etc/lustre编写配置文件:config.sh
#!/bin/sh# config.sh# Create nodes
rm -f config.xml
lmc -m config.xml --add node --node hatest01
lmc -m config.xml --add net --node hatest01 --nid hatest01 --nettype tcp# Configure MDS
lmc -m config.xml --format --add mds --node hatest01 --mds mds-test --fstype ext3 --dev /tmp/mds-test --size 50000# Configure OSTs
lmc -m config.xml --add lov --lov lov-test --mds mds-test --stripe_sz 1048576 --stripe_cnt 0 --stripe_pattern 0
lmc -m config.xml --add ost --node hatest01 --lov lov-test --ost ost1-test --fstype ext3 --dev /tmp/ost1-test --size 100000
lmc -m config.xml --add ost --node hatest01 --lov lov-test --ost ost2-test --fstype ext3 --dev /tmp/ost2-test --size 100000# Configure client
lmc -m config.xml --add mtpt --node hatest01 --path /mnt/lustre --mds mds-test --lov lov-test生成config.xml文件
hatest01:~ # sh /etc/lustre/config.sh
启动lustre
hatest01:~ # /etc/init.d/lustre start
hatest01:~ # lconf --reformat /etc/lustre/config.xml
如果报错,查看dmesg和/var/log/messags信息。
Lustre启动信息
hatest01:~ # /etc/init.d/lustre start
Starting lustre: loading module: libcfs srcdir None devdir libcfs
loading module: lnet srcdir None devdir lnet
loading module: ksocklnd srcdir None devdir klnds/socklnd
loading module: lvfs srcdir None devdir lvfs
loading module: obdclass srcdir None devdir obdclass
loading module: ptlrpc srcdir None devdir ptlrpc
loading module: ost srcdir None devdir ost
loading module: ldiskfs srcdir None devdir ldiskfs
loading module: fsfilt_ldiskfs srcdir None devdir lvfs
loading module: obdfilter srcdir None devdir obdfilter
loading module: mdc srcdir None devdir mdc
loading module: osc srcdir None devdir osc
loading module: lov srcdir None devdir lov
loading module: mds srcdir None devdir mds
loading module: llite srcdir None devdir llite
NETWORK: NET_hatest01_tcp NET_hatest01_tcp_UUID tcp hatest01
OSD: ost1-test ost1-test_UUID obdfilter /tmp/ost1-test 100000 ldiskfs no 0 0
OST mount options: errors=remount-ro
OSD: ost2-test ost2-test_UUID obdfilter /tmp/ost2-test 100000 ldiskfs no 0 0
OST mount options: errors=remount-ro
MDSDEV: mds-test mds-test_UUID /tmp/mds-test ldiskfs 50000 yes
MDS mount options: errors=remount-ro
LOV: lov-test f2563_lov-test_4748b4dbdb mds-test_UUID 0 1048576 0 0 [u'ost1-test_UUID', u'ost2-test_UUID'] mds-test
OSC: OSC_hatest01_ost1-test_MNT_hatest01 f2563_lov-test_4748b4dbdb ost1-test_UUID
OSC: OSC_hatest01_ost2-test_MNT_hatest01 f2563_lov-test_4748b4dbdb ost2-test_UUID
MDC: MDC_hatest01_mds-test_MNT_hatest01 ab8b6_MNT_hatest01_e6e8102757 mds-test_UUID
MTPT: MNT_hatest01 MNT_hatest01_UUID /mnt/lustre mds-test_UUID lov-test_UUID
lustre
hatest01:~ #
使用df命令检查,下面的红框就是配置生效的Lustre文件系统
hatest01:~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 10485816 8620392 1865424 83% /
tmpfs 125532 0 125532 0% /dev/shm
config 193712 8592 174992 5% /mnt/lustre
hatest01:~ #
Lustre停止信息
hatest01:~ # /etc/init.d/lustre stop
Shutting down lustre: MTPT: MNT_hatest01 MNT_hatest01_UUID /mnt/lustre mds-test_UUID lov-test_UUID
MDC: MDC_hatest01_mds-test_MNT_hatest01 0d084_MNT_hatest01_02e13ecb12
LOV: lov-test 62282_lov-test_d86d412322
MDSDEV: mds-test mds-test_UUID
OSD: ost2-test ost2-test_UUID
OSD: ost1-test ost1-test_UUID
NETWORK: NET_hatest01_tcp NET_hatest01_tcp_UUID tcp hatest01
unloading module: llite
unloading module: mdc
unloading module: lov
unloading module: osc
unloading module: fsfilt_ldiskfs
unloading module: ldiskfs
unloading module: mds
unloading module: obdfilter
unloading module: ost
unloading module: ptlrpc
unloading module: obdclass
unloading module: lvfs
unloading module: lnet
unloading the network
unloading module: libcfs
lustre
MDS服务器HA配置
网络拓扑图如下:
  为了保证服务器的高可用及高性能,需要对关键服务器MDS做双机备份。MDS服务器主要用来控制客户端对OSS服务器群的访问以及数据缓存等工作,一旦MDS当机,整个文件系统将无法正常工作,为了提供强在力的后备保障,可以通过与Skybility HA高可用软件的相结合,自动、无缝的完成故障切换工作。
测试环境:
主MDS服务器(hatest01)、备份MDS服务器(hatest02)、OSS(powersite),OSS同时可做作Client使用,而且需要为两台MDS服务器设置共享存储,如下图:MDS failover配置
#!/bin/sh#config.sh# 创建节点
rm -f config.xml
lmc -m config.xml --add net --node powersite --nid powersite --nettype tcp
lmc -m config.xml --add net --node hatest01 --nid hatest01 --nettype tcp
lmc -m config.xml --add net --node hatest02 --nid hatest02 --nettype tcp
lmc -m config.xml --add net --node client --nid '*' --nettype tcp# 配置主MDS和备份MDS
lmc -m config.xml --add mds --dev /dev/sda1 --failover --group n-mds --node hatest01 --mds n-mds --fstype ldiskfs
lmc -m config.xml --add mds --dev /dev/sda1 --failover --group n-mds --node hatest02 --mds n-mds --fstype ldiskfs# 配置OST
lmc -m config.xml --add lov --lov lov1 --mds n-mds --stripe_sz 1048576 --stripe_cnt 0 --stripe_pattern 0
lmc -m config.xml --add ost --node powersite --lov lov1 --ost n01-ost1 --fstype ldiskfs --dev /dev/hda5# 配置客户端
lmc -m config.xml --add mtpt --node client --path /mnt/lustre --mds n-mds --lov lov1
手工测试切换:
主MDS(hatest01)节点运行命令先将Lustre停止:
lconf --verbose --cleanup --failover --group n-mds config.xml
然后在备份MDS(hatest02)节点运行命令:
lconf --verbose --failover --select n-mds=hatest02 --group n-mds config.xml
按上面步骤操作完后,客户端将自动切换到备份MDS服务器。
测试 dd if=/dev/zero of=/lustre/testfile bs=16k count=65536
time dd if=/dev/zero of=/lustre/testfile bs=16k count=65536
iozone -i0 -i1 -s 2g -r 16384 -f /lustre/testfile
iozone -a -i0 -i1 -s 2048m -r 16384 -f iozone.$$.tmp
iozone -az -i0 -i1 -s 2g -f /lustre/testfile
bonnie++ -m LustreClustre -d /mnt/lustre -u root -s 2048 -b -f |tee
停止
先停止OSS,如:lconf --force ?d --node oss config.xml
然后是MDS,如:lconf --force ?d --node mds config.xml
最后停止client,如:lconf --force ?d --node client config.xmllustre性能の?解
メタデ?タ性能?定(1client, 64server)
mkdir : 0.000062 sec , 1 file mkdir for 0.000000 sec
creat : 6.088072 sec , 1 file creat for 0.000609 sec
open : 4.227161 sec , 1 file open for 0.000423 sec
utime : 8.031854 sec , 1 file utime for 0.000803 sec
stat : 7.324523 sec , 1 file stat for 0.000732 sec
unlink: 8.827738 sec , 1 file unlink for 0.000883 sec
rmdir : 0.000083 sec , 1 file rmdir for 0.000000 secfile  creat
 open
 utime
 stat
 unlink
 
500
 0.29
 0.20
 0.38
 0.36
 0.32
 
1000
 0.58
 0.39
 0.78
 0.71
 0.64
 
1500
 0.86
 0.58
 1.18
 1.11
 0.97
 
2000
 1.14
 0.78
 1.58
 1.47
 1.29
 
2500
 1.42
 0.97
 1.98
 1.82
 1.60
 
3000
 1.71
 1.17
 2.38
 2.21
 1.93
 
3500
 1.99
 1.36
 2.78
 2.56
 2.24
 
4000
 2.28
 1.56
 3.18
 2.91
 2.63
 
4500
 2.57
 1.75
 3.57
 3.26
 3.13
 
5000
 2.86
 1.95
 3.97
 3.61
 3.62
 
5500
 3.14
 2.15
 4.47
 3.96
 4.11
 
6000
 3.43
 2.34
 4.86
 4.31
 4.67
 
6500
 3.72
 2.54
 5.30
 4.68
 5.29
 
7000
 4.01
 2.73
 5.69
 5.06
 5.78
 
7500
 4.53
 2.93
 6.07
 5.43
 6.28
 
8000
 4.81
 3.13
 6.46
 5.81
 6.77
 
8500
 5.21
 3.64
 6.86
 6.19
 7.26
 
9000
 5.50
 3.84
 7.25
 6.57
 7.75
 
9500
 5.79
 4.03
 7.64
 6.95
 8.25
 
10000
 6.09
 4.23
 8.03
 7.32
 8.83
 I/O性能?定(1client, 64server)
Lustre
OST 32node
MDS 1node
stripe size 1MByteI/Osize  read
 write
 
1K
 13.90
 16.56
 
2K
 27.67
 29.23
 
4K
 54.46
 48.52
 
8K
 105.69
 71.46
 
16K
 200.31
 84.20
 
32K
 363.63
 83.60
 
64K
 615.38
 84.88
 
128K
 934.30
 84.82
 
256K
 1084.74
 84.26
 
512K
 748.53
 83.60
 
1M
 618.35
 86.60
 
2M
 633.60
 85.21
 
4M
 640.00
 85.60
 
8M
 643.21
 84.70
 
16M
 633.60
 84.09
 
32M
 618.35
 83.28
 
64M
 581.81
 85.67
 
128M
 522.44
 84.60
 I/O性能?定(1~64client, 8~64server)
☆スケ?ル性能
*READ(MB/s) 
 8server
 16server
 32server
 64server
 
1client
 670.24
 670.77
 672.06
 672.46
 
2client
 1321.26
 1327.76
 1351.33
 1344.82
 
4client
 2173.99
 2506.53
 2677.33
 2721.45
 
8client
 4164.73
 5294.61
 5312.88
 5541.62
 
16client
 8723.59
 8374.72
 10019.27
 10101.52
 
24client
 12566.05
 12652.49
 12917.50
 12957.77
 
32client
 13827.55
 13827.55
 15563.43
 15662.98
 
64client
 14115.42
 14667.21
 15887.61
 15962.33
 *WRITE(MB/s)
(*?д`)ハァハァ 1752.81 MB/s
DVD(4.7GB)も3秒で保存。。。 
 8server
 16server
 32server
 64server
 
1client
 98.13
 98.30
 97.70
 98.22
 
2client
 195.18
 195.49
 195.39
 195.24
 
4client
 220.50
 288.33
 387.39
 389.77
 
8client
 576.81
 589.74
 676.00
 704.23
 
16client
 789.25
 1122.05
 1222.38
 1370.52
 
24client
 634.55
 1251.69
 1251.23
 1472.45
 
32client
 443.75
 1100.82
 1330.70
 1611.34
 
64client
 200.66
 974.10
 1003.24
 1752.81
  一、简介,实现功能
二、简单介绍lustre构架及各个模块功能附测试数据
三、skybility ha和lustre
四、结语 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/kenera/archive/2008/09/09/2903318.aspx