Linux Prerequisites and Service Setup

Common prerequisites, disk preparation, binary installation, and systemd service setup shared by all RustFS Linux deployment modes.

This page contains the prerequisites and service setup steps shared by all three Linux deployment modes — SNSD, SNMD, and MNMD. Complete these steps first, then return to your mode page to configure the environment file and start the service.

Operating System Version

We recommend Linux kernel version 4.x or later; versions 5.x/6.x achieve better I/O throughput and network performance. Ubuntu 22.04 and RHEL 8.x are both suitable for installing RustFS.

Firewall

Linux systems have firewalls enabled by default. Check the firewall status with:

systemctl status firewalld

If your firewall status is "active", you can disable the firewall:

systemctl stop firewalld
systemctl disable firewalld

Or allow the RustFS S3 port (9000) and console port (9001):

firewall-cmd --zone=public --add-port=9000/tcp --permanent
firewall-cmd --zone=public --add-port=9001/tcp --permanent
firewall-cmd --reload

All RustFS servers in a deployment must use the same listening port. If you use port 9000, every other server must also use port 9000.

Memory Requirements

RustFS requires at least 2 GB of memory for a test environment; production environments require a minimum of 128 GB of memory.

Time Synchronization

Tous les nœuds d'un déploiement distribué RustFS doivent maintenir des horloges synchronisées. RustFS s'appuie sur les horodatages pour la signature des requêtes, le versionnement des objets, le verrouillage distribué et la réplication. Une dérive significative de l'horloge entre les nœuds peut provoquer :

  • Échecs de signature de requête — La vérification des signatures S3 dépend d'horodatages précis.
  • Problèmes de réplication et de cohérence — Un décalage d'horloge peut entraîner des versions d'objets obsolètes ou conflictuelles.
  • Problèmes de contention de verrouillage — Les verrous distribués utilisent des horodatages pour l'expiration des baux.
  • Échecs de démarrage du service — RustFS refuse de démarrer si le décalage d'horloge entre les nœuds dépasse les seuils de sécurité.

La dérive d'horloge entre deux nœuds ne doit pas dépasser 15 minutes. Pour les environnements de production, nous recommandons de maintenir la dérive en dessous d'1 seconde.

Outils NTP recommandés

Utilisez l'un des services de synchronisation temporelle suivants sur chaque nœud. Choisissez un outil et configurez-le de manière cohérente sur l'ensemble du déploiement.

chrony (Recommandé)

chrony est l'implémentation NTP préférée pour les distributions Linux modernes. Il synchronise plus rapidement et gère mieux la connectivité réseau intermittente que l'ancien ntpd.

Installer chrony :

# RHEL / CentOS / Rocky Linux
sudo dnf install chrony -y

# Ubuntu / Debian
sudo apt install chrony -y

Modifiez le fichier de configuration /etc/chrony.conf (RHEL) ou /etc/chrony/chrony.conf (Debian/Ubuntu) pour pointer vers vos serveurs NTP préférés :

server time1.google.com iburst
server time2.google.com iburst
server time3.google.com iburst
server time4.google.com iburst

Remplacez les adresses serveur par les serveurs NTP internes de votre organisation, si disponibles. L'utilisation d'iburst accélère la synchronisation initiale.

Activer et démarrer le service :

sudo systemctl enable chronyd
sudo systemctl start chronyd

systemd-timesyncd

systemd-timesyncd est un client SNTP léger intégré aux distributions basées sur systemd. Il convient aux environnements où un démon NTP complet n'est pas nécessaire.

Modifiez /etc/systemd/timesyncd.conf pour configurer les serveurs NTP :

[Time]
NTP=time1.google.com time2.google.com time3.google.com time4.google.com
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org

Activer et démarrer le service :

sudo timedatectl set-ntp true
sudo systemctl enable systemd-timesyncd
sudo systemctl start systemd-timesyncd

ntpd (Ancien)

