#author("2020-06-15T15:40:51+00:00","default:sysosa","sysosa")
#author("2020-06-15T15:59:32+00:00","default:sysosa","sysosa")
本家様 [[http://lustre.org/>+http://lustre.org/]]
wiki [[http://wiki.lustre.org/index.php/Main_Page>+http://wiki.lustre.org/index.php/Main_Page]]
参照先 [[https://wiki.whamcloud.com/>+https://wiki.whamcloud.com/]] [[https://gist.github.com/dleske/743f9dafc212b7bb0edce370e961b99e>+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組で構成されている. &size(10){10組なら100個のHDDが必要でNL-sasなら?14TB NL-sasが9万としても...1.12PB/900万};


ここでは冗長構成とかは作らず、構築の流れを描く. 使うのは version 2.12.4 です.

***構成 [#y8bdb281]
[[http://wiki.lustre.org/Introduction_to_Lustre>+http://wiki.lustre.org/Introduction_to_Lustre]]を拝読すると
要素としては
-Management Server (MGS)とそのデータを収める「Management Target (MGT)」
1つで十分らしい. MGTは1GBで十分.
-Metadata Server (MDS)とそのデータを収める「Metadata Targets (MDT)」
16core/256GB mem,RAID1+0
-Object Storage Server (OSS)とそのデータを収める「object storage targets (OST)」
OSS一台当たり2から8個のOST(それ以上も可). 1個のOSTは10個のHDDでRAID6 or zfs-RAIDZ2として提供.
-Lustre Networking (LNet)
port988/tcpを使用. RDMA通信可. カーネルモジュールを組み込む必要あり.
-Clients
POSIX標準でLustreを利用できる

ここでは簡単に
|BGCOLOR(YELLOW):種別|BGCOLOR(YELLOW):マシン名|BGCOLOR(YELLOW):IP|BGCOLOR(YELLOW):ストレージ|BGCOLOR(YELLOW):備考|
|Management server|MGS|192.168.0.47|4GB(OS)&br;1GB(MGT)|MGSの機能をMDSが兼ねても構わないみたい|
|Metadata Server|MDS|192.168.0.48|4GB(OS)&br;16GB(MDT.1)+16GB(MDT.2)|小さいファイルは「Data on MDT」でここに格納されるみたい|
|Object Storage Server|SS1|192.168.0.49|4GB(OS)&br;32GB(OST)|ファイルは分割されて各OSTに格納される|
|~|SS2|192.168.0.50|4GB(os)+16GB(OST)|~|
|Client|client|192.168.0.18|||

***yum リポジトリ [#oda348d4]
ソースコードが提供されているのでコンパイルしてインストールでもいいのだが、yumで簡単調理ができるようなのでそちらを使う.
だがインストールするパッケージには組み合わせがあるようで
-OSTのフォーマットとして LDISKFS(ext4系) を使うか ZFS を使うか
-lustre対応のpatchが入った kernelに差し替えるか そのままCentOS提供のkernelを使うか
&size(10){OS提供のkernelのままだとプロジェクトクォータが使えないみたい};

ここでは LDISKFS を使ってOS提供のkernelをそのまま使うことにします.
それに対応したリポジトリを下記のように書く.
#code(nonumber){{
[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 ~]#
}}
&color(red){*};&size(10){「latest-release」は 2.12.X な Long Term Support (LTS) 系のディレクトリです. ここを「latest-feature-release」とすると 2.13.x 系になります(2020.06)};
&color(red){*};&size(10){パッチが適用されたkernelで行うのなら「lustre-server」のbaseurlで「/patchless-ldiskfs-server/」を「/server/」にすると対応カーネルもyumで差し替え可能になる};
&color(red){*};&size(10){lustre-2.12.4はe2fsprogs-v1.45.2が必要なのだが、パッケージ名は e2fsprogs-1.45.2.wc1 と「wc」が付く. この「wc」は何を意図しているかが不明...};

[[Lustre/repository]]

***インストール [#y72cd180]
まずは e2fsprogs(Utilities for managing ext2, ext3, and ext4 filesystems) を差し替える
#code(nonumber){{
[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)である.
&color(red){*};&size(10){lusterのrpmがどのkernelで作られているかは lustre の Changelog で確認できる. [[http://wiki.lustre.org/Lustre_2.12.4_Changelog>+http://wiki.lustre.org/Lustre_2.12.4_Changelog]]};
そのためlustreパッケージをインストールしても稼働するkernelが違うので動かない.
対策としては、
-カーネルをダウングレードして「3.10.0-1062.9.1」にしてlustreをインストール
-「3.10.0-1127.10.1」向けのlustreカーネルモジュールをコンパイルして作る

のいずれかになる.

ダウングレードする. CentOSの過去カーネルは「vault.centos.org」で得られる. CentOS7.7の「kernel-3.10.0-1062.9.1」をインストールして、それが次回の起動に使われるように設定を施す.
&size(10){参照: [[grub#v64aca0c]]};
#code(nonumber){{
[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で簡単に、、とはならないのでここでは扱わない
&size(10){dkmsで回避可能と思ってたが、カーネルソースコード(patch適用済みのext4コード)らが必要なようで取りやめた};

#code(nonumber){{
[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 ~]#
}}


***lnet [#va4ee000]
YAMLフォーマットで /etc/lnet.conf を描く. 詳細はこちらで [[http://wiki.lustre.org/Dynamic_LNet_Configuration_and_lnetctl>+http://wiki.lustre.org/Dynamic_LNet_Configuration_and_lnetctl]]
#code(nonumber){{
[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 を開ける必要がある
#code(nonumber){{
[root@ms ~]# firewall-cmd --zone=public --add-port=988/tcp --permanent
[root@ms ~]# firewall-cmd --reload
}}
&color(red){*};&size(10){SELinuxは無効にする. lustre自体がまだ未対応のため [[http://wiki.lustre.org/Operating_System_Configuration_Guidelines_For_Lustre#SELinux_and_Firewall_Configuration>+http://wiki.lustre.org/Operating_System_Configuration_Guidelines_For_Lustre#SELinux_and_Firewall_Configuration]]};


***Lustre File System - MGT [#e359db7d]
MGS向けのディスクを用意する. MGTなので100MBほどでいいようで、MDTに組み込まれてもいいみたい.
#code(nonumber){{
[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 ~]#
}}
***Lustre File System - MDS [#ccf2be9f]
MDTは2つ用意してみた. 具体的にどのくらいサイズが必要なのかは マニュアル を参照してください
#code(nonumber){{
[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
}}

***Lustre File System - OSS [#j979133e]
備考: RHEL6のext4最大1ボリュームは16TB. RHEL7では50TB. lustreのLDISKFS(ext4)は50TB[[http://wiki.lustre.org/Introduction_to_Lustre_Object_Storage_Devices_(OSDs)>+http://wiki.lustre.org/Introduction_to_Lustre_Object_Storage_Devices_(OSDs)]]
#code(nonumber){{
[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/
}}
***client [#ncc82ee4]
#code(nonumber){{
[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を設定します
#code(nonumber){{
[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してみます.

#code(nonumber){{
[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できた.


***ベンダー各社の構成提案 [#q3cd62d8]
Lustreイコール [[DDN社様>+https://ddn.co.jp/index.html]] なので実際の導入事例がたくさん掲載されている.
ManagementとMetaサーバを2台一組のHAで運用してOSSは筐体1台(内部2システム)でVM4台(2台1組のHA)で、OSTは90本エンクロージャをデイジーチェーンではなく直接OSTと接続な感じ.
OSSはHDD10本1組で1VMあたり10組以上繋げている.

OSSを増やすより1台のOSSに多数のOSTをぶら下げるのが想定みたい.

あと[[HPE社様>+https://buy.hpe.com/us/en/enterprise-solutions/high-performance-computing-solutions/high-performance-computing-storage-solutions/lustre-storage-solutions/scalable-storage-for-lustre/p/1008849030]]では
2台のDL360に共有ドライブMSA2050を繋げ、おそらくManagementとMetaサーバの機能を担わせ、OSSとして2台のDL380にD6020を繋げている.
D6020なので70本のHDDを抱えられる.

[[Dell EMC社様>+https://www.dell.com/support/article/ja-jp/sln314777/dell-emc-ready-solution-for-hpc-lustre-storage-using-powervault-me4-storage-line?lang=en]]は詳細な構成と数値も出している.

1

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS