Skip to content

Deploying Lustre 2.15 on AlmaLinux 9 — MGS, MDS, OSS, OST with ZFS-backed OSTs

Stand up a Lustre 2.15 filesystem on AlmaLinux 9 with the MGS+MDS combined, two OSS nodes, four ZFS-backed OSTs, and a kernel client. End-to-end installer with LNet, kernel modules, and a striped file smoke test.

You inherit a research-tier compute cluster that thirty users share, all of them running scratch I/O against a single 100 TB NFS box that crawls under parallel writes. The capacity is fine; the throughput is what falls over — twenty parallel jobs writing 20 GB checkpoints saturate one TCP stream into one server. The team’s been told to “upgrade the storage,” but the problem is not the storage box, it’s the architecture: a single I/O server can’t serve thirty parallel writers regardless of how much disk you stack behind it. The answer is a parallel filesystem with multiple object storage servers and a separate metadata server, which is the shape Lustre has had since the 2000s. This article stands up a Lustre 2.15 filesystem on AlmaLinux 9 with the MGS and MDS combined on one node, two OSS nodes each hosting two ZFS-backed OSTs, and a kernel client — the smallest correct shape that actually demonstrates parallel I/O.

What’s happening

A Lustre filesystem has four service types and a network layer that holds it together. The MGS (Management Service) is a tiny key-value store that tells clients which MDS owns the namespace and which OSTs hold the data — it sits on a small dedicated MGT (Management Target). The MDS (Metadata Service) owns directory entries, file-to-stripe mappings, permissions, and inode-class metadata — it sits on an MDT (Metadata Target) backed by a real disk filesystem (ldiskfs or ZFS). The OSS (Object Storage Service) hosts one or more OSTs (Object Storage Targets), and the OSTs are where the data lives — each OST is a backing filesystem (again ldiskfs or ZFS), and a file is striped across multiple OSTs so a parallel client reads from multiple OSSes at once. LNet is the message-passing layer between everyone: clients, MGS, MDS, and OSSes all participate in the LNet network, and Lustre uses LNet’s TCP, IB, or O2IB transports to move data. The decision that drives everything is stripe count (how many OSTs a file spans) and stripe size (the chunk size before round-robin moves to the next OST) — set them per-directory or per-file and a 100 GB checkpoint becomes ten parallel 10 GB writes across ten OSTs. The mistakes that ruin small clusters: combining MDS and OSS on the same node so metadata operations starve data I/O, undersizing the MDT (Lustre metadata is denser than you expect; a 4 TB MDT supports a much smaller file count than the math suggests), and using one OST so the parallel filesystem has no parallelism. The ZFS-backed OST choice in this article is deliberate: ZFS gives you data checksumming, transparent compression, snapshots, and the ability to add disks to a pool without recreating the OST — which the ldiskfs backend cannot do.

How to verify

LNet connectivity between any two nodes:

lctl ping 10.60.0.11@tcp
# 12345-0@lo
# 12345-10.60.0.11@tcp

MGS catalogue — should list the filesystem and all OSTs:

lctl get_param mgs.*.live.*
# fsdb: lustrefs
# state: complete
# OST0000_UUID: ACTIVE
# OST0001_UUID: ACTIVE
# OST0002_UUID: ACTIVE
# OST0003_UUID: ACTIVE

From the client mount — every OST should report state ACTIVE and a comparable free space:

lfs df -h /mnt/lustre
# UUID                  bytes        Used   Available Use% Mounted on
# lustrefs-MDT0000_UUID  100.0G     1.2G       98.8G   1% /mnt/lustre[MDT:0]
# lustrefs-OST0000_UUID    4.0T     2.0G        4.0T   0% /mnt/lustre[OST:0]
# lustrefs-OST0001_UUID    4.0T     2.0G        4.0T   0% /mnt/lustre[OST:1]
# lustrefs-OST0002_UUID    4.0T     2.0G        4.0T   0% /mnt/lustre[OST:2]
# lustrefs-OST0003_UUID    4.0T     2.0G        4.0T   0% /mnt/lustre[OST:3]

Stripe verification on a real file — write to a striped directory, then inspect the layout:

mkdir /mnt/lustre/striped
lfs setstripe -c 4 -S 1M /mnt/lustre/striped
dd if=/dev/zero of=/mnt/lustre/striped/test.bin bs=1M count=4096 status=progress
lfs getstripe /mnt/lustre/striped/test.bin
# /mnt/lustre/striped/test.bin
# lmm_stripe_count:  4
# lmm_stripe_size:   1048576
# lmm_pattern:       raid0
#   obdidx  objid  objid    group
#        0  ...    ...       0
#        1  ...    ...       0
#        2  ...    ...       0
#        3  ...    ...       0

