lustre集群部署(ldiskfs,单机)

1. 前言

本文详细介绍如何在almalinux8.9上部署基于ldiskfs的lustre单机集群。系统环境如下:

lustre版本:2.15.4
操作系统:almalinux 8.9
内核版本:4.18.0-513.5.1.el8_9.x86_64

 
 

2. 集群规划

mgt        192.168.3.11
mdt0       192.168.3.11
ost0       192.168.3.11
client     192.168.3.12

 
 

3. 系统设置

3.1. 防火墙设置

3.1.1. 关闭防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service

 

3.2. selinux设置

3.2.1. 关闭selinux

sed -i.org 's|SELINUX=enforcing|SELINUX=disabled|g' /etc/selinux/config

3.2.2. 重启机器

reboot

3.2.3. 检查selinux状态

getenforce

如果输出结果是disabled,表明selinux已经关闭。

 
 

4. 集群部署

4.1. 服务端

4.1.1. 安装服务端软件

rpm --upgrade --reinstall --install -vh e2fsprogs/*.rpm
rpm --upgrade --reinstall --install -vh kernel/*.rpm
rpm --upgrade --reinstall --install -vh lustre/server/*.rpm

如果已经做了离线yum源,也可以使用dnf installdnf reinstall命令安装。

dnf reinstall e2fsprogs e2fsprogs-libs libcom_err libss
dnf reinstall kernel kernel-modules \
    kernel-modules-extra kernel-headers \
    kernel-core kernel-tools kernel-tools-libs
dnf install kmod-lustre kmod-lustre-osd-ldiskfs \
    lustre lustre-osd-ldiskfs-mount \
    lustre-iokit lustre-resource-agents

一定要保证kernel的包是除了lustre之外的最后一个安装,防止定制化的kernel包被其他覆盖。

4.1.2. 加载lustre内核模块

modprobe -v lustre

4.1.3. 配置网络

lustre集群内部通过LNet网络通信,LNet支持InfiniBand and IP networks。本案例采用TCP模式。

初始化配置lnet

lnetctl lnet configure
  • 默认情况下lnetctl lnet configure会加载第一个up状态的网卡,所以一般情况下不需要再配置net。
  • 可以使用lnetctl net show命令列出所有的net配置信息,如果没有符合要求的net信息,需要按照下面步骤添加。

添加tcp

lnetctl net add --net tcp0 --if enp0s8
  • 如果lnetctl lnet configure已经将添加了tcp0,使用lnetctl net del删除tcp0,然后用lnetctl net add重新添加。
  • tcp0可以理解为一个子网,原则上tcp后面的数字可以任意写。如果定义成tcp0,那么集群中所有的服务以及客户端都应该设置成同一子网,即tcp0

查看添加的tcp

lnetctl net show --net tcp0

保存到配置文件

lnetctl net show --net tcp0 >> /etc/lnet.conf

开机自启动lnet服务

systemctl enable lnet

4.1.4. 部署MGS服务

创建mgt

mkfs.lustre --mgs --backfstype=ldiskfs --reformat /dev/sdb

启动mgs服务

mkdir -p /lustre/mgt
mount -t lustre -U 95d74a36-996f-403a-84b4-1912bec0143b /lustre/mgt -v
  • 95d74a36-996f-403a-84b4-1912bec0143b/dev/sdb的uuid,可以通过blkid命令查询。建议采用uuid,因为磁盘盘符会改变。
  • 原则上挂载点的名字可以任意取名,建议和mgt名字保持一致。

4.1.5. 部署MDS服务

创建mdt

mkfs.lustre --mdt \
--fsname fs00 \
--index 0 \
--mgsnode=192.168.3.11@tcp0 \
--backfstype=ldiskfs \
--reformat /dev/sdc

如果磁盘空间容量比较大,可以添加参数--mkfsoptions="-E nodiscard",加快格式化过程。

启动mds服务

mkdir -p /lustre/mdt/mdt0
mount -t lustre -U 6feb0516-e2b1-4075-8b37-de94bb65c93b /lustre/mdt/mdt0 -v

4.1.6. 部署OSS服务

创建ost

mkfs.lustre --ost \
--fsname fs00 \
--index 0 \
--mgsnode=192.168.3.11@tcp0 \
--backfstype=ldiskfs \
--reformat /dev/sdd

启动oss服务

mkdir -p /lustre/ost/ost0
mount -t lustre -U 930e22ba-969c-4f95-820a-d7f521b47b0d /lustre/ost/ost0 -v

 

4.2. 客户端

lustre客户端软件不能和服务端软件安装在同一台机器上,因为lustre服务端软件已经包含了客户端软件所有的文件。所以,非必要,可以直接在服务端挂载lustre文件系统,而无需再另外一台机器上安装客户端软件。

4.2.1. 安装客户端软件

rpm --upgrade --reinstall --install -vh lustre/client/*.rpm

如果已经做了离线yum源,也可以使用dnf install命令安装。

dnf install kmod-lustre-client lustre-client lustre-iokit

4.2.2. 加载lustre内核模块

modprobe -v lustre

4.2.3. 配置网络

lustre集群内部通过LNet网络通信,LNet支持InfiniBand and IP networks。本案例采用TCP模式。

初始化配置lnet

lnetctl lnet configure
  • 默认情况下lnetctl lnet configure会加载第一个up状态的网卡,所以一般情况下不需要再配置net。
  • 可以使用lnetctl net show命令列出所有的net配置信息,如果没有符合要求的net信息,需要按照下面步骤添加。

添加tcp

lnetctl net add --net tcp0 --if enp0s8
  • 如果lnetctl lnet configure已经将添加了tcp0,使用lnetctl net del删除tcp0,然后用lnetctl net add重新添加。
  • tcp0可以理解为一个子网,原则上tcp后面的数字可以任意写。如果定义成tcp0,那么集群中所有的服务以及客户端都应该设置成同一子网,即tcp0

查看添加的tcp

lnetctl net show --net tcp0

保存到配置文件

lnetctl net show --net tcp0 >> /etc/lnet.conf

开机自启动lnet服务

systemctl enable lnet

4.2.4. 挂载文件系统

mkdir -p /mnt/fs00
mount -t lustre 192.168.3.11@tcp0:/fs00 /mnt/fs00 -v

 
 

5. 参考资料

Lustre is a shared disk file system, generally used for large scale cluster computing. The name Lustre is a portmanteau of Linux and cluster. The project aims to provide a file system for clusters of tens of thousands of nodes with petabytes of storage capacity, without compromising speed or security. Lustre is available under the GNU GPL.Lustre is designed, developed and maintained by Sun Microsystems, Inc. with input from many other individuals and companies. Sun completed its acquisition of Cluster File Systems, Inc., including the Lustre file system, on October 2, 2007, with the intention of bringing the benefits of Lustre technologies to Sun's ZFS file system and the Solaris operating system.Lustre file systems are used in computer clusters ranging from small workgroup clusters to large-scale, multi-site clusters. Fifteen of the top 30 supercomputers in the world use Lustre file systems, including the world's fastest supercomputer, the Blue Gene/L at Lawrence Livermore National Laboratory (LLNL). Other supercomputers that use the Lustre file system include systems at Oak Ridge National Laboratory, Pacific Northwest National Laboratory, and Los Alamos National Laboratory in North America, the largest system in Asia at Tokyo Institute of Technology, and the largest system in Europe at CEA.Lustre file systems can support up to tens of thousands of client systems, petabytes (PBs) of storage and hundreds of gigabytes per second (GB/s) of I/O throughput. Businesses ranging from Internet service providers to large financial institutions deploy Lustre file systems in their datacenters. Due to the high scalability of Lustre file systems, Lustre deployments are popular in the oil and gas, manufacturing, rich media and finance sectors.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值