Le classique ntpd de l'implémentation de référence NTP est toujours largement disponible. Utilisez chrony à la place, sauf si votre environnement nécessite spécifiquement ntpd.

# RHEL / CentOS / Rocky Linux
sudo dnf install ntp -y

# Ubuntu / Debian
sudo apt install ntp -y

Modifiez /etc/ntp.conf pour définir vos serveurs NTP, puis activez et démarrez :

sudo systemctl enable ntpd
sudo systemctl start ntpd

Vérification de la synchronisation temporelle

Après avoir configuré le service NTP, vérifiez l'état de la synchronisation sur chaque nœud.

Vérifier l'état de l'horloge système :

timedatectl status

La sortie doit afficher System clock synchronized: yes et NTP service: active.

Pour chrony, utilisez la commande suivante pour un état détaillé de la synchronisation :

chronyc tracking

Champs clés à vérifier :

  • Leap status — Doit être Normal (pas Not synchronised).
  • System time — Le décalage par rapport au serveur de référence. Doit être proche de 0.000000000 seconds.
  • Root delay — Temps aller-retour vers le serveur de référence.

Lister les sources NTP actuelles et leur statut :

chronyc sources -v

Colonnes à surveiller :

  • * — La source de synchronisation actuellement sélectionnée.
  • + — Autres sources acceptables.
  • - — Sources rejetées par l'algorithme de sélection.
  • ? — Sources dont la connectivité est incertaine.

Pour ntpd :

ntpq -p

Vérification de la cohérence inter-nœuds

Après la synchronisation de tous les nœuds, vérifiez que les horloges sont cohérentes dans tout le cluster. Comparez les horodatages sur chaque nœud :

# Run on each node and compare the output
date -u '+%Y-%m-%d %H:%M:%S'

Pour une comparaison plus précise, installez sshpass et exécutez :

for host in node1 node2 node3 node4; do
  echo -n "$host: "
  ssh "$host" date -u '+%Y-%m-%d %H:%M:%S.%N'
done

Dans un environnement correctement configuré, la différence entre deux nœuds doit être négligeable (inférieure à 1 milliseconde).

Capacity Planning

When planning object storage capacity, we recommend considering:

  • Initial data volume: How much data do you plan to migrate or store at once? (e.g., 500 TB)
  • Data growth volume: Daily/weekly/monthly data growth capacity
  • Planning cycle: How long should this hardware planning last? (recommended: 3 years)
  • Your company's hardware iteration and update cycles.

Review EC Configuration to calculate usable capacity, understand the automatic parity defaults, and validate any explicit parity or erasure-set width before deployment.

Disk Planning

Because NFS generates phantom writes and lock issues under high I/O, NFS is prohibited as the underlying storage medium for RustFS. We strongly recommend JBOD (Just a Bunch of Disks) mode: expose physical disks directly and independently to the operating system, and let the RustFS software layer handle data redundancy and protection.

The reasons are as follows:

  • Better Performance: RustFS's Erasure Coding engine is highly optimized and reads/writes multiple disks concurrently, achieving higher throughput than hardware RAID controllers. Hardware RAID becomes a performance bottleneck.
  • Lower Cost: No expensive RAID cards needed, reducing hardware procurement costs.
  • Simpler Management: RustFS manages disks uniformly, simplifying storage layer operations and maintenance.
  • Faster Fault Recovery: The RustFS healing process is faster than a traditional RAID rebuild and has less impact on cluster performance.

We recommend NVMe SSDs as the storage medium for higher performance and throughput.

File System Selection

RustFS strongly recommends formatting all storage disks with the XFS file system. RustFS development and testing are based on XFS, ensuring optimal performance and stability. Avoid other file systems such as ext4, BTRFS, or ZFS, as they may cause performance degradation or unpredictable issues.

