Hướng dẫn chi tiết cài đặt và cấu hình Lustre File System

Giới thiệu

Lustre là một file system phân tán hiệu năng cao, thường được sử dụng trong các môi trường HPC (High Performance Computing). Bài viết này sẽ hướng dẫn chi tiết cách cài đặt và cấu hình Lustre trên RHEL 8.9.

Kiến trúc của Lustre

Lustre có 3 thành phần chính:

+-------------+     +-------------+     +-------------+
|     MGS     |     |    MDS     |     |    OSS     |
|  Metadata   |     |  Metadata  |     |   Object   |
|  Management |     |  Server    |     |   Storage  |
+-------------+     +-------------+     +-------------+
       |                  |                  |
       v                  v                  v
   +-------+         +-------+         +-------+
   |  MGT  |         |  MDT  |         |  OST  |
   +-------+         +-------+         +-------+
  • MGS (Management Server): Quản lý cấu hình cho toàn bộ hệ thống Lustre
  • MDS (Metadata Server): Quản lý metadata của files (tên, permissions, etc)
  • OSS (Object Storage Server): Lưu trữ dữ liệu thực tế của files

Yêu cầu hệ thống

  • RHEL 8.9 (Server không GUI)
  • CPU: tối thiểu 2 cores
  • RAM: tối thiểu 4GB
  • Ổ cứng:
  • OS: 20GB
  • Lustre storage: 100GB+
  • Network: Static IP

Các bước cài đặt

Bước 1 – Chuẩn bị hệ thống

Đầu tiên, tắt firewall và SELinux:

# Tắt firewall
systemctl disable firewalld
systemctl stop firewalld
systemctl mask firewalld

# Tắt SELinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
reboot

Bước 2 – Cài đặt ZFS

Thêm repositories và cài đặt ZFS:

# Enable repos
subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms

# Cài EPEL
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

# Cài ZFS repo
dnf install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm

# Cài đặt ZFS
dnf install kernel-devel zfs

Bước 3 – Cài đặt Lustre

Tạo file repo cho Lustre:

[lustre-server]
name=lustre-server
baseurl=https://downloads.whamcloud.com/public/lustre/lustre-2.15.4/el8.9/server/
exclude=*debuginfo*
enabled=0
gpgcheck=0

Bước 4 – Cài đặt các gói Lustre:

dnf --enablerepo=lustre-server install lustre-dkms lustre-osd-zfs-mount lustre

Bước 5 – Cấu hình File System

Ví dụ cấu hình 2 file systems: “users” và “projects”

File System Layout:
-------------------------
/users/
  ├── MDT0 (2GB)
  ├── OST0 (16GB) 
  ├── OST1 (16GB)
  ├── OST2 (16GB)
  └── OST3 (16GB)

/projects/
  ├── MDT0 (2GB) 
  ├── OST0 (16GB)
  ├── OST1 (16GB) 
  ├── OST2 (16GB)
  └── OST3 (16GB)

Tạo Logical Volumes

# Tạo Volume Group
pvcreate /dev/sdb
vgcreate lustre /dev/sdb

# Tạo LV cho MGT
lvcreate -L 1G -n mgt lustre

# Tạo LV cho users
lvcreate -L 2G -n users_mdt0 lustre
lvcreate -L 16G -n users_ost0 lustre
lvcreate -L 16G -n users_ost1 lustre
lvcreate -L 16G -n users_ost2 lustre 
lvcreate -L 16G -n users_ost3 lustre

# Tạo LV cho projects 
lvcreate -L 2G -n projects_mdt0 lustre
lvcreate -L 16G -n projects_ost0 lustre
lvcreate -L 16G -n projects_ost1 lustre
lvcreate -L 16G -n projects_ost2 lustre
lvcreate -L 16G -n projects_ost3 lustre

Kiểm tra hoạt động

Sau khi cấu hình xong, kiểm tra:

  • ZFS pools:
zpool list
  • Mount points:
mount | grep lustre
  • Trạng thái targets:
lfs check servers

Lưu ý quan trọng

  • Luôn backup dữ liệu trước khi thực hiện thay đổi lớn
  • Đảm bảo đồng bộ thời gian giữa các server bằng NTP
  • Theo dõi logs tại /var/log/lustre
  • Kiểm tra định kỳ hiệu năng của hệ thống

Kết luận

Lustre là một file system phức tạp nhưng mạnh mẽ. Việc cài đặt đúng cách sẽ giúp bạn có một hệ thống lưu trữ hiệu quả cho môi trường HPC.

Nếu có thắc mắc hoặc cần hỗ trợ thêm, hãy để lại comment bên dưới.

Bài viết được tổng hợp từ kinh nghiệm thực tế và tài liệu chính thức của Lustre.

Bài viết gần đây

spot_img

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Đăng ký nhận thông tin bài viết qua email