If a dd to a 4-stripe file gets the same MB/s as a dd to a 1-stripe file, the network is gating you, not the OSTs — verify with iperf3 between the client and each OSS.

The fix

Save the script as /root/setup-lustre-node.sh and run it on each node with the correct NODE_ROLE (mgs_mds, oss, or client). The script does the full AlmaLinux 9 install: base hardening (SELinux permissive — Lustre 2.15 has known gaps with enforcing on the MDS, firewalld with Lustre ports, fail2ban, dnf-automatic, SSH key-only), kernel/sysctl tuning, the upstream Lustre 2.15 RPM repo, the ZFS-on-Linux 2.1 repo, kernel module installation, LNet configuration on a TCP interface (swap to o2ib if you have InfiniBand), MGS+MDT formatting and mount on the combined node, OST formatting and mount on each OSS with one ZFS pool per OST, the client kernel module, and a smoke-test dd against a striped directory.

#!/usr/bin/env bash
set -euo pipefail

### AlmaLinux 9 Lustre 2.15 with ZFS-backed OSTs
### Role per node: mgs_mds, oss, or client

if [[ "$(id -u)" -ne 0 ]]; then
  echo "Run as root."
  exit 1
fi

# === EDIT PER NODE ===
NODE_NAME="lustre-mgs"          # lustre-mgs / lustre-oss-01 / lustre-oss-02 / lustre-client
NODE_IP="10.60.0.11"
NODE_ROLE="mgs_mds"             # mgs_mds | oss | client
MGS_IP="10.60.0.11"
FS_NAME="lustrefs"
LNET_NID="${NODE_IP}@tcp"
LNET_INTERFACE="eth0"           # NIC for Lustre traffic
MDT_DEV="/dev/sdb"              # on mgs_mds, ZFS-backed MDT
OST_DEVS=("/dev/sdb" "/dev/sdc") # on oss, one ZFS pool per device → one OST each
OSS_INDEX=0                     # 0 / 1 — used for OST index ranges
CLIENT_SUBNET="10.60.0.0/16"
# =====================

echo
echo "========================================"
echo "Lustre ${NODE_ROLE} on ${NODE_NAME} (${NODE_IP})"
echo "========================================"
echo

echo "==> Hosts file"
if ! grep -q "lustre-mgs" /etc/hosts; then
  echo "${MGS_IP} lustre-mgs" >> /etc/hosts
fi
hostnamectl set-hostname "${NODE_NAME}"

echo "==> Updating base OS"
dnf -y update
dnf -y install epel-release
dnf -y install vim curl wget chrony fail2ban dnf-automatic \
  policycoreutils-python-utils lsof tcpdump bind-utils tar gzip \
  iproute net-tools jq socat python3 lvm2 perl gcc make \
  kernel-devel-$(uname -r) kernel-headers-$(uname -r) dkms

systemctl enable --now chronyd

echo "==> SELinux permissive (Lustre 2.15 + enforcing has known issues on MDS)"
sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
setenforce 0 || true

echo "==> Sysctl tuning"
cat > /etc/sysctl.d/99-lustre.conf <<'SYSCTL'
vm.swappiness = 10
vm.dirty_background_ratio = 5
vm.dirty_ratio = 15
vm.min_free_kbytes = 524288
fs.file-max = 4194304
fs.aio-max-nr = 1048576
net.core.somaxconn = 4096
net.core.rmem_max = 268435456
net.core.wmem_max = 268435456
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.ipv4.tcp_rmem = 4096 87380 268435456
net.ipv4.tcp_wmem = 4096 87380 268435456
net.ipv4.tcp_syncookies = 1
SYSCTL
sysctl --system

cat > /etc/security/limits.d/99-lustre.conf <<'LIMITS'
root soft nofile 1048576
root hard nofile 1048576
* soft nofile 1048576
* hard nofile 1048576
LIMITS

echo "==> SSH hardening"
sed -i 's|^[#[:space:]]*PermitRootLogin.*|PermitRootLogin prohibit-password|' /etc/ssh/sshd_config
sed -i 's|^[#[:space:]]*PasswordAuthentication.*|PasswordAuthentication no|' /etc/ssh/sshd_config
sshd -t && systemctl restart sshd

echo "==> fail2ban + dnf-automatic"
cat > /etc/fail2ban/jail.d/sshd.local <<'F2B'
[sshd]
enabled = true
port = ssh
backend = systemd
maxretry = 4
findtime = 10m
bantime = 1h
F2B
systemctl enable --now fail2ban

