Lustre FS(v2.x) 구축 및 관리하기
#### Lustre FS(v2.x) 구축 및 관리하기 ######
작성일 : 2016년 3월 1일
작성자 : 서 진우 (alang@clunix.com)
1. Lustre 개요
러스터(Lustre)는 병렬 분산 파일 시스템으로서 주로 고성능 컴퓨팅의 대용량 파일 시스템으로
사용되고 있다. 러스터(Lustre)의 이름은 Linux와 cluster의 혼성어이다
– 러스터 파일시스템의 특징
* 여러 Client 노드에서 특정 파일에 접근할때 여러대의 파일서버에서 동시에 해당 I/O
처리를 수행한다.
* 특정 Client 노드에서 일으키는 대용량 파일을 여러대의 파일서버에서 동시에 Stripe
로 나누어 I/O 를 분산 처리한다.
* 여러 Client 노드에서 대규모 파일을 동시에 접근할 때 여러대의 파일서버에서
해당 I/O 처리를 분산하여 처리한다.
* 어러대의 스토리지 볼륨을 하나의 네임스페이스(Mount Point)로 서비스를 제공한다.
* 사용중인 상태에서 새로운 스토리지 볼륨 확장으로 가용 용량 확장 환경을 제공한다.
* 상당히 안정된 고가용성과 복원력을 가지고 있다.
– 생성 및 발전과정
1999 : Carnegie Mellon University(CMU) Peter Braam 에 의해 개발 시작
2001 : CMU 에서 Coda 프로젝트의 InterMezzo 파일시스템에서 부터 시작
2002~2007 : Lustre on Blue Gene (v1.2~1.4 -> 미국정부, HP, Intel 에서 지원
2007 : SUN Microsystems 에서 인수 (v1.6.4~v1.8.3)
2010 : Sun 이 Oracle 로 합병되면서 Oracle 에서 관리 (v1.8.4~1.8.5)
2010.12 : Oracle 은 2.x 개발 중단 발표, Lustre 개발자들 대거 이탈 -> OpenSFS, EOFS 등으로 분사
실제 창시자인 Braam 은 Xyratex 에 합류
2011 : WhamCloud 에서 OpenSFS에게 Lustre 개발 의뢰 지원 계약 (v2.x~)
2012 : WhamCloud 가 Intel 에 인수, OpenSFS는 Intel과 lustre 개발 지원 계약 전환
2013 : Xyratex 는 Oracle 부터 모든 Lustre 지적재산권 획득했다고 발표
Intel 과 OpenSFS 는 독자적인 채널로 Lustre 사업 추진
OpenSFS 는 Lustre 기술 관련 소유권 문제 해결에 대한 제안 발표,
기술지원, 정보제공 사이트 설립
2014 : Xyratex 는 Lustre 사용자 커뮤니티에 lustre.org 도메인 기부
2015 : OpenSFS, Intel, DDN, Xyratex, EOFS 등등..다양한 커뮤니티와 H/W 벤더에서 지원
– 주요 관련 사이트
http://hpdd.intel.com/
http://wiki.lustre.org/
– 구성 요소
러스터 파일 시스템 환경을 구성하기 위해서는 아래와 같은 구성 요소가
존재한다.
MGS : Lustre 서비스 구성 요소의 서비스 상태 정보를 관리하는 서버
MDS : Lustre 파일 시스템에 저장되는 파일의 Meta 정보를 처리 하는 서버
MDT : MDS 서버에서 저장하는 Meta 정보가 저장되는 타켓 스토리지 장치
OSS : Lustre 파일 시스템에서 발생되는 파일의 실제 데이터 정보를 처리하는 서버
OST : OSS 서버에서 저장하는 데이터 정보가 저장되는 타켓 스토리지 장치
2. Lustre 스토리지 구성을 위한 H/W 설계 최적화
– OST 에 할당하는 LUN 구성
Lustre 파일시스템 접근 시 실질적으로 디스크 장치(OST) 에 있어나는 Block Size에
해당하는 Stripesize 에 맞게 LUN 별 RAID 구성을 할 필요가 있음.
이는 lustre 파일시스템에서 파일에 접근할때 실제 디스크에 접근하는 횟수를
최소화 시킴으로 성능을 최적화 시키는 의미이다.
OST를 최적화 시키기 위해서는 아래와 같은 구성을 권장함.
Lustre stripesize : 1M
LUN Raid block size : 128K
LUN Raid Disk 수 : 10개 (RAID6 구성 시 Full Disk 는 10개, Available Disk 는 8개)
128K * 8 = 1024K
공식으로 표현하자면..
Lustre stripesize = LUN Raid block size * LUN Raid disk 수
또한 Volume 을 파티셔닝할때 fdisk등으로 파티션을 나누어 사용하는 것
보다(/dev/sda1) 장치 자체(/dev/sda)를 그대로 이용하는 것이 좋다.
이는 Partition Alignment 에 대한 부분으로 파티션을 나누게 되면 LINUX의 LBA 방식의
디스크 주소 관리가 아닌 DOS의 CHS 방식으로 관리가 이루어짐. 즉 파티션을 나누면
물리디스크는 무조건 Sector 단위(512Byte)로 I/O를 수행하게 됨. 이로 인해 Lustre의
I/O 처리 단위를 최적화 시키는데 불필요한 복잡한 설계가 발생하게 됨.
3. Open Lustre RPM 패키지 생성하기
** build 순서
lustre Kernel build
infiniband driver build
lustre utils build
lustre-client build
3.1 사전 준비
– redhat, centos yum repo 구성
# vi /etc/yum.repos.d/centos.repo
—————————————————————————-
[base-be]
name=CentOS-6 – Base
repo=os
baseurl=http://ftp.daum.net/centos/6/os/x86_64/
enabled=1
gpgcheck=0
gpgkey=http://ftp.daum.net/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
[updates-be]
name=CentOS-6 – Updates
baseurl=http://ftp.daum.net/centos/6/updates/x86_64/
enable=1
gpgcheck=0
[centosplus-be]
name=CentOS-6 – Plus
baseurl=http://ftp.daum.net/centos/6/centosplus/x86_64/
enabled=1
gpgcheck=0
[extras-be]
name=CentOS-6 – Extras
baseurl=http://ftp.daum.net/centos/6/extras/x86_64/
enable=1
gpgcheck=0
[fasttrack-be]
name=CentOS-6 – Fasttrack
baseurl=http://ftp.daum.net/centos/6/fasttrack/x86_64/
enabled=1
gpgcheck=0
————————————————————————–
# rpm –import http://mirror.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
– Lustre 관련 의존성 패키지 사전 설치
# yum -y install automake xmlto asciidoc elfutils-libelf-devel zlib-devel \
binutils-devel newt-devel python-devel hmaccalc perl-ExtUtils-Embed \
rpm-build make gcc redhat-rpm-config patchutils git
# rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# yum install -y quilt libselinux-devel
3.2 Lustre Kernel 빌드
– Lustre 패키지 다운로드
# git clone git://git.hpdd.intel.com/fs/lustre-release.git
# sh autogen.sh
.
configure.ac:12: installing `config/missing’
libcfs/libcfs/autoMakefile.am: installing `config/depcomp’
– Kernel SRPM 다운로드
# wget http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/kernel-2.6.32-431.el6.src.rpm
– Kernel Source 에 lustre 패치 적용
# rpm -ivh kernel-2.6.32-431.el6.src.rpm
# cd /root/rpmbuild
# rpmbuild -bp –target=`uname -m` ./SPECS/kernel.spec
PGP key 생성 단계에서 더이상 넘어가지 않을 경우가 있다. 그럴 때는 아래 명령을 실행한다.
# rngd -r /dev/hwrandom
# rngd -r /dev/urandom
이제 커널 컴파일에 필요한 환경을 준비한다.
# cd ./BUILD/kernel-2.6.32-431.el6/linux-2.6.32-431.el6.x86_64
# cp /root/lustre-release/lustre/kernel_patches/kernel_configs/kernel-2.6.32-2.6-rhel6-x86_64.config .config
# ln -s /root/lustre-release/lustre/kernel_patches/series/2.6-rhel6.series series
# ln -s /root/lustre-release/lustre/kernel_patches/patches patches
# quilt push -av
.
.
Applying patch patches/jbd2-log_wait_for_space-2.6-rhel6.patch
patching file fs/jbd2/checkpoint.c
Applying patch patches/module-load-deadlock-rhel6.patch
patching file kernel/module.c
Now at patch patches/module-load-deadlock-rhel6.patch
– Kernel config 설정 및 kernel rpm 생성
# make oldconfig || make menuconfig
———————————————————
scripts/kconfig/conf -o arch/x86/Kconfig
#
# configuration written to .config
#
———————————————————
# make include/asm
scripts/kconfig/conf -s arch/x86/Kconfig
SYMLINK include/asm -> include/asm-x86
# make include/linux/version.h
CHK include/linux/version.h
UPD include/linux/version.h
# make SUBDIRS=scripts
.
HOSTCC scripts/mod/mod-extract
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/kallsyms
HOSTCC scripts/pnmtologo
HOSTCC scripts/conmakehash
Building modules, stage 2.
MODPOST 0 modules
# make include/linux/utsrelease.h
CHK include/linux/utsrelease.h
UPD include/linux/utsrelease.h
# vi Makefile
EXTRAVERSION = _431.el6.lustre_2.8.50.clx
# make rpm
# ls /root/rpmbuild/RPMS/x86_64/kernel-2.6.32_431.el6.lustre.clx-4.x86_64.rpm
3.3 Lustre Utils 빌드
# yum install python-utils
# cd /root/lustre-release
# ./configure –with-linux=/root/rpmbuild/BUILD/kernel-2.6.32_431.el6.lustre.clx
# vi lustre.spec
%{!?version: %global version 2.8.50_68_clx}
# vi autoMakefile
%s/gc8e9c0c/clx/g
# make rpms
# ls *.rpm
lustre-2.8.50_68_clx-1.src.rpm
lustre-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
lustre-debuginfo-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
lustre-iokit-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
lustre-modules-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
lustre-osd-ldiskfs-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
lustre-osd-ldiskfs-mount-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
lustre-source-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
lustre-tests-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
– 특정 infiniband o2ib 적용하기
extra modules을 추가하는 lustre server pkg build 는 반드시 lustre kernel을 설치한
환경에서 아래와 같이 수행해야 한다.
# ./configure –with-linux=/root/rpmbuild/BUILD/kernel-2.6.32_431.el6.lustre.clx \
–with-o2ib=/usr/src/ofa_kernel/default –enable-modules
or
./configure –with-linux=/lib/modules/2.6.32_431.el6.lustre.clx/source –with-linux-obj=/lib/modules/2.6.32_431.el6.lustre.clx/build –with-o2ib=/usr/src/ofa_kernel/default –enable-modules
– ZFS 적용
http://zfsonlinux.org/
# tar xzvf spl-0.6.5.7.tar.gz
# cd spl-0.6.5.7
# ./configure
# make rpm
rpm -ivh spl-0.6.5.7-1.el6.x86_64.rpm \
kmod-spl-2.6.32_431.el6.lustre_2.8.50.clx-0.6.5.7-1.el6.x86_64.rpm \
kmod-spl-devel-2.6.32_431.el6.lustre_2.8.50.clx-0.6.5.7-1.el6.x86_64.rpm \
kmod-spl-devel-0.6.5.7-1.el6.x86_64.rpm
# tar xzvf zfs-0.6.5.tar.gz
# cd zfs-0.6.5
# ./configure –with-spl=/usr/src/spl-0.6.5.7
# make rpm
# rpm -Uvh zfs-0.6.5.7-1.el6.x86_64.rpm \
zfs-dracut-0.6.5.7-1.el6.x86_64.rpm \
kmod-zfs-2.6.32_431.el6.lustre_2.8.50.clx-0.6.5.7-1.el6.x86_64.rpm \
kmod-zfs-devel-0.6.5.7-1.el6.x86_64.rpm \
kmod-zfs-devel-2.6.32_431.el6.lustre_2.8.50.clx-0.6.5.7-1.el6.x86_64.rpm \
libnvpair1-0.6.5.7-1.el6.x86_64.rpm \
libuutil1-0.6.5.7-1.el6.x86_64.rpm \
libzfs2-0.6.5.7-1.el6.x86_64.rpm \
libzfs2-devel-0.6.5.7-1.el6.x86_64.rpm \
libzpool2-0.6.5.7-1.el6.x86_64.rpm
# cd <lustre-source>
# ./configure –with-linux=/lib/modules/2.6.32_431.el6.lustre_2.8.50.clx/source –with-linux-obj=/lib/modules/2.6.32_431.el6.lustre_2.8.50.clx/build –with-o2ib=/usr/src/ofa_kernel/default –enable-modules –with-zfs=/usr/src/zfs-0.6.5.7 –with-spl=/usr/src/spl-0.6.5.7
– other kernel 에서 lustre rebuild 하기
# rpmbuild –rebuild lustre-2.8.50_68_clx-1.src.rpm
3.4 Lustre client 빌드하기
# rpmbuild –rebuild –without servers lustre-2.8.50_68_clx-1.src.rpm
– ib 환경에서..
일반적으로 client 의 경우 lustre kernel 을 사용하지 않고, RHEL 자체 커널을 사용한다.
그렇기 때문에 –with-linux 부분에 lustre kernel 위치 대신 RHEL 기본 커널 위치를 설정
한다.
(RHEL 기본 커널의 kernel-devel 패키지가 설치되어 있어야 함)
./configure –with-linux=/lib/modules/2.6.32-431.el6.x86_64/source –with-linux-obj=/lib/modules/2.6.32-431.el6.x86_64/build –with-o2ib=/usr/src/ofa_kernel/default –enable-modules –disable-server
4. Intel Lustre RPM 패키지 다운 받기
지금까지 직접 Open lustre 패키지를 빌드하는 방법에 대해 알아보았다.
특정한 커널 환경에 무조건 맞추어야 하는 요건에서 의미가 있는 작업이다.
만일 일반적인 환경이라면 Intel 에서 제공하는표준 lustre 패키지를 이용해도 된다.
https://downloads.hpdd.intel.com/public/lustre/
# vi /etc/yum.repos.d/lustre-server.repo
———————————————————————————
[lustre-server]
name=lustre-server
baseurl= https://downloads.hpdd.intel.com/public/lustre/latest-release/el6/server
gpgcheck=0
[lustre-client]
name=lustre-client
baseurl= https://downloads.hpdd.intel.com/public/lustre/latest-release/el6/client
gpgcheck=0
[e2fsprogs-pkg]
name=e2fsprogs
baseurl= https://downloads.hpdd.intel.com/public/e2fsprogs/latest/el6
gpgcheck=0
———————————————————————————
# reposync -r lustre-server
# reposync -r lustre-client
# reposync -r e2fsprogs-pkg
앞서 직접 빌드한 lustre 패키지를 가지고 있더라도 lustre 동작을 위해서는 e2fsprogs
패키지는 다운을 받아야 한다.
5. Lustre 설치하기
Lustre 패키지는 Server 용과 Client 용으로 나눌 수 있다.
MGS, MDS, OSS 서버는 모두 Server 용 패키지를 설치해야 하고, 일반 mount 만 수행하는
노드는 Client 패키지만 설치하면 된다.
5.1 Open Lustre Server 패키지 설치 하기 (MDS, OSS 서버에 설치)
직접 빌드한 커널을 설치하기 위해서는 kernel-devel, kernel-headers, kernel-firmware
에 해당하는 부분을 직접 생성해 주어야 한다.
– kernel 설치
# cd <Lustre_PKG>/lustre-clx-rhel6.5
# rpm -ivh kernel-2.6.32_431.el6.lustre.clx-4.x86_64.rpm
# /sbin/new-kernel-pkg –package kernel –mkinitrd –dracut –depmod \
–install 2.6.32_431.el6.lustre.clx
– e2fsprogs 설치
# rpm -ivh e2fsprogs-1.42.13.wc4-7.el6.x86_64.rpm \
e2fsprogs-devel-1.42.13.wc4-7.el6.x86_64.rpm \
e2fsprogs-libs-1.42.13.wc4-7.el6.x86_64.rpm \
libcom_err-1.42.13.wc4-7.el6.x86_64.rpm \
libcom_err-devel-1.42.13.wc4-7.el6.x86_64.rpm \
libss-1.42.13.wc4-7.el6.x86_64.rpm \
libss-devel-1.42.13.wc4-7.el6.x86_64.rpm –force
– Reboot
# shutdown -r now
– lustre 설치
# yum install sg3_utils
# rpm -ivh lustre-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm \
lustre-modules-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm \
lustre-osd-ldiskfs-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm \
lustre-osd-ldiskfs-mount-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm \
lustre-tests-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm \
lustre-iokit-2.8.50_68_clx-2.6.32_431.el6.lustre.clx.x86_64.rpm
– kernel 설치 후 lnet 설정
# vi /etc/modprobe.d/lustre.conf
———————————————————–
#options lnet networks=o2ib(ib0),tcp(eth0)
options lnet networks=tcp(eth0)
———————————————————–
# chkconfig lnet –add
# chkconfig lnet on
# chkconfig lustre –add
# chkconfig lustre on
// lustre 네트워크를 다른 NIC로 분리하고자 할때
// 아래 lnet 예제 참고
options lnet networks=”tcp0(eth0,eth1),tcp1(eth0),tcp2(eth1)”
options lnet networks=tcp0(eth1) ## 특정 NIC
options lnet networks=”o2ib0(ib0)” ## IB
options lnet networks=”tcp(ib0)” ## IPoIB
// TCP, IP 혼용
options lnet networks=tcp(eth0),o2ib ## TCP, IB 혼용
192.168.206.160@tcp:10.0.0.1@o2ib
– Reboot
# shutdown -r now
5.2 Intel Lustre Server 패키지 설치하기
Intel Lustre Kernel 을 사용하기 위해서는 Intel Lustre에서 제공하는
kernel, kernel-devel, kernel-firmware, kernel-headers rpm 패키지를 설치한다.
설치된 RHEL 커널 버전은 Intel 에서 다운받은 lustre 패키지의 기반 커널 버전이
동일한 환경을 권장한다.
# vi /etc/yum.repos.d/centos.repo
—————————————————————————-
[base-be]
name=CentOS-6 – Base
repo=os
baseurl=http://ftp.daum.net/centos/6/os/x86_64/
enabled=1
gpgcheck=0
gpgkey=http://ftp.daum.net/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
[updates-be]
name=CentOS-6 – Updates
baseurl=http://ftp.daum.net/centos/6/updates/x86_64/
enable=1
gpgcheck=0
[centosplus-be]
name=CentOS-6 – Plus
baseurl=http://ftp.daum.net/centos/6/centosplus/x86_64/
enabled=1
gpgcheck=0
[extras-be]
name=CentOS-6 – Extras
baseurl=http://ftp.daum.net/centos/6/extras/x86_64/
enable=1
gpgcheck=0
[fasttrack-be]
name=CentOS-6 – Fasttrack
baseurl=http://ftp.daum.net/centos/6/fasttrack/x86_64/
enabled=1
gpgcheck=0
————————————————————————–
# yum install dracut dracut-kernel
# cd <Lustre_PKG>/luster-server/RPMS/x86_64
# rpm -Uvh kernel-2.6.32-573.12.1.el6_lustre.x86_64.rpm \
kernel-devel-2.6.32-573.12.1.el6_lustre.x86_64.rpm \
kernel-firmware-2.6.32-573.12.1.el6_lustre.x86_64.rpm \
kernel-headers-2.6.32-573.12.1.el6_lustre.x86_64.rpm –force
# cd <Lustre_PKG>/e2fsprogs-pkg/RPMS/x86_64/
# rpm -ivh e2fsprogs-1.42.13.wc4-7.el6.x86_64.rpm \
e2fsprogs-devel-1.42.13.wc4-7.el6.x86_64.rpm \
e2fsprogs-libs-1.42.13.wc4-7.el6.x86_64.rpm \
libcom_err-1.42.13.wc4-7.el6.x86_64.rpm \
libcom_err-devel-1.42.13.wc4-7.el6.x86_64.rpm \
libss-1.42.13.wc4-7.el6.x86_64.rpm \
libss-devel-1.42.13.wc4-7.el6.x86_64.rpm –force
# shutdown -r now
# cd <Lustre_PKG>/luster-server/RPMS/x86_64
# yum install sg3_utils
# yum install elfutils elfutils-devel
# rpm -ivh lustre-2.8.0-2.6.32_573.12.1.el6_lustre.x86_64.x86_64.rpm \
lustre-modules-2.8.0-2.6.32_573.12.1.el6_lustre.x86_64.x86_64.rpm \
lustre-osd-ldiskfs-* lustre-tests-2.8.0-2.6.32_573.12.1.el6_lustre.x86_64.x86_64.rpm \
lustre-iokit-2.8.0-2.6.32_573.12.1.el6_lustre.x86_64.x86_64.rpm
# rpm -ivh perf-2.6.32-573.12.1.el6_lustre.x86_64.rpm \
python-perf-2.6.32-573.12.1.el6_lustre.x86_64.rpm –force
6. Lustre 파일시스템 구성하기
6.1 MGS, MDS 구성하기
– MGS, MDT 구성
* 기본 구성 명령
mkfs.lustre -–fsname=gcfs -–mgs -–mdt -–reformat -–index=0 /dev/xvdb
* 두대의 MDS 로 구성
mkfs.lustre –reformat –fsname=gcfs –mgs –mdt –index=0 –servicenode=MDS01@tcp –servicenode=MDS02@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp /dev/xvdb
* MGS 와 MDT 분리
mkfs.lustre -–mgs /dev/xvdc
mkfs.lustre –reformat –fsname=gcfs –mdt –index=0 –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp /dev/xvdb
# mount -t lustre /dev/xvdc /gcfs/mds
# cat /proc/fs/lustre/devices
0 UP osd-ldiskfs gcfs-MDT0000-osd gcfs-MDT0000-osd_UUID 8
1 UP mgs MGS MGS 5
2 UP mgc MGC192.168.201.131@tcp 6b98783f-2749-bf6f-e202-a2bb61694496 5
3 UP mds MDS MDS_uuid 3
4 UP lod gcfs-MDT0000-mdtlov gcfs-MDT0000-mdtlov_UUID 4
5 UP mdt gcfs-MDT0000 gcfs-MDT0000_UUID 3
6 UP mdd gcfs-MDD0000 gcfs-MDD0000_UUID 4
7 UP qmt gcfs-QMT0000 gcfs-QMT0000_UUID 4
8 UP lwp gcfs-MDT0000-lwp-MDT0000 gcfs-MDT0000-lwp-MDT0000_UUID 5
# vi /etc/ldev.conf
MDS01 MDS02 gcfs-MDT0000 /dev/xvdb
# scp /etc/ldev.conf MDS02:/etc
# /etc/rc.d/init.d/lustre start
6.2 OSS 구성 하기
– OSS 별 OST 구성 확인
OSS01 (OST01-1, OST01-2, OST01-3)
OSS02 (OST02-1, OST02-2, OST02-3)
– OSS01 서버에서 OST 구성
# mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS01@tcp –servicenode=OSS02@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=0 /dev/xvdb
————————————————————————————————–
Permanent disk data:
Target: gcfs:OST0000
Index: 0
Lustre FS: gcfs
Mount type: ldiskfs
Flags: 0x1062
(OST first_time update no_primnode )
Persistent mount opts: ,errors=remount-ro
Parameters: failover.node=192.168.201.133@tcp:192.168.201.134@tcp mgsnode=192.168.201.131@tcp:192.168.201.132@tcp
device size = 102400MB
formatting backing filesystem ldiskfs on /dev/xvdb
target name gcfs:OST0000
4k blocks 26214400
options -J size=400 -I 256 -i 69905 -q -O extents,uninit_bg,mmp,dir_nlink,quota,huge_file,flex_bg -G 256 -E resize=”4290772992″,lazy_journal_init -F
mkfs_cmd = mke2fs -j -b 4096 -L gcfs:OST0000 -J size=400 -I 256 -i 69905 -q -O extents,uninit_bg,mmp,dir_nlink,quota,huge_file,flex_bg -G 256 -E resize=”4290772992″,lazy_journal_init -F /dev/xvdb 26214400
Writing CONFIGS/mountdata
————————————————————————————————-
# mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS01@tcp –servicenode=OSS02@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=1 /dev/xvdc
# mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS01@tcp –servicenode=OSS02@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=2 /dev/xvde
# vi /etc/ldev.conf
OSS01 OSS02 gcfs-OST0000 /dev/xvdb
OSS01 OSS02 gcfs-OST0001 /dev/xvdc
OSS01 OSS02 gcfs-OST0002 /dev/xvde
# /etc/rc.d/init.d/lustre start
– OSS02 서버에서 OST 구성
mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS02@tcp –servicenode=OSS01@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=3 /dev/xvdb
mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS02@tcp –servicenode=OSS01@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=4 /dev/xvdc
mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS02@tcp –servicenode=OSS01@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=5 /dev/xvde
# vi /etc/ldev.conf
OSS02 OSS01 gcfs-OST0003 /dev/xvdb
OSS02 OSS01 gcfs-OST0004 /dev/xvdc
OSS02 OSS01 gcfs-OST0005 /dev/xvde
# /etc/rc.d/init.d/lustre start
– OSS 구성 상태 확인 하기
// MGS 서버에서 확인
# cat /proc/fs/lustre/lov/gcfs-MDT0000-mdtlov/target_obd
0: gcfs-OST0000_UUID ACTIVE
1: gcfs-OST0001_UUID ACTIVE
2: gcfs-OST0002_UUID ACTIVE
3: gcfs-OST0003_UUID ACTIVE
4: gcfs-OST0004_UUID ACTIVE
5: gcfs-OST0005_UUID ACTIVE
# cat /proc/fs/lustre/health_check
healthy
# cat /proc/sys/lnet/stats
0 6 0 519 519 0 0 187456 449448 0 0
첫번째 카테고리가 2분간 30000 이상이면 이상
7. Lustre Client 설치하기
– Open Lustre PKG 로 설치하기
lustre utile 이 build 된 커널 버전과 동일하게 맞춘다. Lustre Client 노드가
많은 경우에는 lutre utile 을 rebuild 하는 것을 고려..
# yum install sg3_utils
# rpm -ivh lustre-client-2.8.50_68_clx-2.6.32_431.el6.x86_64.x86_64.rpm \
lustre-client-modules-2.8.50_68_clx-2.6.32_431.el6.x86_64.x86_64.rpm \
lustre-client-tests-2.8.50_68_clx-2.6.32_431.el6.x86_64.x86_64.rpm \
lustre-iokit-2.8.50_68_clx-2.6.32_431.el6.x86_64.x86_64.rpm
만약 ib 환경이라면..
# vi /etc/modprobe.d/lustre.conf
———————————————————–
#options lnet networks=o2ib(ib0),tcp(eth0)
options lnet networks=tcp(eth0)
———————————————————–
# chkconfig lnet –add
# chkconfig lnet on
# /etc/rc.d/init.d/lnet restart
– Intel PKG 로 설치하기
# vi /etc/yum.repos.d/centos.repo
—————————————————————————-
[base-be]
name=CentOS-6 – Base
repo=os
baseurl=http://ftp.daum.net/centos/6/os/x86_64/
enabled=1
gpgcheck=0
gpgkey=http://ftp.daum.net/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
[updates-be]
name=CentOS-6 – Updates
baseurl=http://ftp.daum.net/centos/6/updates/x86_64/
enable=1
gpgcheck=0
[centosplus-be]
name=CentOS-6 – Plus
baseurl=http://ftp.daum.net/centos/6/centosplus/x86_64/
enabled=1
gpgcheck=0
[extras-be]
name=CentOS-6 – Extras
baseurl=http://ftp.daum.net/centos/6/extras/x86_64/
enable=1
gpgcheck=0
[fasttrack-be]
name=CentOS-6 – Fasttrack
baseurl=http://ftp.daum.net/centos/6/fasttrack/x86_64/
enabled=1
gpgcheck=0
————————————————————————–
RHEL 커널 버전을 lustre-client 커널 버전과 맞춘다.
# yum install sg3_utils
# yum update kernel kernel-devel
혹은
# wget http://ftp.daumkakao.com/centos/6.7/updates/x86_64/Packages/kernel-2.6.32-573.12.1.el6.x86_64.rpm
# wget http://ftp.daumkakao.com/centos/6.7/updates/x86_64/Packages/kernel-devel-2.6.32-573.12.1.el6.x86_64.rpm
# wget http://ftp.daumkakao.com/centos/6.7/updates/x86_64/Packages/kernel-headers-2.6.32-573.12.1.el6.x86_64.rpm
# wget http://ftp.daumkakao.com/centos/6.7/updates/x86_64/Packages/kernel-2.6.32-573.12.1.el6.x86_64.rpm
# rpm -ivh kernel*.rpm
# shutdown -r now
# rpm -ivh lustre-client-2.8.0-2.6.32_573.12.1.el6.x86_64.x86_64.rpm \
lustre-client-modules-2.8.0-2.6.32_573.12.1.el6.x86_64.x86_64.rpm \
lustre-client-tests-2.8.0-2.6.32_573.12.1.el6.x86_64.x86_64.rpm \
lustre-iokit-2.8.0-2.6.32_573.12.1.el6.x86_64.x86_64.rpm
7.2 Lustre client mount 연결하기
mount -t lustre -o defaults,_netdev MDS01@tcp:MDS02@tcp:/gcfs /home
# vi /etc/fstab
—————————————————————————-
.
MDS01@tcp:MDS02@tcp:/gcfs /home lustre defaults,flock,_netdev 0 0
—————————————————————————-
// pbs, sge, casa, apis 와 같이 lock 관리가 필요한 sw 이용 시 flock 옵션 사용
7.3 동작 확인
# cat /proc/fs/lustre/lov/gcfs-clilov-*/target_obd
0: gcfs-OST0000_UUID ACTIVE
1: gcfs-OST0001_UUID ACTIVE
2: gcfs-OST0002_UUID ACTIVE
3: gcfs-OST0003_UUID ACTIVE
4: gcfs-OST0004_UUID ACTIVE
5: gcfs-OST0005_UUID ACTIVE
# lfs df -h
UUID bytes Used Available Use% Mounted on
gcfs-MDT0000_UUID 74.4G 4.1G 65.3G 6% /home[MDT:0]
gcfs-OST0000_UUID 98.8G 460.7M 93.4G 0% /home[OST:0]
gcfs-OST0001_UUID 98.8G 460.7M 93.4G 0% /home[OST:1]
gcfs-OST0002_UUID 98.8G 460.7M 93.4G 0% /home[OST:2]
gcfs-OST0003_UUID 98.8G 460.7M 93.4G 0% /home[OST:3]
gcfs-OST0004_UUID 98.8G 460.7M 93.4G 0% /home[OST:4]
gcfs-OST0005_UUID 98.8G 460.7M 93.4G 0% /home[OST:5]
8. Lustre 상태 모니터링
– MDT
# llstat -i 1 mdt
# cat /proc/fs/lustre/devices
# lctl device_list
# cat /proc/fs/lustre/health_check
– OSS
# llstat -i 1 ost
# llobdstat gcfs-OST0000 1
# cat /proc/fs/lustre/health_check
# cat /proc/fs/lustre/devices
– Client
# lfs df -h
UUID bytes Used Available Use% Mounted on
gcfs-MDT0000_UUID 112.9G 4.1G 101.1G 4% /home[MDT:0]
gcfs-OST0000_UUID 920.3G 907.4M 872.8G 0% /home[OST:0]
gcfs-OST0001_UUID 920.3G 527.9M 873.2G 0% /home[OST:1]
gcfs-OST0002_UUID 920.3G 675.8M 873.0G 0% /home[OST:2]
gcfs-OST0003_UUID 920.3G 1.0G 872.7G 0% /home[OST:3]
gcfs-OST0004_UUID 920.3G 535.9M 873.2G 0% /home[OST:4]
gcfs-OST0005_UUID 920.3G 541.1M 873.2G 0% /home[OST:5]
filesystem summary: 5.4T 4.1G 5.1T 0% /home
Lustre file system Disk Free Space
# lfs check servers
gcfs-MDT0000-mdc-ffff8801fb3c4800 active.
gcfs-OST0003-osc-ffff8801fb3c4800 active.
gcfs-OST0004-osc-ffff8801fb3c4800 active.
gcfs-OST0000-osc-ffff8801fb3c4800 active.
gcfs-OST0001-osc-ffff8801fb3c4800 active.
gcfs-OST0005-osc-ffff8801fb3c4800 active.
gcfs-OST0002-osc-ffff8801fb3c4800 active.
# lfs osts
OBDS:
0: gcfs-OST0000_UUID ACTIVE
1: gcfs-OST0001_UUID ACTIVE
2: gcfs-OST0002_UUID ACTIVE
3: gcfs-OST0003_UUID ACTIVE
4: gcfs-OST0004_UUID ACTIVE
5: gcfs-OST0005_UUID ACTIVE
# lfs mdts
MDTS:
0: gcfs-MDT0000_UUID ACTIVE
9. Lustre 성능 튜닝
* IB Performance tunning
Create a file named mpt3sas.conf in /etc/modprobe.d and put the following line.
max_sgl_entries=256
To turn on the automatic affinity utility, JK changed the option from the default value, “no”, to “yes” in /etc/infiniband/openib.conf in every node.
RUN_AFFINITY_TUNER=yes
Check BIOS setting
psh all ‘echo performance > /sys/devices/system/cpu/cpu35/cpufreq/scaling_governor’
# optimization parameters for Lustre Servers
– MDS, OSS
vi /etc/grub.conf
add “elevator=deadline”(no quotes) at the end of kernel line
vi /etc/rc.d/rc.local
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
echo no > /sys/kernel/mm/redhat_transparent_hugepage/khugepaged/defrag
for device in $(ls -d /sys/block/*)
do
echo 1024 > $device/queue/max_sectors_kb
echo 1024 > $device/queue/nr_requests
echo 8192 > $device/queue/read_ahead_kb
echo 2 > $device/queue/rq_affinity
done
for scsi_id in $(ls -d /sys/bus/scsi/devices/*:*:*:*)
do
echo 600 > $scsi_id/queue_depth
done
– OSS
lctl get_param ost.OSS.*.threads_max
lctl set_param ost.OSS.*.threads_max=512
lctl set_param ost.OSS.*.threads_min=512
– Client
lctl set_param osc.*.max_rpcs_in_flight=256
lctl set_param osc.*.max_dirty_mb=1024
lctl set_param llite.*.max_read_ahead_mb=256
lctl get_param llite.*.max_cached_mb
cat /proc/sys/lnet/debug
sysctl -w lnet.debug=0
MDS> lctl conf_param gcfs-MDT0000.lov.stripesize=1M
lov.stripesize=<bytes>
lov.stripecount=<count>
lov.stripeoffset=<offset>
MDS> lctl conf_param gcfs-MDT0000.lov.stripecount=6
stripecount 값이 -1 은 모든 OST에 나눔
MDS> cat /proc/fs/lustre/lov/gcfs-MDT0000-mdtlov/stripesize
MDS> cat /proc/fs/lustre/lov/gcfs-MDT0000-mdtlov/stripecount
/sbin/sysctl -w lnet.debug=0x3f0400
* Lustre I/O Tunables
The section describes I/O tunables.
/proc/fs/lustre/llite/<fsname>-<uid>/max_cached_mb
# cat /proc/fs/lustre/llite/lustre-ce63ca00/max_cached_mb
128
Default striping
lov.stripesize=<bytes>
lov.stripecount=<count>
lov.stripeoffset=<offset>
change default striping info
mgs> lctl conf_param gcfs-MDT0000.lov.stripesize=4M
mdt/cli> cat /proc/fs/lustre/lov/gcfs-{mdt|cli}lov/stripe*
[edit]
Other parameters
Any parameter settable in a /proc/fs/lustre/ file can be specified as <obd|fsname>.<obdtype>.<proc_file_name>=<value>, e.g.:
tunefs.lustre –param mdt.group_upcall=NONE /dev/sda1
lctl conf_param gcfs-MDT0000.mdt.group_upcall=NONE
lctl conf_param gcfs.llite.max_read_ahead_mb=16
… gcfs-MDT0000.lov.stripesize=2M
… gcfs-OST0000.osc.max_dirty_mb=29.15
… gcfs-OST0000.ost.client_cache_seconds=15
… gcfs.sys.timeout=40
10. Lustre 기본 관리
– Lustre 서버 중지 하기
lustre 는 mount 와 umount 시 해당 데몬이 자동으로 시작, 종료된다.
# umount -f /mnt/test/ost0
– Inactive 상태의 OST 마운트하기
vnode01> mount -o exclude=gcfs-OST0000 -t lustre vnode00:/gcfs /lustrefs
vnode01> cat /proc/fs/lustre/lov/gcfs-clilov-*/target_obd
– OST 서버 제거 하기
MGS 서버에서 아래 명령을 실행 한다.
만일 특정 OST 에서 문제가 발생하였을때 client 는 lustre 파일시스템 접근
에 hang 이 발생한다. 이때 문제 발생 OST를 서비스에서 제외하고자 할 때
아래와 같이 해당 OST를 INACTIVE 시키면 된다.
그럼 문제가 발생한 OST를 제외하고 나머지 OST에 데이터가 저장되며 서비스
가 가능하다.
MDS > lctl conf_param gcfs-OST0002.osc.active=0
Clinet > cat /proc/fs/lustre/lov/gcfs-clilov-*/target_obd
0: gcfs-OST0000_UUID INACTIVE
1: gcfs-OST0001_UUID INACTIVE
2: gcfs-OST0002_UUID INACTIVE
3: gcfs-OST0003_UUID INACTIVE
4: gcfs-OST0004_UUID INACTIVE
5: gcfs-OST0005_UUID INACTIVE
6: gcfs-OST0006_UUID INACTIVE
7: gcfs-OST0007_UUID INACTIVE
8: gcfs-OST0008_UUID INACTIVE
– OST 서버 복구 하기
문제가 해결된 후에는 해당 OST를 다시 ACTIVE 시키면 된다.
그럼..그 이후부터 저장되는 데이터는 복구된 OST에도 저장이 되어진다.
MDS > lctl conf_param gcfs-OST0002.osc.active=1
Clinet > cat /proc/fs/lustre/lov/gcfs-clilov-*/target_obd
– FS 제거하기
Lustre 파일 시스템을 제거하고 해당 Device 에 다른 파일 시스템을 생성하고자 할때 아래 구문을 사용한다
.
# mkfs.lustre –writeconf –reformat …
– 새로운 OSS, OST 추가 및 재분배
OSS를 동일하게 설치
–index= 는 기존 OST 마지막 다음 번호로
# mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS03@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=6 /dev/xvdb
# mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS03@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=7 /dev/xvdc
# mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS03@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=8 /dev/xvde
# vi /etc/ldev.conf
OSS03 OSS03 gcfs-OST0006 /dev/xvdb
OSS03 OSS03 gcfs-OST0007 /dev/xvdc
OSS03 OSS03 gcfs-OST0008 /dev/xvde
/etc/rc.d/init.d/lustre start
정상적으로 OST 가 추가되어 용량 확장이 되었는지 client 에서 직접 확인
# lfs df -h
// 용량 재분배 (rebalancing)
OST 가 추가되면 기존 OST 용량과 신규 증설된 OST 용량 차이가 클것이다.
이것을 균등하게 재 분배해 줄 필요가 있다.
재 분배 작업은 I/O 작업이 없는 상태에서 하는 것을 권장한다. .
Clinet> lfs_migrate /home
Client> lfs find /home -obd gcfs-OST0004 -size +4G | lfs_migrate -y
– OST 정보 변경하기
현재 OST 노드 할당 정보
MDS> lctl get_param osc.*-OST0000*.ost_conn_uuid
MDS> lctl get_param osc.*.ost_conn_uuid
osc.gcfs-OST0000-osc-MDT0000.ost_conn_uuid=192.168.201.133@tcp
osc.gcfs-OST0001-osc-MDT0000.ost_conn_uuid=192.168.201.133@tcp
osc.gcfs-OST0002-osc-MDT0000.ost_conn_uuid=192.168.201.133@tcp
osc.gcfs-OST0003-osc-MDT0000.ost_conn_uuid=192.168.201.134@tcp
osc.gcfs-OST0004-osc-MDT0000.ost_conn_uuid=192.168.201.134@tcp
osc.gcfs-OST0005-osc-MDT0000.ost_conn_uuid=192.168.201.134@tcp
osc.gcfs-OST0006-osc-MDT0000.ost_conn_uuid=192.168.201.137@tcp
osc.gcfs-OST0007-osc-MDT0000.ost_conn_uuid=192.168.201.137@tcp
osc.gcfs-OST0008-osc-MDT0000.ost_conn_uuid=192.168.201.137@tcp
현재 OST 에 대한 설정 정보 확인하기
# tunefs.lustre /dev/xvdb
Reading CONFIGS/mountdata
Read previous values:
Target: gcfs-OST0006
Index: 6
Lustre FS: gcfs
Mount type: ldiskfs
Flags: 0x1002
(OST no_primnode )
Persistent mount opts: ,errors=remount-ro
Parameters: failover.node=192.168.201.137@tcp mgsnode=192.168.201.131@tcp:192.168.201.132@tcp
Permanent disk data:
Target: gcfs-OST0006
Index: 6
Lustre FS: gcfs
Mount type: ldiskfs
Flags: 0x1002
(OST no_primnode )
Persistent mount opts: ,errors=remount-ro
Parameters: failover.node=192.168.201.137@tcp mgsnode=192.168.201.131@tcp:192.168.201.132@tcp
OST 정보 변경하기 (failover.node 변경)
먼저 해당 OST 를 umount 시킨다. (mount 상태에서는 변경안됨. 대신 변경 정보를 확인은 가능)
# /etc/rc.d/init.d/lustre stop
# tunefs.lustre –writeconf –erase-params –fsname=gcfs –ost –servicenode=OSS03@tcp –servicenode=OSS01@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=6 /dev/xvdb
# tunefs.lustre –erase-params –servicenode=OSS03@tcp –servicenode=OSS01@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp /dev/xvde
– OST 교체 하기
xvde -> xvdf 로 교체
우선 해당 OST를 deactive 시킨다.
MDS> lctl conf_param gcfs-OST0008.osc.active=0 (xvde)
# tunefs.lustre /dev/xvde
checking for existing Lustre data: found
Reading CONFIGS/mountdata
Read previous values:
Target: gcfs-OST0008
Index: 8
Lustre FS: gcfs
Mount type: ldiskfs
Flags: 0x1002
(OST no_primnode )
Persistent mount opts: ,errors=remount-ro
Parameters: failover.node=192.168.201.137@tcp:192.168.201.133@tcp mgsnode=192.168.201.131@tcp:192.168.201.132@tcp
Permanent disk data:
Target: gcfs-OST0008
Index: 8
Lustre FS: gcfs
Mount type: ldiskfs
Flags: 0x1002
(OST no_primnode )
Persistent mount opts: ,errors=remount-ro
Parameters: failover.node=192.168.201.137@tcp:192.168.201.133@tcp mgsnode=192.168.201.131@tcp:192.168.201.132@tcp
해당 OSS 서버에서 해당 OST mount 를 해제한다.
# /etc/rc.d/init.d/lustre stop gcfs-OST0008
// 단순 H/W 교체로 인한 변경
dd if=/dev/{original} of=/dev/{new} bs=1M
// H/W 장애로 인한 변경 (일부 block 이 깨져서 망가진 경우..)
dd if=/dev/{original} of=/dev/{new} bs=4k conv=sync,noerror count={original size in 4kB blocks}
xvde 제거, xvdf 를 xvde 위치에 장착 (디스크 or RAID 컨트롤러의 같은 자리에..)
부팅..
# tunefs.lustre –writeconf /dev/xvde
OST 변경 전과 동일하게 나와야 함.
# /etc/rc.d/init.d/lustre start
MDS> lctl conf_param gcfs-OST0008.osc.active=1 (xvde)
– OST 백업 및 복구
// 백업
MDS> lctl conf_param gcfs-OST0008.osc.active=0
[oss]# mkdir -p /mnt/ost
[oss]# mount -t ldiskfs /dev/{ostdev} /mnt/ost
[oss]# cd /mnt/ost
[oss]# getfattr -R -d -m ‘.*’ -e hex -P . > ea-$(date +%Y%m%d).bak
[oss]# more ea-20160328.bak
file: O/0/d0/100992
trusted.fid= \
0x0d822200000000004a8a73e500000000808a0100000000000000000000000000
[oss]# tar czvf {backup file}.tgz –sparse .
[oss]# cd –
[oss]# umount /mnt/ost
// 복구
기존과 동일한 물리적인 OST 구성을 새로 한 후, 같은 이름으로 OST -reformat
[oss]# mkfs.lustre –ost –index {OST index} {other options} newdev}
mkfs.lustre –reformat –fsname=gcfs –ost –servicenode=OSS03@tcp –servicenode=OSS01@tcp –mgsnode=MDS01@tcp –mgsnode=MDS02@tcp –index=8 /dev/xvde
[oss]# mount -t ldiskfs {newdev} /mnt/ost
[oss]# cd /mnt/ost
[oss]# tar xzvpf {backup file} –sparse
[oss]# setfattr –restore=ea-${date}.bak
[oss]# getfattr -d -m “.*” -e hex O/0/d0/100992 trusted.fid= \
0x0d822200000000004a8a73e500000000808a0100000000000000000000000000
[oss]# cd –
[oss]# umount /mnt/ost
OSS> tunefs.lustre –writeconf /dev/xvde
MDS> lctl conf_param gcfs-OST0008.osc.active=1
– lfs 명령 사용법
// 특정 파일이 어느 OST 에 stripe 되어 있는지 확인
# lfs getstripe -d /nobackup/your_user_name
lspost.cfile
lmm_stripe_count: 2
lmm_stripe_size: 1048576
lmm_pattern: 1
lmm_layout_gen: 0
lmm_stripe_offset: 2
obdidx objid objid group
2 1253 0x4e5 0
5 1318 0x526 0
특정 파일에 대한 stripe 구성 정의
lfs setstripe -s stripe_size -c stripe_count -o stripe_offset dir|filename
// 예제
mkdir dir1
lfs setstripe -s 1m -c 8 dir1
lfs setstripe -c 20 bigdir.tar
tar cf bigdir.tar bigdir
lfs getstripe filename
lfs getstripe -d directory_name
lfs quota -h -u username /nobackupp8
lfs quota -h -u username /nobackup/username
// 모든 ost 의 quota 확인
lfs quota -h -v -u username /nobackup/username
// 특정 사용자의 데이터를 특정 OST 에 고정시키기
lfs setstripe -i <start_ost_index> -c <stripe_count> <file or directory>
lsf setstripe -i 0 -c 1 /home/alang
위와 같이 하면 alang 홈디렉토리에 저장되는 데이터는 첫번째 OST에만 저장
된다.
– quota 관리
Enable Lustre quotas
mds > tunefs.lustre –param=mdt.quota_type=ug /dev/xvdb
oss >
tunefs.lustre –param=ost.quota_type=ug /dev/xvd{b,c,e}
– Storage 단절 필요 시 절차
관리 목적등으로 Storage Box 와 MDS, OSS 간의 단절이 발생하는 경우는
반드시 Storage Box 의 전원을 내리거나 단절을 하기 전에 모든 Lustre 서비스
를 정상적으로 종료 시켜 주길 권장한다.
Lustre 서비스 완전 종료 순서
1. 모든 Lustre Client 종료 (lustre umount or shutdown)
2. 모든 OSS 서버 종료 (ost umount or shutdown)
3. 모든 MDS 서버 종료 (mdt umount or shutdown)
4. Storage Box 종료 혹은 단절
Lustre 서비스 시작 순서
1. Storage Box 재 연결 및 부팅
2. 모든 MDS 서버 부팅 및 mdt mount
3. 모든 OSS 서버 부팅 및 ost mount
4. 모든 lustre client mount
10. Lustre 성능 BMT 하기
10.1 MDS, OSS Server 에서의 성능 측정
– obdfilter-survey
nobjhi : OST 별 파일 수
thrhi : OST 별 threads 수
size : 파일 크기
// 결과 output
OSS1># nobjhi=2 thrhi=2 size=1024 targets=”gcfs-OST0000 gcfs-OST0001 gcfs-OST0002″ obdfilter-survey
Thu Mar 31 18:11:11 KST 2016 Obdfilter-survey for case=disk from OSS001
ost 3 sz 3145728K rsz 1024K obj 3 thr 3 write 108.44 [ 33.99, 52.00] rewrite 108.51 [ 34.00, 52.00] read 57216.90 SHORT
ost 3 sz 3145728K rsz 1024K obj 3 thr 6 write 109.61 [ 27.00, 55.00] rewrite 109.50 [ 26.00, 55.00] read 51764.47 SHORT
ost 3 sz 3145728K rsz 1024K obj 6 thr 6 write 109.53 [ 26.97, 55.00] rewrite 109.59 [ 27.00, 55.00] read 68820.05 SHORT
done!
OSS2># nobjhi=2 thrhi=2 size=1024 targets=”gcfs-OST0003 gcfs-OST0004 gcfs-OST0005″ obdfilter-survey
Thu Mar 31 18:20:50 KST 2016 Obdfilter-survey for case=disk from OSS002
ost 3 sz 3145728K rsz 1024K obj 3 thr 3 write 108.57 [ 33.99, 52.00] rewrite 108.48 [ 33.99, 52.00] read 61249.63 SHORT
ost 3 sz 3145728K rsz 1024K obj 3 thr 6 write 109.23 [ 27.00, 84.99] rewrite 108.59 [ 27.00, 67.99] read 60118.80 SHORT
ost 3 sz 3145728K rsz 1024K obj 6 thr 6 write 109.59 [ 27.00, 55.00] rewrite 109.60 [ 27.98, 55.00] read 73660.42 SHORT
done!
– sgpdd-survey
# size=1024 crglo=1 crghi=2 thrlo=1 thrhi=2 scsidevs=”/dev/sda” sgpdd-survey
2016. 03. 31. (목) 18:34:24 KST sgpdd-survey on /dev/sda from OSS001
dev 1 sz 1048576K rsz 1024K crg 1 thr 1 write 32.27 [ 32.27, 32.27] read 53.84 [ 53.84, 53.84]
dev 1 sz 1048576K rsz 1024K crg 1 thr 2 write 41.76 [ 41.77, 41.77] read 60.45 [ 60.47, 60.47]
dev 1 sz 1048576K rsz 1024K crg 2 thr 2 write 41.97 [ 20.99, 21.00] read 61.10 [ 30.56, 30.59]
# size=1024 crglo=1 crghi=2 thrlo=1 thrhi=2 scsidevs=”/dev/sda /dev/sdb” sgpdd-survey
2016. 03. 31. (목) 18:41:02 KST sgpdd-survey on /dev/sda /dev/sdb from OSS001
dev 2 sz 2097152K rsz 1024K crg 2 thr 2 write 49.86 [ 24.94, 25.01] read 100.60 [ 50.31, 50.44]
dev 2 sz 2097152K rsz 1024K crg 2 thr 4 write 60.93 [ 30.47, 30.67] read 106.04 [ 53.03, 53.36]
dev 2 sz 2097152K rsz 1024K crg 4 thr 4 write 60.36 [ 15.10, 15.14] read 107.49 [ 26.87, 26.92]
OSS> size=30 crglo=1 crghi=2 thrlo=1 thrhi=2 scsidevs=”/dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl” sgpdd-survey
dev 12 sz 368640K rsz 1024K crg 12 thr 12 write 79.33 [ 6.62, 9.34] read 110.19 [ 9.20, 9.54]
dev 12 sz 368640K rsz 1024K crg 12 thr 24 write 78.60 [ 6.56, 10.27] read 110.64 [ 9.24, 9.79]
dev 12 sz 368640K rsz 1024K crg 24 thr 24 write 87.70 [ 3.66, 5.09] read 109.95 [ 4.60, 4.90]
10.2 Lustre Client 에서의 성능 측정
– iozone
# iozone -i 0 -c -e -w -r 1024k -s 5g -t 1
# iozone -i 0 -c -e -w -r 1024k -s 1g -t 1 -+n -+m client_write
# iozone -i 0 -c -e -w -r 1024k -s 1g -t 1 -b /home/result.xls -+m client_write
# vi client_write
NODE001 /home /usr/bin/iozone
NODE002 /home /usr/bin/iozone
– ior
// 대용량 MPI I/O 성능 테스트
# tar xzvf IOR-2.10.3.tgz
# cd IOR
# make
# cd ..
# cp -a IOR /APP/enhpc
# cd /home // lustre path
# mpirun -np 8 -machinefile ./mpihosts /APP/enhpc/IOR/src/C/IOR -v -F -t 1m -b 500m -o `date +%Y-%m-%d_%H-%M-%S`
——————————————————————————–
IOR-2.10.3: MPI Coordinated Test of Parallel I/O
Run began: Thu Mar 31 19:59:17 2016
Command line used: /APP/enhpc/IOR/src/C/IOR -v -F -t 1m -b 500m -o 2016-03-31_19-59-17
Machine: Linux NODE001
Start time skew across all tasks: 0.01 sec
Path: /home
FS: 5.4 TiB Used FS: 1.8% Inodes: 41.3 Mi Used Inodes: 0.0%
Participating tasks: 8
Summary:
api = POSIX
test filename = 2016-03-31_19-59-17
access = file-per-process
pattern = segmented (1 segment)
ordering in a file = sequential offsets
ordering inter file= no tasks offsets
clients = 8 (4 per node)
repetitions = 1
xfersize = 1 MiB
blocksize = 500 MiB
aggregate filesize = 3.91 GiB
Commencing write performance test.
Thu Mar 31 19:59:17 2016
Commencing read performance test.
Thu Mar 31 19:59:56 2016
Operation Max (MiB) Min (MiB) Mean (MiB) Std Dev Max (OPs) Min (OPs) Mean (OPs) Std Dev Mean (s) Op grep #Tasks tPN reps fPP reord reordoff reordrand seed segcnt blksiz xsize aggsize
——— ——— ——— ———- ——- ——— ——— ———- ——- ——–
write 101.59 101.59 101.59 0.00 101.59 101.59 101.59 0.00 39.37228 8 4 1 1 0 1 0 0 1 524288000 1048576 4194304000 -1 POSIX EXCEL
read 13498.42 13498.42 13498.42 0.00 13498.42 13498.42 13498.42 0.00 0.29633 8 4 1 1 0 1 0 0 1 524288000 1048576 4194304000 -1 POSIX EXCEL
Max Write: 101.59 MiB/sec (106.53 MB/sec)
Max Read: 13498.42 MiB/sec (14154.12 MB/sec)
Run finished: Thu Mar 31 19:59:57 2016
——————————————————————————–
– mdtest
// 대규모 MPI I/O 성능 테스트
# mkdir /APP/enhpc/mdtest
# tar xzvf mdtest-1.9.3.tgz -C /APP/enhpc/mdtest/
# cd /APP/enhpc/mdtest/
# export MPI_CC=mpicc
# make
# mkdir /home/mdtest
#
# mpirun -np 8 -machinefile ./mpihosts /APP/enhpc/mdtest/mdtest -I 10 -i 1 -z 3 -b 3 -d /home/mdtest
——————————————————————————–
— started at 03/31/2016 20:46:51 —
mdtest-1.9.3 was launched with 8 total task(s) on 2 node(s)
Command line used: /APP/enhpc/mdtest/mdtest -I 10 -i 1 -z 3 -b 3 -d /home/mdtest
Path: /home
FS: 5.4 TiB Used FS: 0.1% Inodes: 41.2 Mi Used Inodes: 0.0%
8 tasks, 3200 files/directories
SUMMARY: (of 1 iterations)
Operation Max Min Mean Std Dev
——— — — —- ——-
Directory creation: 10960.674 10960.674 10960.674 0.000
Directory stat : 15549.235 15549.235 15549.235 0.000
Directory removal : 12512.222 12512.222 12512.222 0.000
File creation : 6612.336 6612.336 6612.336 0.000
File stat : 8442.960 8442.960 8442.960 0.000
File read : 6172.210 6172.210 6172.210 0.000
File removal : 10519.191 10519.191 10519.191 0.000
Tree creation : 2541.463 2541.463 2541.463 0.000
Tree removal : 1618.454 1618.454 1618.454 0.000
— finished at 03/31/2016 20:46:54 —
——————————————————————————–
# mpirun -np 8 -machinefile ./mpihosts /APP/enhpc/mdtest/mdtest -I 10 -i 2 -z 5 -b 5 -d /home/mdtest
— started at 03/31/2016 20:47:51 —
mdtest-1.9.3 was launched with 8 total task(s) on 2 node(s)
Command line used: /APP/enhpc/mdtest/mdtest -I 10 -i 2 -z 5 -b 5 -d /home/mdtest
Path: /home
FS: 5.4 TiB Used FS: 0.1% Inodes: 41.2 Mi Used Inodes: 0.0%
8 tasks, 312480 files/directories
SUMMARY: (of 2 iterations)
Operation Max Min Mean Std Dev
——— — — —- ——-
Directory creation: 9914.734 7713.628 8814.181 1100.553
Directory stat : 16537.097 14552.808 15544.952 992.144
Directory removal : 11672.575 9810.903 10741.739 930.836
File creation : 6572.272 4553.086 5562.679 1009.593
File stat : 9076.555 8897.806 8987.180 89.374
File read : 7959.927 7811.317 7885.622 74.305
File removal : 6977.820 6678.429 6828.124 149.696
Tree creation : 3108.665 2539.653 2824.159 284.506
Tree removal : 1780.642 1667.998 1724.320 56.322
— finished at 03/31/2016 20:56:46 —
– ost-survey
// OST 별 성능 측정, 이상 유무 측정
# ost-survey -s 1000 /home
/usr/bin/ost-survey: 03/31/16 OST speed survey on /home from 192.168.201.145@tcp
Number of Active OST devices : 6
Worst Read OST indx: 3 speed: 313.285674
Best Read OST indx: 5 speed: 356.434701
Read Average: 334.458328 +/- 14.227911 MB/s
Worst Write OST indx: 3 speed: 104.469946
Best Write OST indx: 0 speed: 105.953517
Write Average: 105.015114 +/- 0.524597 MB/s
Ost# Read(MB/s) Write(MB/s) Read-time Write-time
—————————————————-
0 326.519 105.954 3.063 9.438
1 335.668 104.976 2.979 9.526
2 327.389 105.401 3.054 9.488
3 313.286 104.470 3.192 9.572
4 347.454 104.800 2.878 9.542
5 356.435 104.489 2.806 9.570
11. Lustre Monitoring Tool 설치
11.1 LMT (Lustre Monitoring Tool) ltop
가장 대표적인 lustre monitoring 툴은 LMT 도구 이다. LMT는 console 기반의 ltop
과 gui 기반의 lwatch 로 나누어지며, lwatch 의 경우 java 기반의 UI를 제공하지만
설치에 투자하는 공수에 비해 품질은 개인적으로 만족스럽진 않다.
여기서는 간단한 설치로 console 기반에서 Lustre 관련 MDS, OSS 현황을 모니터링
할 수 있는 ltop 에 대해 설치하도록 한다.
ltop 을 정상적으로 이용하기 위해서는 cerebro 와 LMT 가 설치되어야 한다.
– cerebor rpm 생성
http://sourceforge.net/projects/cerebro/files/cerebro
# wget –no-check-certificate https://sourceforge.net/projects/cerebro/files/cerebro/1.18-1/cerebro-1.18.tar.gz/download
# tar xzvf cerebro-1.18.tar.gz
# cp cerebro-1.18/cerebro.spec /root/rpmbuild/SPECS/
# cp cerebro-1.18.tar.gz /root/rpmbuild/SOURCES/
# cd rpmbuild/SPECS/
# rpmbuild -ba cerebro.spec
cerebro-1.18-1.x86_64.rpm
cerebro-clusterlist-hostsfile-1.18-1.x86_64.rpm
cerebro-debuginfo-1.18-1.x86_64.rpm
cerebro-event-updown-1.18-1.x86_64.rpm
cerebro-metric-boottime-1.18-1.x86_64.rpm
cerebro-metric-loadavg-1.18-1.x86_64.rpm
cerebro-metric-memory-1.18-1.x86_64.rpm
cerebro-metric-network-1.18-1.x86_64.rpm
– lmt rpm 생성
https://github.com/chaos/lmt
# rpm -ivh cerebro-1.18-1.x86_64.rpm \
cerebro-event-updown-1.18-1.x86_64.rpm \
cerebro-metric-boottime-1.18-1.x86_64.rpm \
cerebro-metric-loadavg-1.18-1.x86_64.rpm \
cerebro-metric-memory-1.18-1.x86_64.rpm \
cerebro-metric-network-1.18-1.x86_64.rpm
# yum install lua lua-devel
# git clone https://github.com/chaos/lmt.git
버전 확인 후 (현재는 3.2.0 버전임)
# mv lmt lmt-3.2.0
# cd lmt-3.2.0
# ./autogen.sh
# vi lmt.spec.in
Name: lmt
Version: 3.2.0
Release: 1
# cp lmt.spec.in /root/rpmbuild/SPECS/lmt.spec
# cd ..
# tar czvfp lmt-3.2.0.tar.gz lmt-3.2.0
# cp lmt-3.2.0.tar.gz /root/rpmbuild/SOURCES/
# rpmbuild/SPECS/
# rpmbuild -ba lmt.spec
lmt-3.2.0-1.x86_64.rpm
lmt-server-3.2.0-1.x86_64.rpm
lmt-server-agent-3.2.0-1.x86_64.rpm
– LMT 설치 방법
ltop 은 Lustre의 MDS 나 OSS 서버가 아닌 별도의 관리서버에서 수행하도록
설계 되어 있다. (GridCenter 관리서버나 HPC master 서버 이용 권장)
– HPC 관리서버에 LMT 패키지 설치
# rpm -ivh cerebro-1.18-1.x86_64.rpm \
cerebro-event-updown-1.18-1.x86_64.rpm \
cerebro-metric-boottime-1.18-1.x86_64.rpm \
cerebro-metric-loadavg-1.18-1.x86_64.rpm \
cerebro-metric-memory-1.18-1.x86_64.rpm \
cerebro-metric-network-1.18-1.x86_64.rpm
# yum install lua lua-devel
# rpm -ivh lmt-server-3.2.0-1.x86_64.rpm
# vi /etc/cerebro.conf
———————————————————-
cerebro_metric_server 192.168.201.26 # -> ltop 모니터링 서버 IP
cerebrod_heartbeat_frequency 10 20
cerebrod_speak on
cerebrod_speak_message_config 192.168.201.26
cerebrod_listen on
cerebrod_listen_message_config 192.168.201.26
cerebrod_metric_controller on
cerebrod_event_server on
cerebro_event_server 192.168.201.26
———————————————————-
# /etc/rc.d/init.d/cerebrod restart
반드시 /usr/sbin/cerebrod 프로세스가 재대로 동작하는지 확인 필요.
간혹 cerebro-clusterlist-hostsfile rpm 이 설치된 경우 /etc/hostsfile 이 없다며
서비스 데몬 restart 가 실패 하는 경우가 있다.
이때는 cerebro-clusterlist-hostsfile rpm 을 제거한 후 cerebrod 를 restart
한다.
# chkconfig –level 345 cerebrod on
– MDS, OSS 서버에 LMT 패키지 설치
# rpm -ivh cerebro-1.18-1.x86_64.rpm \
cerebro-event-updown-1.18-1.x86_64.rpm \
cerebro-metric-boottime-1.18-1.x86_64.rpm \
cerebro-metric-loadavg-1.18-1.x86_64.rpm \
cerebro-metric-memory-1.18-1.x86_64.rpm \
cerebro-metric-network-1.18-1.x86_64.rpm
# yum install lua lua-devel
# rpm -ivh lmt-server-agent-3.2.0-1.x86_64.rpm
# vi /etc/cerebro.conf
———————————————————-
cerebro_metric_server 192.168.201.26
cerebro_event_server 192.168.201.26
cerebrod_heartbeat_frequency 10 20
cerebrod_speak on
cerebrod_speak_message_config 192.168.201.26
cerebrod_listen off
———————————————————-
# /etc/rc.d/init.d/cerebrod restart
# chkconfig –level 345 cerebrod on
– 동작 확인
// 관리서버
# ltop
Filesystem: gcfs
Inodes: 75.851m total, 0.001m used ( 0%), 75.850m free
Space: 5.392t total, 0.004t used ( 0%), 5.388t free
Bytes/s: 0.000g read, 0.000g write, 0 IOPS
MDops/s: 0 open, 0 close, 0 getattr, 0 setattr
0 link, 0 unlink, 0 mkdir, 0 rmdir
0 statfs, 0 rename, 0 getxattr
>OST S OSS Exp CR rMB/s wMB/s IOPS LOCKS LGR LCR %cpu %mem %spc
0000 OSS001 4 0 0 0 0 0 0 45 2 20 0
0001 OSS001 4 0 0 0 0 0 0 46 2 20 0
0002 OSS001 4 0 0 0 0 0 0 1 2 20 0
0003 OSS002 4 0 0 0 0 0 0 0 2 28 0
0004 OSS002 4 0 0 0 0 0 0 1 2 28 0
0005 OSS002 4 0 0 0 0 0 0 0 2 28 0
# cerebro-stat -m cluster_nodes
MDS001
MDS002
OSS001
OSS002
# cerebro-stat -m updown_state
MDS001: 1
MDS002: 1
OSS001: 1
OSS002: 1
# cerebro-stat -l
bytesout
metric_names
boottime
memused
cluster_nodes
rxerrs
lmt_mdt
memtotal
loadavg1
txerrs
packetsin
updown_state
swaptotal
loadavg5
lmt_ost
memfree
swapused
loadavg15
packetsout
bytesin
swapfree
// MDS 서버
# lmtmetric -m mdt
mdt: 2;MDS001;0.633596;13.463325;gcfs-MDT0000;79534117;79535176;114014156;118346856;COMPLETE 2/2 0s remaining;707;0;0;344;0;0;21;0;0;0;0;0;2;0;0;432;0;0;0;0;0;343;0;0;14;0;0;0;0;0;0;0;0;0;0;0;0;0;0;2;0;0;0;0;0;0;0;0;2522;0;0;2888;0;0;0;0;0;0;0;0;0;0;0
// OSS 서버
# lmtmetric -m ost
ost: 2;OSS001;1.838704;20.246390;gcfs-OST0000;14416874;14419328;964028016;964957192;0;451132476;521;4;0;0;45;2;3;COMPLETE 3/3 0s remaining;gcfs-OST0001;14416874;14419328;964416664;964957192;0;113699345;209;4;0;0;46;2;3;COMPLETE 3/3 0s remaining;gcfs-OST0002;14416875;14419328;964265144;964957192;0;208263394;299;4;0;0;1;2;3;COMPLETE 3/3 0s remaining;
// OSS 장애 발생 시
# ltop
Filesystem: gcfs
Inodes: 75.851m total, 0.001m used ( 0%), 75.850m free
Space: 2.696t total, 0.002t used ( 0%), 2.694t free
Bytes/s: 0.000g read, 0.000g write, 0 IOPS
MDops/s: 0 open, 0 close, 0 getattr, 0 setattr
0 link, 0 unlink, 0 mkdir, 0 rmdir
0 statfs, 0 rename, 0 getxattr
>OST S OSS Exp CR rMB/s wMB/s IOPS LOCKS LGR LCR %cpu %mem %spc
0000 data is stale
0001 data is stale
0002 data is stale
0003 OSS002 4 0 0 0 0 0 44 45 1 28 0
0004 OSS002 4 0 0 0 0 0 44 45 1 28 0
0005 OSS002 4 0 0 0 0 0 45 46 1 28 0
# ltop
Filesystem: gcfs
Inodes: 75.851m total, 0.001m used ( 0%), 75.850m free
Space: 4.493t total, 0.003t used ( 0%), 4.490t free
Bytes/s: 0.000g read, 0.000g write, 0 IOPS
MDops/s: 0 open, 0 close, 0 getattr, 0 setattr
0 link, 0 unlink, 0 mkdir, 0 rmdir
0 statfs, 0 rename, 0 getxattr
>OST S OSS Exp CR rMB/s wMB/s IOPS LOCKS LGR LCR %cpu %mem %spc
0000 OSS002 4 0 0 0 0 0 44 45 2 29 0
0001 OSS002 RECOVERING 0 11s remaining
0002 data is stale
0003 OSS002 4 0 0 0 0 0 44 45 2 29 0
0004 OSS002 4 0 0 0 0 0 44 45 2 29 0
0005 OSS002 4 0 0 0 0 0 45 46 2 29 0
11.2 LMT GUI
// Lustre 모니터링 서버에서 실시
# mysql -u root -p < /usr/share/lmt/mkusers.sql
# vi /etc/lmt/lmt.conf
——————————————————-
lmt_cbr_debug = 0
lmt_proto_debug = 0
lmt_db_debug = 0
lmt_db_autoconf = 1
lmt_db_host = “localhost”
lmt_db_port = “3306”
lmt_db_rouser = “lwatchclient”
lmt_db_ropasswd = nil
lmt_db_rwuser = “lwatchadmin”
lmt_db_rwpasswd = “mypass”
——————————————————–
# lmtinit -a gcfs
# lmtinit -l
# /etc/rc.d/init.d/cerebrod restart
# lmtsh -f gcfs
gcfs> t
Available tables for gcfs:
Table Name Row Count
EVENT_DATA 0
EVENT_INFO 0
FILESYSTEM_AGGREGATE_DAY 0
FILESYSTEM_AGGREGATE_HOUR 0
FILESYSTEM_AGGREGATE_MONTH 0
FILESYSTEM_AGGREGATE_WEEK 0
FILESYSTEM_AGGREGATE_YEAR 0
FILESYSTEM_INFO 1
MDS_AGGREGATE_DAY 0
MDS_AGGREGATE_HOUR 0
MDS_AGGREGATE_MONTH 0
MDS_AGGREGATE_WEEK 0
MDS_AGGREGATE_YEAR 0
MDS_DATA 0
MDS_INFO 0
MDS_OPS_DATA 0
MDS_VARIABLE_INFO 7
OPERATION_INFO 81
OSS_DATA 0
OSS_INFO 0
OSS_INTERFACE_DATA 0
OSS_INTERFACE_INFO 0
OSS_VARIABLE_INFO 7
OST_AGGREGATE_DAY 0
OST_AGGREGATE_HOUR 0
OST_AGGREGATE_MONTH 0
OST_AGGREGATE_WEEK 0
OST_AGGREGATE_YEAR 0
OST_DATA 0
OST_INFO 0
OST_OPS_DATA 0
OST_VARIABLE_INFO 11
ROUTER_AGGREGATE_DAY 0
ROUTER_AGGREGATE_HOUR 0
ROUTER_AGGREGATE_MONTH 0
ROUTER_AGGREGATE_WEEK 0
ROUTER_AGGREGATE_YEAR 0
ROUTER_DATA 0
ROUTER_INFO 0
ROUTER_VARIABLE_INFO 4
TIMESTAMP_INFO 0
VERSION 0
# /etc/rc.d/init.d/cerebrod restart
# rpm -ivh lmt-gui-3.0.0-1.el6.x86_64.rpm
# /usr/share/lmt/cron/lmt_agg.cron
lmt-gui 에서 사용하는 모니터링 DB 스카마 및 그동안 축적된 정보를
입력하는 작업, 최초 실행 시 시간이 다소 걸릴 수 있음
# crontab -e
20 * * * * /usr/share/lmt/cron/lmt_agg.cron
# cat .lmtrc
filesys.1.name=gcfs
filesys.1.mountname=/p/gcfs
filesys.1.dbhost=127.0.0.1
filesys.1.dbport=3306
filesys.1.dbuser=lwatchadmin
filesys.1.dbauth=mypass
filesys.1.dbname=filesystem_gcfs
# lwatch
x-gui 형태의 모니터링 툴 뜸.
lstat 는 lwatch gui 에서 표시되는 모니터링 정보를 console cmd 화면에서
살펴 보고자 할대 사용되는 명령
# lstat -m
——- 2016-04-26 18:01:10 ——-
[MDS Name] [%CPU Used] [%Space Used] [%Inode Used]
gcfs-MDT0000 2.13 3.73 0.06
[Operation] [Samples] [Samples/sec] [Avg Value] [Std Dev] [Units]
close 193 38.60 0.00 0.00 reqs
connect 0 0.00 **** **** reqs
create 0 0.00 **** **** reqs
destroy 0 0.00 **** **** reqs
disconnect 0 0.00 **** **** reqs
getattr 1103 220.60 0.00 0.00 reqs
getxattr 170 34.00 0.00 0.00 reqs
link 0 0.00 **** **** reqs
llog_init 0 0.00 **** **** reqs
mkdir 147 29.40 0.00 0.00 reqs
mknod 1 0.20 0.00 **** reqs
notify 0 0.00 **** **** reqs
open 239 47.80 0.00 0.00 reqs
process_config 0 0.00 **** **** reqs
quotactl 0 0.00 **** **** reqs
reconnect 0 0.00 **** **** reqs
rename 0 0.00 **** **** reqs
rmdir 0 0.00 **** **** reqs
setattr 327 65.40 0.00 0.00 reqs
statfs 0 0.00 **** **** reqs
unlink 0 0.00 **** **** reqs
# lstat -o
——- 2016-04-26 17:59:55 ——-
[OST Name] [Read MB/s] [Write MB/s]
gcfs-OST0000 36.54 0.00
gcfs-OST0001 7.60 4.40
gcfs-OST0002 0.00 36.40
gcfs-OST0003 0.00 25.20
gcfs-OST0004 24.00 11.40
gcfs-OST0005 20.60 0.00
———- ———- ———-
[Min] 0.00 0.00
[Max] 36.54 36.40
[Average] 14.79 12.90
[Aggregate] 88.74 77.40
# lstat -x
——- 2016-04-26 18:03:15 ——-
[OST Name] [Read MB/s] [Write MB/s] [%CPU Used] [%Space Used] [%Inodes Used]
gcfs-OST0000 0.00 0.04 **** 2.57 0.08
gcfs-OST0001 0.00 29.16 **** 2.40 0.08
gcfs-OST0002 28.00 0.09 **** 2.89 0.08
gcfs-OST0003 0.40 0.00 **** 2.74 0.08
gcfs-OST0004 0.00 0.00 **** 2.50 0.08
gcfs-OST0005 23.60 30.70 **** 2.60 0.08
———- ———- ———- ———- ———- ———-
[Min] 0.00 0.00 **** 2.40 0.08
[Max] 28.00 30.70 **** 2.89 0.08
[Average] 8.67 10.00 0.00 2.62 0.08
[Aggregate] 52.00 60.00
http://lmt.googlecode.com/svn-history/r318/wiki/Installation.wiki
/// GridCenter 관리서버에 LMT 설치 시..
# vi /etc/my.cnf
[client]
socket=/engrid/endb/etc/endb.sock
port=3307
# vi /etc/lmt/lmt.conf
lmt_cbr_debug = 0
lmt_proto_debug = 0
lmt_db_debug = 0
lmt_db_autoconf = 1
lmt_db_host = “127.0.0.1”
lmt_db_port = “3307”
lmt_db_rouser = “lwatchclient”
lmt_db_ropasswd = nil
lmt_db_rwuser = “lwatchadmin”
lmt_db_rwpasswd = “mypass”
# cd /root
# vi .lmtrc
filesys.1.name=gcfs
filesys.1.mountname=/p/gcfs
filesys.1.dbhost=127.0.0.1
filesys.1.dbport=3307
filesys.1.dbuser=lwatchadmin
filesys.1.dbauth=mypass
filesys.1.dbname=filesystem_gcfs
# cd ~clunix
# vi .lmtrc
filesys.1.name=gcfs
filesys.1.mountname=/p/gcfs
filesys.1.dbhost=127.0.0.1
filesys.1.dbport=3307
filesys.1.dbuser=lwatchadmin
filesys.1.dbauth=mypass
filesys.1.dbname=filesystem_gcfs
11.2 “lctl get_param” 정보 확인
– MDS
# lctl get_param mdt.*MDT*.num_exports
mdt.gcfs-MDT0000.num_exports=10
# lctl get_param mdt.*.md_stats
mdt.gcfs-MDT0000.md_stats=
snapshot_time 1460021605.590841 secs.usecs
open 3863 samples [reqs]
close 3826 samples [reqs]
mkdir 76 samples [reqs]
getattr 5754 samples [reqs]
setattr 751 samples [reqs]
setxattr 706 samples [reqs]
statfs 6 samples [reqs]
# lctl get_param osd-*.*MDT*.filesfree
osd-ldiskfs.gcfs-MDT0000.filesfree=79533483
# lctl get_param osd-*.*MDT*.kbytesfree
osd-ldiskfs.gcfs-MDT0000.kbytesfree=114013864
# lctl get_param mdt.*MDT*.exports.*@*.stats
mdt.gcfs-MDT0000.exports.0@lo.stats=
snapshot_time 1460021810.103190 secs.usecs
mdt.gcfs-MDT0000.exports.192.168.201.143@tcp.stats=
snapshot_time 1460021810.103230 secs.usecs
mdt.gcfs-MDT0000.exports.192.168.201.144@tcp.stats=
snapshot_time 1460021810.103254 secs.usecs
mdt.gcfs-MDT0000.exports.192.168.201.145@tcp.stats=
snapshot_time 1460021810.103277 secs.usecs
open 2018 samples [reqs]
close 1998 samples [reqs]
mkdir 21 samples [reqs]
getattr 3348 samples [reqs]
setattr 233 samples [reqs]
setxattr 188 samples [reqs]
statfs 2 samples [reqs]
mdt.gcfs-MDT0000.exports.192.168.201.146@tcp.stats=
snapshot_time 1460021810.103310 secs.usecs
open 1845 samples [reqs]
close 1828 samples [reqs]
mkdir 55 samples [reqs]
getattr 2406 samples [reqs]
setattr 518 samples [reqs]
setxattr 518 samples [reqs]
statfs 4 samples [reqs]
– OSS
# lctl get_param osd-ldiskfs.*OST*.kbytesavail
osd-ldiskfs.gcfs-OST0000.kbytesavail=914997264
osd-ldiskfs.gcfs-OST0001.kbytesavail=915438904
osd-ldiskfs.gcfs-OST0002.kbytesavail=915175532
# lctl get_param obdfilter.*.stats
obdfilter.gcfs-OST0000.stats=
snapshot_time 1460021662.331836 secs.usecs
read_bytes 1582 samples [bytes] 4096 1048576 1352171520
write_bytes 291 samples [bytes] 29 1048576 224582832
setattr 213 samples [reqs]
create 6 samples [reqs]
statfs 16916 samples [reqs]
reconnect 3 samples [reqs]
statfs 67432 samples [reqs]
preprw 1873 samples [reqs]
commitrw 1873 samples [reqs]
ping 6741 samples [reqs]
# lctl get_param obdfilter.*.recovery_status
# lctl get_param obdfilter.*OST*.exports.*@*.stats
# lctl get_param obdfilter.*OST*.kbytesfree
obdfilter.gcfs-OST0000.kbytesfree=963808476
obdfilter.gcfs-OST0001.kbytesfree=964250116
obdfilter.gcfs-OST0002.kbytesfree=963986744
# lctl get_param ldlm.namespaces.filter-*.pool.stats
.
ldlm.namespaces.filter-gcfs-OST0002_UUID.pool.stats=
snapshot_time 1460021986.247869 secs.usecs
granted 5675 samples [locks] 1 634 1448238 590969130
grant 1201 samples [locks] 1 1 1201 1201
cancel 635 samples [locks] 1 1 635 635
grant_rate 5675 samples [locks/s] 0 143 1201 90297
cancel_rate 5675 samples [locks/s] 0 127 635 35857
grant_plan 5675 samples [locks/s] 1280 115125 8804469 26783422227
slv 5675 samples [slv] 4604976000 13815000000 26151658848000 3634588139761328128
recalc_freed 7507 samples [locks] 0 0 0 0
recalc_timing 5675 samples [sec] 1 45303 84870 3200696290
# lctl get_param ldlm.namespaces.filter-*.lock_count
ldlm.namespaces.filter-gcfs-OST0000_UUID.lock_count=558
ldlm.namespaces.filter-gcfs-OST0001_UUID.lock_count=553
ldlm.namespaces.filter-gcfs-OST0002_UUID.lock_count=566
# lctl get_param ldlm.namespaces.filter-*.pool.granted
ldlm.namespaces.filter-gcfs-OST0000_UUID.pool.granted=558
ldlm.namespaces.filter-gcfs-OST0001_UUID.pool.granted=553
ldlm.namespaces.filter-gcfs-OST0002_UUID.pool.granted=566
# lctl get_param ldlm.namespaces.filter-*.pool.grant_rate
ldlm.namespaces.filter-gcfs-OST0000_UUID.pool.grant_rate=0
ldlm.namespaces.filter-gcfs-OST0001_UUID.pool.grant_rate=0
ldlm.namespaces.filter-gcfs-OST0002_UUID.pool.grant_rate=0
11.3 collectl 을 이용한 모니터링
주로 OSS 서버와 Client 에서 사용 가능
# wget https://sourceforge.net/projects/collectl/files/latest/download?source=files –no-check-certificate
# tar xzvf collectl-4.0.4.src.tar.gz
# cd collectl-4.0.4
# sh INSTALL
** 5초동안 CPU/Disk/Network 부문을 기본적으로 모니터링 합니다.
collectl -c 5
** Lustre Client 에서의 상세 IO 상황..
collectl -c 5 -sL
** 시간을 포함한 결과 모니터링
collectl -c 5 -sL -oT
** Client 입장에서 IO 가 발생을 할때에, 어떠한 OST 에 데이터를 읽고 저장 하는지를 볼수 있다.
collectl -c 3 -sL –lustopts O -oTm
** Lustre 의 Readahead 에 대한 모든 속성을 볼 수 있습니다.
collectl -c 5 -sL –lustopts R -oD
** OSS서버에서 각 OST별 IO 모니터링
collectl -c 3 -sL -oD
** top 형태로 보고 싶을때는 –top 옵션 추가
** 기타 자원 모니터링
– cpu
collectl -scj
– disk
collectl -sD
collectl -sD –dskfilt sd
– IB
collectl -sx –showheader
12. Windows Client 연결 하기
LustreFS 는 Windows 전용 native client 가 없기 때문에 windows client에서 lustreFS 에 연결
하기 위해서는 Linux lustre client 에 해당하는 CIFS(Samba) 중계 서버가 필요하다.
대신 1대의 samba 서버로 서비스를 할 경우 I/O 집중으로 병목이 발생할 수 있고,
해당 서버가 Down 시 서비스가 정지될 수도 있다.
이런 문제를 해결하기 위해 CTDB 를 이용하여 parallel Samba 서비스를 구성한다.
우선 Linux Lustre Client Node 에 samba 와 ctdb 를 설치한다.
(samba version 은 3, 4 모두 가능)
# yum install samba samba-client samba-winbind samba-winbind-cleint
# yum install ctdb
LustreFS 가 /home 에 Mount 되어 있다고 가정할때 ..
아래와 같이 기본 smb.conf 를 수정 ..
# vi /etc/samba/smb.conf
[global]
follow symlinks = yes
wide links = yes
unix extensions = no
clustering = yes
idmap backend = tdb2
private dir = /home/
ctdb 를 이용할 경우 smb 서비스를 ctdb에서 제어해야 한다. 서버 시작 시 자동으로
samba 가 시작되면 안된다.
# chkconfig smb off
# vi /etc/sysconfig/ctdb
CTDB_RECOVERY_LOCK=/home/.CTDB-lockfile
CTDB_NODES=/etc/ctdb/nodes
CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
CTDB_MANAGES_SAMBA=yes
CTDB_LOGFILE=/var/log/log.ctdb
아래는 실제 Lustre CIFS 서비스를 위해 계획된 VIP 를 정의한다.
아래 경우는 2대의 samba 서버를 Clustering 하는 것임.
(실제 서버에 할당된 IP가 아님..주의 요망)
# vi /etc/ctdb/public_addresses
192.168.201.148/24 eth0
192.168.201.149/24 eth0
아래 nodes 설정이 실제 samba 서버에 할당된 static IP 임.
# vi /etc/ctdb/nodes
192.168.201.51
192.168.201.52
# /etc/rc.d/init.d/ctdb start
# chkconfig ctdb on
// ctdb 서비스 상태 및 구성 확인
# ctdb status
Number of nodes:2
pnn:0 192.168.201.51 OK (THIS NODE)
pnn:1 192.168.201.52 OK
Generation:1102699247
Size:2
hash:0 lmaster:0
hash:1 lmaster:1
Recovery mode:NORMAL (0)
Recovery master:1
// CTDB 서비스 IP 확인
# ctdb ip
Public IPs on node 0
192.168.201.148 1
192.168.201.149 0
// CTDB 통신 확인
# ctdb ping -n all
response from 0 time=0.000028 sec (4 clients)
response from 1 time=0.000394 sec (3 clients)
이것으로 samba cluster 자체 설정을 완료된다.
마지막으로 여러대의 Windows Client 가 동시 접속 시 2대의 samba 서버로
load balance 시키기 위해서 DNS round-robin 설정이 필요하다.
별도의 Windows Client PC를 관리하는 별도의 AD 서버가 있는 경우에는
해당 AD 서버에 DNS 설정을 하면 되고, 없을 경우에는 RNTier 관리서버에
설정하고 Client PC의 DNS Client 설정을 RNTier 관리서버로 지정해 두면
된다.
서비스 도메인의 zone 파일에 아래 내용 추가
; SAMBA VIPs
gcfs 1 IN A 192.168.201.148
gcfs 1 IN A 192.168.201.149
예를 들어 기본 서비스 domain 이 rntier.clx 일 경우 ..
gcfs.rntier.clx 로 접속을 하면 148~149 ip 가 번갈아 가면서 제공된다.
윈도우 AD 서버에 DNS 설정 방법은 OneNote 참고 ..
Windows Client 에서 net use z: \\gcfs.rntierdemo.clx\homes 식으로 연결하면 된다.
접속된 samba 서버가 다운 시 자동으로 다른 samba 서버로 접속이 이루어진다.
/// IB config
vi /usr/modprobe.d/lustre.conf
options lnet networks=”o2ib0(ib0)”
options ko2iblnd peer_credits=128 peer_credits_hiw=64
vi /etc/modprobe.d/ko2iblnd.conf
// zfs
zpool create -f gcfs-mdt /dev/sdb
zpool create -f gcfs-ost1 /dev/sdc
zpool create -f gcfs-ost2 /dev/sdd
zpool create -f gcfs-ost3 /dev/sde
mkfs.lustre –reformat –fsname=gcfs –mgs –mdt –index=0 –servicenode=master01-ib@o2ib:master01@tcp –mgsnode=master01-ib@o2ib:master01@tcp –backfstype=zfs gcfs-mdt/sdb
mkfs.lustre –reformat –fsname=gcfs –ost –index=1 –servicenode=master01-ib@o2ib:master01@tcp –mgsnode=master01-ib@o2ib:master01@tcp –backfstype=zfs gcfs-ost1/sdc
mkfs.lustre –reformat –fsname=gcfs –ost –index=2 –servicenode=master01-ib@o2ib:master01@tcp –mgsnode=master01-ib@o2ib:master01@tcp –backfstype=zfs gcfs-ost2/sdd
mkfs.lustre –reformat –fsname=gcfs –ost –index=3 –servicenode=master01-ib@o2ib:master01@tcp –mgsnode=master01-ib@o2ib:master01@tcp –backfstype=zfs gcfs-ost3/sde
ldev.conf
master01 master01 gcfs-MDT0000 zfs:gcfs-mdt/sdb
master01 master01 gcfs-OST0001 zfs:gcfs-ost1/sdc
master01 master01 gcfs-OST0002 zfs:gcfs-ost2/sdd
master01 master01 gcfs-OST0003 zfs:gcfs-ost3/sde