XFS suits RustFS's workload for three reasons:

  • High-concurrency I/O: XFS was designed for high performance and scalability. Its internal journaling and data structures (such as B+ trees) efficiently handle large numbers of parallel read/write requests, matching how RustFS shards large objects and reads/writes multiple disks in an erasure set in parallel.
  • Massive files and large file sizes: XFS is a 64-bit file system supporting extremely large files (up to 8 EB). Its metadata management stays efficient even with millions of files in a single directory — important because RustFS stores each object (or object version) as an independent file.
  • Space reservation: XFS provides an efficient fallocate API. RustFS uses it to reserve contiguous disk space before writing objects, avoiding the overhead of dynamic expansion and metadata updates during writes and minimizing file fragmentation.

For better disk discovery, we recommend using Label tags when formatting XFS file systems.

First, check the disk layout:

sudo lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 465.7G  0 disk
├─sda1        8:1    0   512M  0 part /boot/efi
└─sda2        8:2    0 465.2G  0 part /
nvme0n1           8:16   0   3.7T  0 disk  <-- if this is our format new disk
nvme1n1           8:32   0   3.7T  0 disk  <-- if this is our format new disk
nvme2n1          8:48   0   3.7T   0  disk

Format each data disk:

sudo mkfs.xfs  -i size=512 -n ftype=1 -L RUSTFS0 /dev/sdb

Formatting options:

  • -L <label>: Set a label for the file system for easier identification and mounting.
  • -i size=512: We recommend an inode size of 512 bytes, which benefits scenarios storing large numbers of small objects (metadata).
  • -n ftype=1: Enable ftype so the file system records file types in directory structures, improving operations such as readdir and unlink.

Mounting:

# write new line
vim /etc/fstab
LABEL=RUSTFS0 /data/rustfs0   xfs   defaults,noatime,nodiratime   0   0

#save & exit

# mount disk
sudo mount -a

Configure Service User

We recommend running RustFS as a dedicated user without login permissions.

  1. Keep the default account: The default user and group in the service unit are root and root; no changes are needed if you use them.
  2. Use a dedicated account: Create a user and group, then update the service unit accordingly.

The following example creates the user and group and grants access to the RustFS data directories (optional):

groupadd -r rustfs-user
useradd -M -r -g rustfs-user rustfs-user
chown rustfs-user:rustfs-user  /data/rustfs*
  • If you created the rustfs-user user and group, change User and Group in /etc/systemd/system/rustfs.service to rustfs-user.
  • Adjust /data/rustfs* to your actual mount directories.

Download the Installation Package

Install wget or curl first, then download and install the RustFS binary:

# Download address
wget https://dl.rustfs.com/artifacts/rustfs/release/rustfs-linux-x86_64-musl-latest.zip
unzip rustfs-linux-x86_64-musl-latest.zip
chmod +x rustfs
mv rustfs /usr/local/bin/

Configure the systemd Service

  1. Create the systemd service file
sudo tee /etc/systemd/system/rustfs.service <<EOF
[Unit]
Description=RustFS Object Storage Server
Documentation=https://rustfs.com/docs/
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
NotifyAccess=main
User=root
Group=root

WorkingDirectory=/usr/local
EnvironmentFile=-/etc/default/rustfs
ExecStart=/usr/local/bin/rustfs \$RUSTFS_VOLUMES

LimitNOFILE=1048576
LimitNPROC=32768
TasksMax=infinity

Restart=always
RestartSec=10s

OOMScoreAdjust=-1000
SendSIGKILL=no

TimeoutStartSec=120s
TimeoutStopSec=30s

NoNewPrivileges=true
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictRealtime=true

# service log configuration
StandardOutput=append:/var/log/rustfs/rustfs.log
StandardError=append:/var/log/rustfs/rustfs-err.log

[Install]
WantedBy=multi-user.target
EOF

The service reads RUSTFS_VOLUMES and the other settings from /etc/default/rustfs, which is mode-specific — your deployment mode page shows the exact content.

  1. Reload the service configuration
sudo systemctl daemon-reload

Next Steps

Return to your deployment mode page to configure the environment file and start the service:

On this page