Unbuntu20.4编译安装lustre客户端

1.安装依赖包

  • 下载依赖包:

    sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list && sudo apt update
    # 通过uname -r查看自己内核的版本来更改安装的版本
    # Ubuntu20.4版本如下
    sudo apt install -y linux-image-5.4.0-164-generic linux-modules-5.4.0-164-generic linux-modules-extra-5.4.0-164-generic
    # Ubuntu22.4版本如下
    sudo apt install -y linux-image-5.15.0-86-generic linux-modules-5.15.0-86-generic linux-modules-extra-5.15.0-86-generic
    sudo apt install -y git libtool libtool-bin libyaml-dev ed libreadline-dev dpatch libsnmp-dev mpi-default-dev module-assistant quilt libjson-c-dev pkg-config keyutils libkeyutils1 libkeyutils-dev
    sudo apt install -y libncurses5-dev libncurses-dev bison flex gnupg libelf-dev gcc libssl-dev bc bzip2 build-essential udev kmod cpio libmount1 libmount-dev
    sudo apt install -y libfuse-dev libattr1-dev libblkid-dev uuid-dev devscripts fakeroot kernel-wedge libudev-dev libpython3-dev swig
    sudo apt install -y gettext texinfo debhelper dh-exec update-notifier-common sg3-utils attr mpi-default-bin selinux-utils
    sudo apt install -y python python2 python2-minimal python2.7 libpython2-stdlib libsgutils2-2 libpython2.7-stdlib python2.7-minimal libpython2.7-minimal libkeyutils-dev libmount-dev dwarves python3-distutils

  • 如果出现下列问题,可以这样解决:

    You might want to run 'apt --fix-broken install' to correct these.
    The following packages have unmet dependencies:
     libsnmp-dev : Depends: libsnmp35 (= 5.8+dfsg-2ubuntu2.9) but it is not going to be installed
                   Depends: libwrap0-dev but it is not going to be installed
                   Depends: libssl-dev but it is not going to be installed
                   Depends: libsensors-dev
                   Depends: libpci-dev but it is not going to be installed
    E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
    # 解决方法,执行下列命令后安装
    sudo apt --fix-broken install -o Dpkg::Options::="--force-overwrite"

2.上传解压源码包:

  • 上传解压lustre源码包:

  • sudo tar -xvf lustre-client-*****.tar.gz

3.编译和安装:

  • 先进入解压后的根目录:

    cd ~/lustre-2.14.0.**/

  • 准备编译环境:

    # --with-o2ib 是一个选项,用于启用支持O2IB(OpenFabrics 2.0 verbs)的功能。O2IB是一种用于InfiniBand互连网络的开放式高性能通信协议
    # --disable-server 是一个选项,表示禁用服务器功能。这意味着在编译过程中不会包含服务器相关的功能和组件。
    sudo ./configure --disable-server --with-o2ib

  • 编译源码包

    sudo make debs

  • 安装客户端软件包:

    cd ./debs && sudo dpkg -i lustre-client*.deb lustre-dev*.deb

  • 加载模块:

    qv123@localhost:~/lustre-2.14.0_***/debs$ sudo modprobe lustre && lsmod | grep lustre
    lustre               1011712  0
    lmv                   204800  1 lustre
    mdc                   262144  1 lustre
    lov                   331776  2 mdc,lustre
    ptlrpc               1331200  7 fld,osc,fid,lov,mdc,lmv,lustre
    obdclass             3284992  8 fld,osc,fid,ptlrpc,lov,mdc,lmv,lustre
    lnet                  565248  6 osc,obdclass,ptlrpc,ksocklnd,lmv,lustre
    libcfs                487424  11 fld,lnet,osc,fid,obdclass,ptlrpc,ksocklnd,lov,mdc,lmv,lustre

4.配置Lustre network:

  • 配置Lnet的IP地址:(添加ens38的网卡内容)

    sudo vi /etc/netplan/00-installer-config.yaml
    network:
      ethernets:
        ens33:
          ...
        ens38:
          addresses: [192.168.209.203/24]
      version: 2
      renderer: networkd
    sudo netplan apply

  • 修改配置文件:(切换成root用户)

    cat << eof > /etc/modprobe.d/lustre.conf
    options lnet networks="tcp(ens33),tcp2(ens38)"
    eof
    cat << eof > /etc/modprobe.d/lustre.conf
    options lnet networks="tcp(ens33),o2ib0(ib0)"
    eof

  • 加载模块:

    sudo lustre_rmmod && sudo modprobe -v lustre

5.挂载文件系统:

sudo mkdir /mnt/global-client1
sudo mount -t lustre 192.168.209.21@tcp2:192.168.209.22@tcp2:/global /mnt/global-client1
# 切换成root用户查看
root@localhost:/home/qv123# cd /mnt/global-client1
root@localhost:/mnt/global-client1# ll
total 3602672
drwxr-xr-x 3 root root       4096 Oct 16 18:41 ./
drwxr-xr-x 3 root root       4096 Oct 17 10:45 ../
-rw-r--r-- 1 root root          0 Oct 16 18:41 test
-rw-r--r-- 1 root root 3693318144 Oct 16 18:45 test1

6.准备编译环境和编译中的问题:

  • 问题1:依赖

    configure: WARNING: GSS keyring backend requires libkeyutils
    configure: error: Cannot enable gss_keyring. See above for details.
    # 解决方法
    
    apt install -y keyutils-libs keyutils-libs-devel

  • 问题2:依赖

    configure: error: libyaml development package is required
    # 解决方法
    
    apt install -y libyaml-devel

  • 问题三:依赖

    configure: error: libmount development package is required
    # 解决方法
    
    apt install -y libyaml-devel

  • 问题四:依赖

    dpkg-checkbuilddeps: 错误: Unmet build dependencies: module-assistant libreadline-dev debhelper (>= 11) dpatch libsnmp-dev quilt
    # 解决方法
    
    apt install -y module-assistant libreadline-dev debhelper dpatch libsnmp-dev quilt

  • 问题四:

    /usr/src/linux-headers-6.2.0-33-generic/include/linux/shrinker.h:102:27: note: declared here
      102 | extern int __printf(2, 3) register_shrinker(struct shrinker *shrinker,
    # 解决方法
    ​
  • 问题五:

    dpkg-buildpackage: 错误: debian/rules build subprocess returned exit status 2
    # 解决方法
    ​
  • 问题六:

    dpkg-checkbuilddeps: error: Unmet build dependencies:
    linux-headers-generic  linux-headers-amd64inux-headers-arm64
    # 解决方法
    ​
  • 问题七:

    dpkg-checkbuilddeps: error: Unmet build dependencies: pkg-confi
    # 解决方法
    sudo apt install -y pkg-config
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值