cat > /etc/dnf/automatic.conf <<'DNFAUTO'
[commands]
upgrade_type = security
random_sleep = 900
download_updates = yes
apply_updates = yes
[emitters]
emit_via = stdio
DNFAUTO
systemctl enable --now dnf-automatic.timer

echo "==> firewalld + Lustre service ports"
dnf -y install firewalld
systemctl enable --now firewalld
firewall-cmd --permanent --add-service=ssh
# Lustre uses 988/tcp for LNet TCP transport
firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address=${CLIENT_SUBNET} port port=988 protocol=tcp accept"
firewall-cmd --reload

echo "==> ZFS on Linux 2.1 repo"
dnf -y install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm
dnf -y install zfs zfs-dkms

echo "==> Lustre 2.15 repo (server side packages)"
cat > /etc/yum.repos.d/lustre.repo <<'REPO'
[lustre-server]
name=lustre-server
baseurl=https://downloads.whamcloud.com/public/lustre/latest-release/el9.2/server/RPMS/x86_64/
gpgcheck=0
enabled=1

[lustre-client]
name=lustre-client
baseurl=https://downloads.whamcloud.com/public/lustre/latest-release/el9.2/client/RPMS/x86_64/
gpgcheck=0
enabled=1

[e2fsprogs-wc]
name=e2fsprogs-wc
baseurl=https://downloads.whamcloud.com/public/e2fsprogs/latest/el9/
gpgcheck=0
enabled=1
REPO

dnf -y makecache

case "${NODE_ROLE}" in
  mgs_mds|oss)
    echo "==> Installing Lustre server packages (kernel modules via DKMS, with ZFS OSD)"
    dnf -y install --skip-broken \
      lustre-osd-zfs-mount \
      lustre-zfs-dkms \
      lustre \
      lustre-resource-agents 2>/dev/null || true
    # Fallback for slightly different package names per build
    dnf -y install lustre lustre-dkms 2>/dev/null || true
    ;;
  client)
    echo "==> Installing Lustre client packages"
    dnf -y install --skip-broken lustre-client-dkms lustre-client lustre 2>/dev/null || true
    dnf -y install lustre-client 2>/dev/null || true
    ;;
esac

echo "==> Configuring LNet on ${LNET_INTERFACE}"
mkdir -p /etc/lnet
cat > /etc/modprobe.d/lustre.conf <<EOF
options lnet networks="tcp(${LNET_INTERFACE})"
EOF

modprobe lnet
lnetctl lnet configure --all || true
lnetctl net add --net tcp --if "${LNET_INTERFACE}" 2>/dev/null || true
lnetctl export > /etc/lnet/lnet.conf 2>/dev/null || true

systemctl enable lnet 2>/dev/null || true
systemctl start lnet 2>/dev/null || true

case "${NODE_ROLE}" in
  mgs_mds)
    echo "==> Creating ZFS pool for MGT+MDT"
    if [[ ! -b "${MDT_DEV}" ]]; then
      echo "ERROR: ${MDT_DEV} not present. Edit MDT_DEV and rerun."
      exit 1
    fi
    if ! zpool list lustre-mdt0 >/dev/null 2>&1; then
      zpool create -O canmount=off -O xattr=sa -O dnodesize=auto \
        -O recordsize=1M -O atime=off -O compression=lz4 \
        lustre-mdt0 "${MDT_DEV}"
    fi

    echo "==> Formatting combined MGT+MDT"
    if [[ ! -d /lustre/${FS_NAME}/mdt0 ]]; then
      mkfs.lustre --reformat --fsname="${FS_NAME}" \
        --mgs --mdt --index=0 \
        --backfstype=zfs \
        lustre-mdt0/mdt0

      mkdir -p /lustre/${FS_NAME}/mdt0
      echo "lustre-mdt0/mdt0  /lustre/${FS_NAME}/mdt0  lustre  defaults,_netdev  0 0" >> /etc/fstab
    fi

    mountpoint -q /lustre/${FS_NAME}/mdt0 || mount /lustre/${FS_NAME}/mdt0
    ;;

  oss)
    echo "==> Creating ZFS pool + OST per device"
    for i in "${!OST_DEVS[@]}"; do
      dev="${OST_DEVS[$i]}"
      if [[ ! -b "${dev}" ]]; then
        echo "ERROR: ${dev} not present. Edit OST_DEVS and rerun."
        exit 1
      fi
      pool="lustre-ost$((OSS_INDEX * 10 + i))"
      idx=$((OSS_INDEX * 10 + i))

      if ! zpool list "${pool}" >/dev/null 2>&1; then
        zpool create -O canmount=off -O xattr=sa -O dnodesize=auto \
          -O recordsize=1M -O atime=off -O compression=lz4 \
          "${pool}" "${dev}"
      fi

      ost_path="/lustre/${FS_NAME}/ost${idx}"
      mkdir -p "${ost_path}"

      if ! lctl get_param osd-zfs.${FS_NAME}-OST$(printf "%04d" "${idx}").* >/dev/null 2>&1; then
        mkfs.lustre --reformat --fsname="${FS_NAME}" \
          --ost --index="${idx}" \
          --mgsnode="${MGS_IP}@tcp" \
          --backfstype=zfs \
          "${pool}/ost${idx}"

        echo "${pool}/ost${idx}  ${ost_path}  lustre  defaults,_netdev  0 0" >> /etc/fstab
      fi

      mountpoint -q "${ost_path}" || mount "${ost_path}"
    done
    ;;

  client)
    echo "==> Mounting client"
    mkdir -p /mnt/lustre
    if ! mountpoint -q /mnt/lustre; then
      echo "${MGS_IP}@tcp:/${FS_NAME}  /mnt/lustre  lustre  defaults,_netdev  0 0" >> /etc/fstab
      mount /mnt/lustre || true
    fi

    if mountpoint -q /mnt/lustre; then
      echo "==> Smoke-test: stripe a directory across all OSTs"
      mkdir -p /mnt/lustre/striped
      lfs setstripe -c -1 -S 1M /mnt/lustre/striped || true
      echo "Stripe set on /mnt/lustre/striped — try:"
      echo "  dd if=/dev/zero of=/mnt/lustre/striped/test.bin bs=1M count=4096"
      echo "  lfs getstripe /mnt/lustre/striped/test.bin"
    fi
    ;;
