Skip to content

Surajkumar4-source/Luster-Filesystem-Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 

Repository files navigation

LustreFS Setup Implementation


Introduction:

The Lustre File System is a high-performance distributed file system designed for large-scale data storage and processing, widely used in environments like high-performance computing (HPC) clusters. Lustre provides scalable performance by distributing data across multiple storage devices while maintaining consistency and reliability. Its architecture allows for the parallel processing of large datasets, making it a suitable choice for applications that require fast data access and processing.

Architecture Overview:

Lustre is based on a client-server architecture, with multiple components working in tandem to manage data storage and retrieval across the network:

1. Metadata Server (MDS): The MDS is responsible for managing file metadata such as file names, directory structures, and file permissions. It maintains the directory tree and file attributes but does not store the file data itself.

2. Object Storage Server (OSS): The OSS manages the storage of file data. It interacts with Object Storage Targets (OSTs), which are physical storage devices (such as hard drives or SSDs). The OSS handles file reads and writes at the block level, ensuring efficient data distribution and retrieval.

3. Client: The Lustre client interacts with the MDS and OSS to access files stored in the Lustre system. Clients are responsible for requesting metadata from the MDS and data from the OSS. They cache file data locally to reduce network traffic and improve performance.

4. Object Storage Target (OST): An OST is a storage device managed by an OSS. It is responsible for storing actual file data in blocks, and it is distributed across multiple OSTs to provide scalability and fault tolerance.

5. Management Server (MGS): The MGS is used for configuration management and maintaining the Lustre configuration database. It stores important system parameters and configurations that the MDS and OSS refer to for managing the file system.


Key Features:

  • Scalability: Lustre can scale out to support thousands of nodes and petabytes of data storage, making it suitable for massive data centers and high-performance computing environments.

  • High Throughput: By distributing data across multiple servers and clients, Lustre enables parallel access to data, increasing throughput and reducing latency.

  • Fault Tolerance: Lustre supports redundancy and failover mechanisms to ensure data availability and integrity in case of hardware failures.

  • POSIX Compliance: Lustre provides POSIX-compatible file system semantics, making it easy to use for applications that require a standard file system interface.

  • Parallel I/O: Lustre's ability to perform parallel input/output operations allows for high-performance data access and manipulation, essential for applications like scientific simulations, big data analytics, and machine learning.

Use Cases:

  • High-Performance Computing (HPC): Lustre is widely used in HPC clusters, where large-scale data processing and parallel computation are essential.

  • Big Data Analytics: Lustre is well-suited for applications that require fast access to large datasets, such as big data processing frameworks.

  • Scientific Research: Researchers in fields such as genomics, physics, and climate modeling use Lustre for managing large amounts of experimental data.

  • Cloud Storage: Lustre can be used to implement cloud storage solutions that require high-performance and scalable storage for virtualized environments.

Conclusion:

The Lustre File System provides a robust, scalable, and high-performance solution for managing and processing large datasets. Its distributed architecture enables parallel processing, fault tolerance, and scalability, making it the go-to solution for high-performance computing clusters, big data analytics, and scientific research.


File System Comparison: Lustre, HDFS, NFS, GlusterFS, PVFS

Here we compares the features of various distributed file systems: Lustre, HDFS, NFS, GlusterFS, and PVFS. Each of these file systems has unique characteristics that make them suitable for different use cases, especially in high-performance computing (HPC), big data analytics, and general-purpose file sharing.

File System Comparison Table

Feature Lustre HDFS NFS GlusterFS PVFS
Architecture Distributed, Client-Server, with MDS (Metadata Server) and OSS (Object Storage Server) Master-Slave, with NameNode (metadata) and DataNodes (storage) Client-Server, with centralized server storing data Distributed, peer-to-peer with no central metadata server Distributed, Client-Server architecture with Metadata Servers
Data Storage Data is split across multiple Object Storage Targets (OSTs) Data is stored across multiple DataNodes in blocks Data is stored on a single server, shared over the network Data is distributed across multiple nodes with replication and volume management Data is distributed across multiple storage nodes, optimized for parallel I/O
Scalability Highly scalable for petabytes of data, used in large HPC systems Scales to large clusters, but designed primarily for big data applications Limited scalability, typically used for smaller networks Highly scalable, capable of handling both small and large-scale deployments Scalable for parallel I/O, typically used in scientific computing and HPC
Performance High throughput and low-latency due to parallel I/O Optimized for large, sequential read and write operations in big data apps Moderate performance, suitable for general-purpose file sharing Good performance for both read and write operations, optimized for both small and large files Optimized for high-throughput and low-latency parallel access in HPC environments
Fault Tolerance Supports failover and redundancy with RAID, replication Provides replication of data blocks for fault tolerance Limited fault tolerance, depends on the server's reliability Provides replication, self-healing, and automatic failover Supports replication and data recovery in case of node failure
Data Consistency POSIX compliant with strong consistency for metadata Strong consistency for metadata but relaxed consistency for data blocks Strong consistency for file data and metadata Provides tunable consistency, including eventual consistency and strong consistency modes Provides strong consistency and ensures integrity in parallel file operations
Use Case High-performance computing, big data analytics, scientific research Big data processing, especially for MapReduce-based tasks File sharing in small to medium-sized networks General-purpose file storage, cloud storage, scalable NAS for enterprises and virtualized environments High-performance computing (HPC), scientific research, and large-scale data analysis

