Unbuntu20.4编译安装lustre客户端

1.安装依赖包

  • 下载依赖包:

    复制代码
    sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list && sudo apt update
    
    # 通过uname -r查看自己内核的版本来更改安装的版本
    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
    
    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
    
    sudo apt install -y libncurses5-dev libncurses-dev bison flex gnupg libelf-dev gcc libssl-dev bc bzip2 build-essential udev kmod cpio
    
    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-2.14.0_ddn85.tar.gz

3.编译和安装:

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

    复制代码
    cd ~/lustre-2.14.0_ddn85/
  • 准备编译环境:

    复制代码
    # --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_ddn85/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 天前
85 微PE吕了了修改版--更新!
运维·windows·电脑·系统
德生coding1 天前
wifi驱动编译出来的驱动文件怎么做strip
linux
鹿鸣天涯1 天前
Kali Linux 2025.4 发布:桌面环境增强,新增 3 款安全工具
linux·运维·安全
学习&笔记1 天前
MTK(系统篇)user版本无法使用setenforce 0命令关闭selinux权限
linux·运维·服务器
Bdygsl1 天前
Linux(8)—— 进程优先级与环境变量
linux·运维·服务器
another heaven1 天前
【软考 磁盘磁道访问时间】总容量等相关案例题型
linux·网络·算法·磁盘·磁道
吕了了1 天前
87 Windows 系统安装的本质是什么?
运维·windows·电脑·系统
阿里巴巴P8资深技术专家1 天前
docker容器启动报错
运维·docker·容器
杨云龙UP1 天前
MySQL 8.0.x InnoDB 写入链路优化:Redo Log 与 Buffer Pool 扩容与缓冲区调优实战记录-20251029
linux·运维·数据库·sql·mysql
txzz88881 天前
CentOS-Stream-10 系统安装之网络设置
linux·运维·服务器·网络·计算机网络·centos