Setting up a Solana Machine
This guide provides instructions for setting up a RAID 0 array with NVMe drives to optimize Solana's ledger storage. Adjust the steps according to your server's specific disk configuration.
Start by identifying the available NVMe disks on your system to ensure you're selecting the correct ones for the RAID array.
lsblk
This command will display a list of block devices. Identify which devices you plan to include in the RAID array.
Use the mdadm
command to create a RAID 0 array. Substitute the disk names based on the output from lsblk
.
Example:
sudo mdadm --create --force /dev/md0 --level=0 --raid-devices=<number_of_devices> /dev/nvme0n1 /dev/nvme0n2 /dev/nvme0n3 ...
Replace <number_of_devices>
with the count of NVMe drives used, and list each of them after the command. The above command creates a RAID 0 array on /dev/md0
.
Format the new RAID array to ext4
:
Example:
sudo mkfs.ext4 -F /dev/md0
Mount the formatted RAID array to the desired directory, such as /opt/solana/ledger
.
sudo mkdir -p /opt/solana/ledger
sudo mount /dev/md0 /opt/solana/ledger
If you plan to mount individual NVMe devices for other Solana data (e.g., accounts, snapshots), identify each device and mount them accordingly.
Example:
sudo mkdir -p /opt/solana/accounts
sudo mkdir -p /opt/solana/snapshots
sudo mount /dev/nvme0n1 /opt/solana/accounts
sudo mount /dev/nvme0n2 /opt/solana/snapshots
- Configuration Changes: Adjust the RAID level, device names, and mount points based on specific requirements and server configurations.
- Automatic Mounting: To ensure persistence across reboots, add entries to
/etc/fstab
for each mounted directory. - Verifying RAID Status: Use
cat /proc/mdstat
to check the RAID array status. - Safety and Backups: RAID 0 offers no redundancy. Regularly back up important data, as RAID 0 prioritizes speed over data protection.