如何让ArangoDB完全使用Vultr多块存储驱动器存储数据
Alright, I’ve helped folks set up ArangoDB with multiple block storage drives on Vultr before, so let’s get this sorted for you. The goal here is to make ArangoDB ignore the server’s default disk entirely, use your first block storage until it’s full, then automatically switch to the second one. Here’s how to do it step by step:
First, confirm both drives are mounted and accessible. Let’s say you’ve mounted them at /mnt/block1 and /mnt/block2 (adjust these paths to match your actual setup):
- Run
df -hto verify they show up with available space. - Give the ArangoDB user full access to these directories:
sudo chown -R arangodb:arangodb /mnt/block1 /mnt/block2 - Create dedicated data folders on each drive for ArangoDB:
sudo mkdir -p /mnt/block1/arangodb-data /mnt/block2/arangodb-data
ArangoDB natively supports spreading data across multiple directories, and it will automatically fill the first directory completely before using the next one—exactly what you need.
Edit the Main Configuration File
Find your ArangoDB config file (usually /etc/arangodb3/arangod.conf on Debian/Ubuntu, or /etc/arangodb/arangod.conf on RHEL/CentOS):
- Open it with your favorite editor:
sudo nano /etc/arangodb3/arangod.conf - Locate the
[database]section. Comment out any existingdirectoryline, then add thedirectoriessetting pointing to your two data folders:[database] # directory = /var/lib/arangodb3 # Comment this out directories = [ "/mnt/block1/arangodb-data", "/mnt/block2/arangodb-data" ] - Save and exit the file.
Validate the Config
Make sure you didn’t make any typos by running:
arangod --check-config
If you don’t see any errors, you’re good to go.
If ArangoDB was already using the default server disk, you’ll need to move that data to your first block storage:
- Stop the ArangoDB service first:
sudo systemctl stop arangodb3 - Copy all existing data to the first block storage folder:
sudo cp -a /var/lib/arangodb3/* /mnt/block1/arangodb-data/ - Backup the old default directory just in case:
sudo mv /var/lib/arangodb3 /var/lib/arangodb3.bak
- Fire up the service again:
sudo systemctl start arangodb3 - Check if it’s running properly:
sudo systemctl status arangodb3 - To test the failover, start writing some large datasets and monitor
/mnt/block1’s space usage withdf -h. Once it’s full, ArangoDB will automatically start storing new data on/mnt/block2.
- Persistent Mounts: Make sure your block storage drives auto-mount on server reboot by adding entries to
/etc/fstab. Useblkidto get your drive UUIDs, then add lines like this (adjust UUIDs and filesystem type to match yours):UUID=abc123-xyz /mnt/block1 ext4 defaults 0 2 UUID=def456-uvw /mnt/block2 ext4 defaults 0 2 - Monitor Space: Set up alerts for when
/mnt/block1reaches ~90% capacity—this gives you time to add a third block storage drive if you need to go beyond 20TB total. - Performance Check: Ensure your server and block storage are in the same Vultr region to avoid slow network latency that can impact ArangoDB’s speed.
内容的提问来源于stack exchange,提问作者itsezc