Key Differences:

  • Lustre: Suited for high-performance computing (HPC) with massive data throughput and scalability.
  • HDFS: Focused on big data processing in Hadoop ecosystems, optimized for sequential reads and writes.
  • NFS: A general-purpose file system for sharing files over a network in smaller setups.
  • GlusterFS: A scalable, distributed file system suitable for cloud storage, virtualized environments, and general-purpose use.
  • PVFS: Primarily designed for high-performance parallel I/O in scientific computing and HPC environments, offering strong consistency and optimized performance for parallel workloads.


Key prerequisites for the Lustre setup:

  • System Requirements: Use CentOS 8 or later on all nodes (MDS, OST, and client).

  • Network: Ensure all nodes have unique IPs and can communicate with each other

  • Software: Install Lustre, ZFS, kernel headers, and necessary modules (kmod-lustre, lustre-client, lustre-server).

  • SELinux & Firewall: Disable SELinux (SELINUX=disabled) and stop/disable the firewall (systemctl stop firewalld).

  • Disk Setup: Partition and format disks for ZFS and Lustre (zpool create, mkfs.lustre).

  • Lustre Configuration: Configure Lustre server (MDS) and storage (OST), then mount the file system.

  • Client Setup: Install Lustre client, configure network, and mount the Lustre file system.

  • Verification: Use Lustre commands (lctl, lfs) to verify setup.



******** Implementation Steps ********




Host Configuration

Add the following entries to the /etc/hosts file on all nodes to ensure proper hostname resolution:

echo "192.168.230.142 node1" | sudo tee -a /etc/hosts
echo "192.168.230.143 node2" | sudo tee -a /etc/hosts
echo "192.168.230.144 node3" | sudo tee -a /etc/hosts
echo "192.168.230.145 client" | sudo tee -a /etc/hosts

Server Configuration

Metadata Server (MDS)

  1. Prepare the environment:
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
systemctl stop firewalld
systemctl disable firewalld
yum install -y nano
dnf config-manager --set-enabled powertools
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm
nano /etc/selinux/config
dnf install kernel-headers kernel-devel
dnf upgrade kernel
reboot
  1. Install and configure ZFS:
dnf install zfs
modprobe -v zfs
  1. Add Lustre repository and install Lustre packages:
echo "[lustre-server]
name=lustre-server
baseurl=https://downloads.whamcloud.com/public/lustre/lustre-2.15.4/el8.9/server/
exclude=*debuginfo*
enabled=1
gpgcheck=0" | sudo tee /etc/yum.repos.d/lustre.repo
dnf install -y lustre-dkms lustre-osd-zfs-mount lustre kmod-lustre
modprobe -v lustre

lsmod | grep lustre       # for verification
  1. Prepare the storage:
lsblk
parted /dev/nvme0n2 mklabel gpt
parted -a optimal /dev/nvme0n2 mkpart primary 0% 100%
zpool create mds_pool /dev/nvme0n2p1
zfs create mds_pool/mdt0
zfs set atime=off mds_pool/mdt0
zpool list
umount /mds_pool/mdt0
umount /mds_pool
mkfs.lustre --reformat --mdt --fsname=lustrefs --mgs --index=0 --backfstype=zfs mds_pool/mdt0
mkdir /mnt/mdt0/
mount -t lustre mds_pool/mdt0 /mnt/mdt0


lctl dl                                     # for verification
lctl get_param -n health_check              # for verification
  1. Configure the network:
nano /etc/modprobe.d/lnet.conf
# Add: options lnet networks="tcp0(ens33)"        # Change with your interface    
modprobe lnet
lsmod | grep lnet
lctl network up
lctl ping <MGS-SERVER-IP>@tcp0      # Change with your server IP

