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 firewalldIf your firewall status is "active", you can disable the firewall:
systemctl stop firewalld
systemctl disable firewalldOr 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 --reloadAll 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
All nodes in a RustFS distributed deployment must maintain synchronized clocks. RustFS relies on timestamps for request signing, object versioning, distributed locking, and replication. Significant clock drift between nodes can cause:
- Request signing failures — S3 signature verification depends on accurate timestamps.
- Replication and consistency issues — Clock skew can lead to stale or conflicting object versions.
- Lock contention problems — Distributed locks use timestamps for lease expiration.
- Service startup failures — RustFS refuses to start if clock skew between nodes exceeds safe thresholds.
Clock drift between any two nodes should not exceed 15 minutes. For production environments, we recommend keeping drift under 1 second.
Recommended NTP Tools
Use any of the following time synchronization services on every node. Choose one and configure it consistently across the deployment.
chrony (Recommended)
chrony is the preferred NTP implementation for modern Linux distributions. It synchronizes faster and handles intermittent network connectivity better than legacy ntpd.
Install chrony:
# RHEL / CentOS / Rocky Linux
sudo dnf install chrony -y
# Ubuntu / Debian
sudo apt install chrony -yEdit the configuration file /etc/chrony.conf (RHEL) or /etc/chrony/chrony.conf (Debian/Ubuntu) to point to your preferred NTP servers:
server time1.google.com iburst
server time2.google.com iburst
server time3.google.com iburst
server time4.google.com iburstReplace the server addresses with your organization's internal NTP servers if available. Using
iburstspeeds up initial synchronization.
Enable and start the service:
sudo systemctl enable chronyd
sudo systemctl start chronydsystemd-timesyncd
systemd-timesyncd is a lightweight SNTP client built into systemd-based distributions. It is suitable for environments where a full NTP daemon is not required.
Edit /etc/systemd/timesyncd.conf to configure NTP servers:
[Time]
NTP=time1.google.com time2.google.com time3.google.com time4.google.com
FallbackNTP=0.pool.ntp.org 1.pool.ntp.orgEnable and start the service:
sudo timedatectl set-ntp true
sudo systemctl enable systemd-timesyncd
sudo systemctl start systemd-timesyncdntpd (Legacy)
The classic ntpd from the NTP reference implementation is still widely available. Use chrony instead unless your environment specifically requires ntpd.
# RHEL / CentOS / Rocky Linux
sudo dnf install ntp -y
# Ubuntu / Debian
sudo apt install ntp -yEdit /etc/ntp.conf to set your NTP servers, then enable and start:
sudo systemctl enable ntpd
sudo systemctl start ntpdVerifying Time Synchronization
After configuring your NTP service, verify synchronization on each node.
Check the system clock status:
timedatectl statusThe output should show System clock synchronized: yes and NTP service: active.
For chrony, use the following command to check detailed synchronization status:
chronyc trackingKey fields to verify:
- Leap status — Should be
Normal(notNot synchronised). - System time — The offset from the reference server. Should be close to
0.000000000 seconds. - Root delay — Round-trip time to the reference server.
To list the current NTP sources and their status:
chronyc sources -vColumns to watch:
*— The currently selected synchronization source.+— Other acceptable sources.-— Sources rejected by the selection algorithm.?— Sources whose connectivity is in question.
For ntpd, use:
ntpq -pVerifying Cross-Node Clock Consistency
After all nodes are synchronized, verify that clocks are consistent across the cluster. On each node, compare timestamps:
# Run on each node and compare the output
date -u '+%Y-%m-%d %H:%M:%S'For a more precise comparison, install sshpass and run:
for host in node1 node2 node3 node4; do
echo -n "$host: "
ssh "$host" date -u '+%Y-%m-%d %H:%M:%S.%N'
doneThe difference between any two nodes should be negligible (under 1 millisecond in a well-configured environment).
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
fallocateAPI. 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 diskFormat each data disk:
sudo mkfs.xfs -i size=512 -n ftype=1 -L RUSTFS0 /dev/sdbFormatting 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 -aConfigure Service User
We recommend running RustFS as a dedicated user without login permissions.
- Keep the default account: The default user and group in the service unit are
rootandroot; no changes are needed if you use them. - 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
UserandGroupin/etc/systemd/system/rustfs.servicetorustfs-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
- 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
EOFThe service reads RUSTFS_VOLUMES and the other settings from /etc/default/rustfs, which is mode-specific — your deployment mode page shows the exact content.
- Reload the service configuration
sudo systemctl daemon-reloadNext Steps
Return to your deployment mode page to configure the environment file and start the service: