最新的单机Lustre文件系统的安装

1.单机Lustre的搭建:

主机名IP地址内存添加的共享磁盘大小
Centos7.9-test机192.168.10.30/241G20G

1.安装E2fsprogs包

  • 下载OSS服务器所需要的包:E2fsprogs包只是在Ext4的原版RPM包基础上增加了对Lustre⽀持

    mkdir ~/e2fsprogs && cd ~/e2fsprogs
    wget -c -r -nd https://downloads.whamcloud.com/public/e2fsprogs/1.44.5.wc1/el7/RPMS/x86_64/
    rm -rf index.html* unknown.gif *.gif sha256sum
  • 全部rpm安装:

    [root@slave1 e2fsprogs]# cd ~/e2fsprogs && rpm -Uvh *
    准备中...                          ################################# [100%]
    正在升级/安装...
       1:libcom_err-1.42.12.wc1-4.el7.cent################################# [  8%]
       2:e2fsprogs-libs-1.42.12.wc1-4.el7.################################# [ 15%]
       3:libcom_err-devel-1.42.12.wc1-4.el################################# [ 23%]
       4:libss-1.42.12.wc1-4.el7.centos   ################################# [ 31%]
       5:e2fsprogs-1.42.12.wc1-4.el7.cento################################# [ 38%]
       6:libss-devel-1.42.12.wc1-4.el7.cen################################# [ 46%]
       7:e2fsprogs-devel-1.42.12.wc1-4.el7################################# [ 54%]
       8:e2fsprogs-static-1.42.12.wc1-4.el################################# [ 62%]
       9:e2fsprogs-debuginfo-1.42.12.wc1-4################################# [ 69%]
    正在清理/删除...
      10:e2fsprogs-1.42.9-19.el7          ################################# [ 77%]
      11:e2fsprogs-libs-1.42.9-19.el7     ################################# [ 85%]
      12:libss-1.42.9-19.el7              ################################# [ 92%]
      13:libcom_err-1.42.9-19.el7         ################################# [100%]

2.安装lustre包:

  • 下载MDS服务器所需要的包:

    wget命令参数说明
    -c断点续传
    -r递归下载
    -nd不分层,所有文件下载到当前目录下
    rpm包说明
    kernel-*.el7_lustre.x86_64.rpm带 Lustre 补丁的 Linux 内核
    kmod-lustre-*.el7.x86_64.rpmLustre 补丁内核模块
    kmod-lustre-osd-ldiskfs-*.el7.x86_64.rpm基于 ldiskfs 的 Lustre 后端文件系统工具
    lustre-*.el7.x86_64.rpmLustre 软件命令行工具
    lustre-osd-ldiskfs-mount-*.el7.x86_64.rpm基于ldiskfs 的 mount.lustre和mkfs。lustre相关帮助文档
    mkdir ~/lustre2.12.1 && cd ~/lustre2.12.1
    yum install -y wget
    wget \
    https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/kernel-3.10.0-957.10.1.el7_lustre.x86_64.rpm \
    https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/kmod-lustre-2.12.1-1.el7.x86_64.rpm \
    https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/kmod-lustre-osd-ldiskfs-2.12.1-1.el7.x86_64.rpm \
    https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/lustre-2.12.1-1.el7.x86_64.rpm \
    https://downloads.whamcloud.com/public/lustre/lustre-2.12.1/el7/server/RPMS/x86_64/lustre-osd-ldiskfs-mount-2.12.1-1.el7.x86_64.rpm
  • 安装依赖(否则报错error: Failed dependencies:):

    yum clean all && yum repolist
    yum install -y linux-firmware dracut selinux-policy-targeted kexec-tools libyaml perl
  • 全部rpm安装:(如果无法安装就强行安装)

    cd ~/lustre2.12.1 && rpm -ivh *.rpm --force
  • 重启服务器:

    init 6
  • 检查内核:

    [root@master ~]# uname -r
    3.10.0-957.el7_lustre.x86_64
  • 加载Lustre模块:lustre_rmmod卸载模块

    [root@master ~]# modprobe lustre
    [root@master ~]# lsmod | grep lustre
    lustre                758679  0 
    lmv                   177987  1 lustre
    mdc                   232938  1 lustre
    lov                   314581  1 lustre
    ptlrpc               2264705  7 fid,fld,lmv,mdc,lov,osc,lustre
    obdclass             1962422  8 fid,fld,lmv,mdc,lov,osc,lustre,ptlrpc
    lnet                  595941  6 lmv,osc,lustre,obdclass,ptlrpc,ksocklnd
    libcfs                421295  11 fid,fld,lmv,mdc,lov,osc,lnet,lustre,obdclass,ptlrpc,ksocklnd

3.格式化和挂载:

  • 添加一块20G的硬盘

  • GPT分区:

    使用fdisk命令中的帮助查看可以操作的指令,其中m查看帮助、n创建分区、p查看分区情况、t修改分区类型、w保存退出。

    [root@master ~]# fdisk /dev/sdb
    欢迎使用 fdisk (util-linux 2.23.2)。
    ​
    更改将停留在内存中,直到您决定将更改写入磁盘。
    使用写入命令前请三思。
    ​
    Device does not contain a recognized partition table
    使用磁盘标识符 0xa44e96c5 创建新的 DOS 磁盘标签。
    ​
    命令(输入 m 获取帮助):
    [root@master ~]# lsblk
    NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda               8:0    0   20G  0 disk 
    ├─sda1            8:1    0    1G  0 part /boot
    └─sda2            8:2    0   19G  0 part 
      ├─centos-root 253:0    0   17G  0 lvm  /
      └─centos-swap 253:1    0    2G  0 lvm  [SWAP]
    sdb               8:16   0   20G  0 disk 
    ├─sdb1            8:17   0    5G  0 part 
    ├─sdb2            8:18   0    5G  0 part 
    └─sdb3            8:19   0    5G  0 part 
    sr0              11:0    1  9.5G  0 rom  
  • 当OSS服务器硬盘添加并分区后,Lustre格式化:

    Lustre格式化参数说明
    --fsname设置Lustre集群的名称,Lustre文件系统的标识,必须唯一
    --mgsnodemgs节点的IP地址
    --mgs将分区格式化为MGS,MGS(ManaGe Server)是⽤来记录整个Lustre状态的服务
    --mdt将分区格式化为MDT,MDT(MetaData Target)是存放Lustre元数据服务的设备
    --ost将分区格式化为OST,OST(Object Storage Target)则是存储Lustre数据的设备
    --reformat跳过检查,防止格式化操作清除已有的数据
    [root@master ~]# mkfs.lustre --mgs --mgsnode=192.168.10.23@tcp --backfstype=ldiskfs --reformat /dev/sdb1
    ​
       Permanent disk data:
    Target:     MGS
    Index:      unassigned
    Lustre FS:  
    Mount type: ldiskfs
    Flags:      0x64
                  (MGS first_time update )
    Persistent mount opts: user_xattr,errors=remount-ro
    Parameters: mgsnode=192.168.10.20@tcp
    ​
    checking for existing Lustre data: not found
    device size = 5120MB
    formatting backing filesystem ldiskfs on /dev/sdb1
            target name   MGS
            4k blocks     1310720
            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/sdb1 1310720
    Writing CONFIGS/mountdata
    [root@master ~]# mkfs.lustre --fsname global --mdt --index=0 --mgsnode=192.168.10.23@tcp --backfstype=ldiskfs --reformat /dev/sdb2
    ​
       Permanent disk data:
    Target:     global:MDT0000
    Index:      0
    Lustre FS:  global
    Mount type: ldiskfs
    Flags:      0x61
                  (MDT first_time update )
    Persistent mount opts: user_xattr,errors=remount-ro
    Parameters: mgsnode=192.168.10.20@tcp
    ​
    checking for existing Lustre data: not found
    device size = 5120MB
    formatting backing filesystem ldiskfs on /dev/sdb2
            target name   global:MDT0000
            4k blocks     1310720
            options        -J size=204 -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 global:MDT0000  -J size=204 -I 1024 -i 2560 -q -O dirdata,uninit_bg,^extents,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F /dev/sdb2 1310720
    Writing CONFIGS/mountdata
    [root@master ~]# mkfs.lustre --fsname global --ost --index=0 --mgsnode=192.168.10.23@tcp --backfstype=ldiskfs --reformat /dev/sdb3
    ​
       Permanent disk data:
    Target:     global:OST0000
    Index:      0
    Lustre FS:  global
    Mount type: ldiskfs
    Flags:      0x62
                  (OST first_time update )
    Persistent mount opts: ,errors=remount-ro
    Parameters: mgsnode=192.168.10.20@tcp
    ​
    checking for existing Lustre data: not found
    device size = 5120MB
    formatting backing filesystem ldiskfs on /dev/sdb3
            target name   global:OST0000
            4k blocks     1310720
            options        -J size=204 -I 512 -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 global:OST0000  -J size=204 -I 512 -q -O extents,uninit_bg,dir_nlink,quota,huge_file,flex_bg -G 256 -E resize="4290772992",lazy_journal_init -F /dev/sdb3 1310720
    Writing CONFIGS/mountdata
  • 格式化之后,挂载Lustre文件系统(mgs,mdt,ost)和客户端:-t指定文件系统的类型

    [root@localhost ~]# mkdir /mnt/sdb1;mkdir /mnt/sdb2;mkdir /mnt/sdb3;mkdir /mnt/global1;mkdir /mnt/global2
    mount -t lustre /dev/sdb1 /mnt/sdb1
    mount -t lustre /dev/sdb2 /mnt/sdb2;mount -t lustre /dev/sdb3 /mnt/sdb3
    mount -t lustre 192.168.10.23@tcp:/global /mnt/global1;mount -t lustre 192.168.10.23@tcp:/global /mnt/global2
    cat << eof >> /etc/fstab
    /dev/sdb1  /mnt/sdb1  lustre  defaults  0   0
    /dev/sdb2  /mnt/sdb2  lustre  defaults  0   0
    /dev/sdb3  /mnt/sdb3  lustre  defaults  0   0
    192.168.10.23@tcp:/global  /mnt/global1  lustre  defaults  0   0
    192.168.10.23@tcp:/global  /mnt/global2  lustre  defaults  0   0
    eof
  • 查看Lustre的挂载情况:

    [root@localhost ~]# mount | grep lustre
    /dev/sdb1 on /mnt/sdb1 type lustre (ro,svname=MGS,nosvc,mgs,osd=osd-ldiskfs,user_xattr,errors=remount-ro)
    /dev/sdb2 on /mnt/sdb2 type lustre (ro,svname=global-MDT0000,mgsnode=192.168.10.30@tcp,osd=osd-ldiskfs,user_xattr,errors=remount-ro)
    /dev/sdb3 on /mnt/sdb3 type lustre (ro,svname=global-OST0000,mgsnode=192.168.10.30@tcp,osd=osd-ldiskfs,errors=remount-ro)
    192.168.10.30@tcp:/global on /mnt/global type lustre (rw,lazystatfs)
    192.168.10.30@tcp:/global on /mnt/global2 type lustre (rw,lazystatfs)

4.测试:

  • 在/mnt/global客户端处,创建文件并写数据:

    [root@localhost ~]# echo "Hello Lustre,I am client1" > /mnt/global/first_file

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
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.<br><br>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.<br><br>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.<br><br>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.<br>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值