Object Storage Target (OST) Servers

  • Repeat the following steps for each OST server:
  1. Prepare the environment:
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
systemctl stop firewalld
systemctl disable firewalld
yum install -y nano
dnf config-manager --set-enabled powertools
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm
nano /etc/selinux/config
dnf install kernel-headers kernel-devel
dnf upgrade kernel
reboot
  1. Install and configure ZFS:
dnf install zfs
modprobe -v zfs
  1. Add Lustre repository and install Lustre packages:
echo "[lustre-server]
name=lustre-server
baseurl=https://downloads.whamcloud.com/public/lustre/lustre-2.15.4/el8.9/server/
exclude=*debuginfo*
enabled=1
gpgcheck=0" | sudo tee /etc/yum.repos.d/lustre.repo
dnf install -y lustre-dkms lustre-osd-zfs-mount lustre kmod-lustre
modprobe -v lustre
  1. Prepare the storage:
lsblk
parted /dev/nvme0n2 mklabel gpt
parted -a optimal /dev/nvme0n2 mkpart primary 0% 100%
zpool create ost_pool1 /dev/nvme0n2p1
zfs create ost_pool1/ost0
zfs set atime=off ost_pool1/ost0
umount ost_pool1/ost0
umount ost_pool1
mkfs.lustre --ost --fsname=lustrefs --reformat --mgsnode=192.168.230.142@tcp --index=0 --backfstype=zfs ost_pool1/ost0
mkdir -p /mnt/ost0
mount -t lustre ost_pool1/ost0 /mnt/ost0

Client Configuration

  1. Prepare the environment:
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
systemctl stop firewalld
systemctl disable firewalld
yum install -y nano
dnf config-manager --set-enabled powertools
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
nano /etc/selinux/config                             # SELINUX=disabled
dnf install kernel-headers kernel-devel
dnf upgrade kernel
reboot
  1. Add Lustre repository and install Lustre client:
echo "[lustre-client]
name=lustre-client
baseurl=https://downloads.whamcloud.com/public/lustre/lustre-2.15.4/el8.9/client/
exclude=*debuginfo*
enabled=1
gpgcheck=0" | sudo tee /etc/yum.repos.d/lustre.repo
dnf install -y lustre-client lustre-client-dkms kmod-lustre-client
modprobe lustre
  1. Configure the network:
nano /etc/modprobe.d/lnet.conf
# Add: options lnet networks="tcp0(ens33)"
modprobe lnet
lsmod | grep lnet
lctl network up
lctl ping <MGS-SERVER>@tcp0
  1. Mount the Lustre file system:
mkdir /mnt/lustre
mount -t lustre <MGS-SERVER>@tcp0:/lustrefs /mnt/lustre
lctl dl
lfs check servers
lfs osts



Conclusion

This setup provides an implementation of the Lustre File System, a high-performance, scalable, distributed file system designed for large-scale storage in high-performance computing (HPC) environments. The implementation is aimed at demonstrating the key concepts of Lustre, including its architecture, data storage mechanisms, and fault tolerance.

Through this implementation , I have explored:

  • Lustre's Architecture: How the system is divided into Metadata Servers (MDS) and Object Storage Servers (OSS) to efficiently handle large volumes of data.
  • Parallel I/O Operations: The ability of Lustre to support high-throughput and low-latency operations, making it suitable for environments that require fast data access and large-scale parallel processing.
  • Scalability and Fault Tolerance: How Lustreโ€™s design supports horizontal scalability and high availability with built-in redundancy, ensuring data integrity and continuous service in case of node failures.

This implementation serves as a foundation for understanding the Lustre File System's capabilities and its suitability for handling demanding workloads in scientific computing, big data analysis, and high-performance environments. For further optimization or scaling, additional features like advanced fault tolerance and data replication can be explored.




******** Implementation Screenshoots ********



1



2



2 1



2 2



3 dnf



4



5



6



7



7



8



9



10



interface setup



lctl dl mount



health check



11



luster start and status



12  final final







๐Ÿ‘จโ€๐Ÿ’ป ๐“’๐“ป๐“ช๐“ฏ๐“ฝ๐“ฎ๐“ญ ๐“ซ๐”‚: Suraj Kumar Choudhary | ๐Ÿ“ฉ ๐“•๐“ฎ๐“ฎ๐“ต ๐“ฏ๐“ป๐“ฎ๐“ฎ ๐“ฝ๐“ธ ๐““๐“œ ๐“ฏ๐“ธ๐“ป ๐“ช๐“ท๐”‚ ๐“ฑ๐“ฎ๐“ต๐“น: csuraj982@gmail.com


About

LustreFS is a high-performance distributed file system for HPC. It has MDS, OSS, and clients for parallel data access. Setup involves ZFS, networking, and Lustre configs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors