本家様 http://lustre.org/
wiki http://wiki.lustre.org/index.php/Main_Page
参照先 https://wiki.whamcloud.com/ https://gist.github.com/dleske/743f9dafc212b7bb0edce370e961b99e
https://github.com/whamcloud/Online-Help
スパコン界隈で利用されているファイルシステム. 「Distributed file systems」
ストレージを持ったノードがクラスターを形成して、データを分散させて保持させている.
構成的にはBeeGFSに似ている.
Lustreの導入例を見てみると冗長構成で落ちにくくして、冗長構成なのでsataではなくsas(NL-sas)のdual-port機構が必須.
加えてHDD10個で一組の30組、60組で構成されている. 10組なら100個のHDDが必要でNL-sasなら?14TB NL-sasが9万としても...1.12PB/900万
ここでは冗長構成とかは作らず、構築の流れを描く. 使うのは version 2.12.4 です.
http://wiki.lustre.org/Introduction_to_Lustreを拝読すると
要素としては
ここでは簡単に
種別 | マシン名 | IP | ストレージ | 備考 |
Management server | MGS | 192.168.0.47 | 4GB(OS) 1GB(MGT) | MGSの機能をMDSが兼ねても構わないみたい |
Metadata Server | MDS | 192.168.0.48 | 4GB(OS) 16GB(MDT.1)+16GB(MDT.2) | 小さいファイルは「Data on MDT」でここに格納されるみたい |
Object Storage Server | SS1 | 192.168.0.49 | 4GB(OS) 32GB(OST) | ファイルは分割されて各OSTに格納される |
SS2 | 192.168.0.50 | 4GB(os)+16GB(OST) | ||
Client | client | 192.168.0.18 |
ソースコードが提供されているのでコンパイルしてインストールでもいいのだが、yumで簡単調理ができるようなのでそちらを使う.
だがインストールするパッケージには組み合わせがあるようで
ここでは LDISKFS を使ってOS提供のkernelをそのまま使うことにします.
それに対応したリポジトリを下記のように書く.
[root@ms ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core) <-- CentOS7.8で構築してます.
[root@ms ~]# cat /etc/yum.repos.d/lustre.repo
[lustre-server]
name=CentOS-$releasever - Lustre
baseurl=https://downloads.whamcloud.com/public/lustre/latest-release/el7/patchless-ldiskfs-server/
gpgcheck=0
[e2fsprogs]
name=CentOS-$releasever - Ldiskfs
baseurl=https://downloads.whamcloud.com/public/e2fsprogs/latest/el7/
gpgcheck=0
[lustre-client]
name=CentOS-$releasever - Lustre
baseurl=https://downloads.whamcloud.com/public/lustre/latest-release/el7/client
gpgcheck=0
[root@ms ~]#
*「latest-release」は 2.12.X な Long Term Support (LTS) 系のディレクトリです. ここを「latest-feature-release」とすると 2.13.x 系になります(2020.06)
*パッチが適用されたkernelで行うのなら「lustre-server」のbaseurlで「/patchless-ldiskfs-server/」を「/server/」にすると対応カーネルもyumで差し替え可能になる
*lustre-2.12.4はe2fsprogs-v1.45.2が必要なのだが、パッケージ名は e2fsprogs-1.45.2.wc1 と「wc」が付く. この「wc」は何を意図しているかが不明...
まずは e2fsprogs(Utilities for managing ext2, ext3, and ext4 filesystems) を差し替える
[root@ms ~]# yum list installed |grep e2fsprogs
e2fsprogs.x86_64 1.42.9-17.el7 @base
e2fsprogs-libs.x86_64 1.42.9-17.el7 @base
[root@ms ~]# yum upgrade e2fsprogs
ここで残念なお話. lustreのパッケージは CentOS7.7(kernel-3.10.0-1062.9.1)向きで、現在稼働しているCentOS7.8(kernel-3.10.0-1127.10.1)である.
*lusterのrpmがどのkernelで作られているかは lustre の Changelog で確認できる. http://wiki.lustre.org/Lustre_2.12.4_Changelog
そのためlustreパッケージをインストールしても稼働するkernelが違うので動かない.
対策としては、
のいずれかになる.
ダウングレードする. CentOSの過去カーネルは「vault.centos.org」で得られる. CentOS7.7の「kernel-3.10.0-1062.9.1」をインストールして、それが次回の起動に使われるように設定を施す.
参照: grub#v64aca0c
[root@ms ~]# yum install http://vault.centos.org/7.7.1908/updates/x86_64/Packages/kernel-3.10.0-1062.9.1.el7.x86_64.rpm
[root@ms ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core) <-- 次回起動時に使用されるkernel
[root@ms ~]# reboot
あくまでも最新カーネルで進めたいのなら. 現行のCentOS7.8(kernel-3.10.0-1127.10.1)のカーネルソースを取得してlustreのパッチを充ててカーネル再構築する必要がある. yumで簡単に、、とはならないのでここでは扱わない
dkmsで回避可能と思ってたが、カーネルソースコード(patch適用済みのext4コード)らが必要なようで取りやめた
[root@ms ~]# uname -r
3.10.0-1062.9.1.el7.x86_64
[root@ms ~]# yum install lustre
[root@ms ~]# yum list installed |grep lustre-server
kmod-lustre.x86_64 2.12.4-1.el7 @lustre-server
kmod-lustre-osd-ldiskfs.x86_64 2.12.4-1.el7 @lustre-server
lustre.x86_64 2.12.4-1.el7 @lustre-server
lustre-osd-ldiskfs-mount.x86_64 2.12.4-1.el7 @lustre-server
[root@ms ~]#
YAMLフォーマットで /etc/lnet.conf を描く. 詳細はこちらで http://wiki.lustre.org/Dynamic_LNet_Configuration_and_lnetctl
[root@ms ~]# cat /etc/lnet.conf
net:
- net type: tcp
local NI(s):
- nid: 192.168.0.47@tcp <-- nic ipaddress
status: up
interfaces:
0: ens32 <-- nicのデバイス名
[root@ms ~]# systemctl enable lnet && systemctl start lnet
(確認)
[root@ms ~]# lnetctl net show
net:
- net type: lo
local NI(s):
- nid: 0@lo
status: up
- net type: tcp
local NI(s):
- nid: 192.168.0.47@tcp
status: up
interfaces:
0: ens32
[root@ms ~]#
firewallが有効であるなら 988 tcp を開ける必要がある
[root@ms ~]# firewall-cmd --zone=public --add-port=988/tcp --permanent
[root@ms ~]# firewall-cmd --reload
*SELinuxは無効にする. lustre自体がまだ未対応のため http://wiki.lustre.org/Operating_System_Configuration_Guidelines_For_Lustre#SELinux_and_Firewall_Configuration
MGS向けのディスクを用意する. MGTなので100MBほどでいいようで、MDTに組み込まれてもいいみたい.
[root@ms ~]# cat /proc/partitions
major minor #blocks name
2 0 4 fd0
8 0 4194304 sda
8 1 524288 sda1
8 2 524288 sda2
8 3 3144704 sda3
8 16 1048576 sdb
11 0 4554752 sr0
[root@ms ~]# mkfs.lustre --fsname=fsname --mgs /dev/sdb
Permanent disk data:
Target: MGS
Index: unassigned
Lustre FS: fsname
Mount type: ldiskfs
Flags: 0x64
(MGS first_time update )
Persistent mount opts: user_xattr,errors=remount-ro
Parameters:
checking for existing Lustre data: not found
device size = 1024MB
formatting backing filesystem ldiskfs on /dev/sdb
target name MGS
kilobytes 1048576
options -q -O uninit_bg,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F
mkfs_cmd = mke2fs -j -b 4096 -L MGS -q -O uninit_bg,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F /dev/sdb 1048576k
Writing CONFIGS/mountdata
[root@ms ~]# mkdir /mgt
[root@ms ~]# mount -t lustre /dev/sdb /mgt/
[root@ms ~]# df -lTh
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 909M 0 909M 0% /dev
tmpfs tmpfs 920M 0 920M 0% /dev/shm
tmpfs tmpfs 920M 8.8M 911M 1% /run
tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup
/dev/sda3 xfs 3.0G 1.6G 1.5G 52% /
/dev/sda1 xfs 509M 212M 298M 42% /boot
tmpfs tmpfs 184M 0 184M 0% /run/user/0
/dev/sdb lustre 968M 2.3M 915M 1% /mgt
[root@ms ~]#
[root@ms ~]# ls -l /mgt/
ls: cannot access /mgt/: Not a directory
[root@ms ~]#
MDTは2つ用意してみた. 具体的にどのくらいサイズが必要なのかは マニュアル を参照してください
[root@mds ~]# cat /proc/partitions
major minor #blocks name
2 0 4 fd0
8 0 4194304 sda
8 1 524288 sda1
8 2 524288 sda2
8 3 3144704 sda3
8 16 16777216 sdb
8 32 16777216 sdc
11 0 4554752 sr0
[root@mds ~]# mkfs.lustre --fsname=fsname --mgsnode ms --mdt --index=0 /dev/sdb
Permanent disk data:
Target: fsname:MDT0000
Index: 0
Lustre FS: fsname
Mount type: ldiskfs
Flags: 0x61
(MDT first_time update )
Persistent mount opts: user_xattr,errors=remount-ro
Parameters: mgsnode=192.168.0.47@tcp
checking for existing Lustre data: not found
device size = 16384MB
formatting backing filesystem ldiskfs on /dev/sdb
target name fsname:MDT0000
kilobytes 16777216
options -J size=655 -I 1024 -i 2560 -q -O dirdata,uninit_bg,^extents,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F
mkfs_cmd = mke2fs -j -b 4096 -L fsname:MDT0000 -J size=655 -I 1024 -i 2560 -q -O dirdata,uninit_bg,^extents,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F /dev/sdb 16777216k
Writing CONFIGS/mountdata
[root@mds ~]# mkfs.lustre --fsname=fsname --mgsnode ms --mdt --index=1 /dev/sdc
Permanent disk data:
Target: fsname:MDT0001
Index: 1
Lustre FS: fsname
Mount type: ldiskfs
Flags: 0x61
(MDT first_time update )
Persistent mount opts: user_xattr,errors=remount-ro
Parameters: mgsnode=192.168.0.47@tcp
checking for existing Lustre data: not found
device size = 16384MB
formatting backing filesystem ldiskfs on /dev/sdc
target name fsname:MDT0001
kilobytes 16777216
options -J size=655 -I 1024 -i 2560 -q -O dirdata,uninit_bg,^extents,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F
mkfs_cmd = mke2fs -j -b 4096 -L fsname:MDT0001 -J size=655 -I 1024 -i 2560 -q -O dirdata,uninit_bg,^extents,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F /dev/sdc 16777216k
Writing CONFIGS/mountdata
[root@mds ~]# mkdir /mdt.0 /mdt.1
[root@mds ~]# mount -t lustre /dev/sdb /mdt.0
[root@mds ~]# mount -t lustre /dev/sdc /mdt.1
備考: RHEL6のext4最大1ボリュームは16TB. RHEL7では50TB. lustreのLDISKFS(ext4)は50TBhttp://wiki.lustre.org/Introduction_to_Lustre_Object_Storage_Devices_(OSDs)
[root@ss1 ~]# mkfs.lustre --fsname=fsname --mgsnode=ms@tcp0 --ost --index=0 /dev/sdb
Permanent disk data:
Target: fsname:OST0000
Index: 0
Lustre FS: fsname
Mount type: ldiskfs
Flags: 0x62
(OST first_time update )
Persistent mount opts: ,errors=remount-ro
Parameters: mgsnode=192.168.0.47@tcp
checking for existing Lustre data: not found
device size = 32768MB
formatting backing filesystem ldiskfs on /dev/sdb
target name fsname:OST0000
kilobytes 33554432
options -J size=400 -I 512 -i 69905 -q -O extents,uninit_bg,dir_nlink,quota,huge_file,flex_bg -G 256 -E resize="4290772992",lazy_journal_init -F
mkfs_cmd = mke2fs -j -b 4096 -L fsname:OST0000 -J size=400 -I 512 -i 69905 -q -O extents,uninit_bg,dir_nlink,quota,huge_file,flex_bg -G 256 -E resize="4290772992",lazy_journal_init -F /dev/sdb 33554432k
Writing CONFIGS/mountdata
[root@ss1 ~]# mkdir /ost.0
[root@ss1 ~]# mount -t lustre /dev/sdb /ost.0/
[root@client ~]# yum upgrade e2fsprogs
[root@client ~]# yum install lustre-client
[root@client ~]# yum list installed |grep lustre-client
kmod-lustre-client.x86_64 2.12.4-1.el7 @lustre-client
lustre-client.x86_64 2.12.4-1.el7 @lustre-client
[root@client ~]#
clinetもlnetを設定します
[root@client ~]# cat /etc/lnet.conf
net:
- net type: tcp
local NI(s):
- nid: 192.168.0.18@tcp
status: up
interfaces:
0: eth0
[root@client ~]# systemctl enable lnet && systemctl start lnet
そしてlustreをmountしてみます.
[root@client ~]# mount -t lustre ms@tcp0:/fsname /lustre
[root@client ~]# df -Th /lustre
Filesystem Type Size Used Avail Use% Mounted on
192.168.0.47@tcp:/fsname lustre 32G 50M 30G 1% /lustre
[root@client ~]# lfs df -h
UUID bytes Used Available Use% Mounted on
fsname-MDT0000_UUID 8.9G 46.2M 8.0G 1% /lustre[MDT:0]
fsname-MDT0001_UUID 8.9G 46.1M 8.0G 1% /lustre[MDT:1]
fsname-OST0000_UUID 31.1G 49.2M 29.5G 1% /lustre[OST:0]
filesystem_summary: 31.1G 49.2M 29.5G 1% /lustre
[root@client ~]#
一応、lustreをクライアントにmountできた.
Lustreイコール DDN社様 なので実際の導入事例がたくさん掲載されている.
ManagementとMetaサーバを2台一組のHAで運用してOSSは筐体1台(内部2システム)でVM4台(2台1組のHA)で、OSTは90本エンクロージャをデイジーチェーンではなく直接OSTと接続な感じ.
OSSはHDD10本1組で1VMあたり10組以上繋げている.
OSSを増やすより1台のOSSに多数のOSTをぶら下げるのが想定みたい.
あとHPE社様では
2台のDL360に共有ドライブMSA2050を繋げ、おそらくManagementとMetaサーバの機能を担わせ、OSSとして2台のDL380にD6020を繋げている.
D6020なので70本のHDDを抱えられる.
Dell EMC社様は詳細な構成と数値も出している.