esac

echo
echo "========================================"
echo "DONE on ${NODE_NAME} (${NODE_ROLE})"
echo "========================================"
echo

case "${NODE_ROLE}" in
  mgs_mds)
    sleep 3
    lctl ping "${MGS_IP}@tcp" || true
    echo
    lctl dl || true
    echo
    echo "Once OSS nodes are up, from this node:"
    echo "  lctl get_param mgs.*.live.${FS_NAME}"
    ;;
  oss)
    sleep 3
    lctl ping "${MGS_IP}@tcp" || true
    echo
    lctl dl || true
    ;;
  client)
    sleep 3
    lctl ping "${MGS_IP}@tcp" || true
    echo
    lfs df -h /mnt/lustre || true
    ;;
esac

echo
echo "Repeat on the other nodes with their NODE_NAME / NODE_IP / NODE_ROLE."

Run in order: mgs_mds first, then both OSS nodes (with OSS_INDEX=0 and OSS_INDEX=1 respectively — that controls the OST index range so OST IDs don’t collide), then the client. Once the client mounts /mnt/lustre, the smoke test in the script sets a -c -1 stripe (use all OSTs) on /mnt/lustre/striped, after which a dd against a file in that directory should split the write across all four OSTs. Watch iostat -x 1 on each OSS during the dd — every OSS should show similar await and similar wMB/s. Unbalanced writes mean either the stripe pattern landed on a subset of OSTs (check lfs getstripe) or one OSS is misconfigured.

Two operational gotchas worth knowing before you put real users on the cluster. First, recovery after a server reboot is not instant. When an OSS comes back, all clients with open files have to reconnect within the recovery window (obd_recovery_time, default 150 s) — if a client misses the window, it gets -EIO on the open files. Tune obd_recovery_time_soft and obd_recovery_time_hard based on your client count. Second, the MDS is the choke point on metadata-heavy workloads. A find /mnt/lustre -type f on a filesystem with hundreds of millions of files will queue against a single MDS thread — this is why production Lustre installations grow to multiple MDTs (DNE phase 2, distributed namespace) but a single MDT is fine until you cross the ten-million-file mark.

ZFS-backed OSTs let you do something ldiskfs cannot: snapshot an OST in place and rsync the snapshot somewhere else for offline analysis without locking the live filesystem. Use this for point-in-time backups (zfs snapshot lustre-ost0/ost0@daily-$(date +%F)) and prune with zfs destroy. The MDT can be snapshotted the same way — both together give you a consistent point-in-time backup of the entire filesystem, which is what makes the ZFS choice over ldiskfs worth the small write-amplification cost.

For a Lustre or BeeGFS cluster you don’t have to operate yourself, our team designs and runs parallel filesystem tiers under environment management on top of cloud compute — start a scoping call if you’d like us to design, build, and operate the HPC storage tier.