Comment to 'Sharing between 2 servers for storage. I am quickly running out ...'
  • Also a simple setup for Permanent NFS Setup for UNA APP on Debian

    NFS Server Setup

    1. Install NFS server:
    sudo apt update sudo apt install -y nfs-kernel-server 
    
    1. Create shared storage folder:
    sudo mkdir -p /mnt/storage sudo chown -R nobody:nogroup /mnt/storage sudo chmod 775 /mnt/storage 
    
    1. Configure exports:

    Edit /etc/exports:

    /mnt/storage 10.0.0.0/24(rw,sync,no_subtree_check,all_squash,anonuid=33,anongid=33)
    
    • 10.0.0.0/24 → your private network
    • all_squash, anonuid=33, anongid=33 → maps all files to www-data (uid 33) for proper UNA APP permissions
    1. Export the folder and start NFS:
    sudo exportfs -a sudo systemctl enable nfs-server sudo systemctl restart nfs-server 
    
    1. Optional firewall:
    sudo ufw allow from 10.0.0.0/24 to any port nfs 
    

    NFS Client Setup (UNA APP Server)

    1. Install NFS client:
    sudo apt update sudo apt install -y nfs-common 
    
    1. Create mount point for UNA APP:
    sudo mkdir -p /var/www/una/storage sudo chown www-data:www-data /var/www/una/storage sudo chmod 775 /var/www/una/storage 
    
    1. Test manual mount:
    sudo mount -t nfs <NFS_SERVER_IP>:/mnt/storage /var/www/una/storage 
    

    Check:

    df -h | grep storage 
    

    Make NFS Mount Permanent

    1. Edit /etc/fstab:
    <NFS_SERVER_IP>:/mnt/storage /var/www/una/storage nfs defaults,_netdev,auto 0 0
    
    • _netdev → ensures mount waits for network
    • auto → mounts automatically on boot
    1. Test fstab:
    sudo mount -a 
    

    No errors → mount will survive reboots.

    Summary

    • NFS storage mounted permanently at /var/www/una/storage
    • Fully compatible with UNA APP
    • Permissions mapped to www-data
    • No other services included – simple, scalable, and persistent


    💡 Recommendations for NFS Setup

    1. Use a dedicated disk
    • Always allocate a separate, empty disk for NFS storage.
    • Avoid using the same disk as the operating system.
    • This prevents I/O bottlenecks and ensures better performance.
    1. Keep workloads separate
    • Do not mount NFS on the OS disk.
    • Mixing operating system and storage workloads will slow down the entire system.
    1. Configure file descriptor limits
    • NFS and applications like UNA may open thousands of files simultaneously.
    • Increase nofile limits to avoid errors such as “Too many open files”.
    1. Use a private network
    • Isolate NFS traffic from public traffic (VLAN, VPN, or dedicated NIC).
    • This prevents slowdowns for your users and improves security.
    1. Plan for scalability
    • NFS is suitable for temporary or small-scale setups.
    • For long-term growth and higher performance, migrate to OpenStack Cinder or another distributed storage backend.

    ⚠️ Note:

    NFS is a simple and functional solution for temporary storage or basic setups. However, it does not scale well with multiple volumes or high traffic. If you want a cloud-ready setup, NFS can be a starting point, but the recommended long-term approach is OpenStack with a dedicated storage backend for performance and scalability.

    👉 In short: dedicate hardware for NFS, configure limits, isolate storage traffic, and use NFS as a stepping stone toward a scalable cloud infrastructure.

    ⚠️ IMPORTANT NOTICE

    • 🚨 These commands and configuration changes are for informational purposes or development.
    • 💾 They DO NOT represent an official setup guide.
    • ⚙️ Run them ONLY if you fully understand what they do.
    • ❗ Use at your own risk. Adjust if necessary.
    • 👉 This example is intended for advanced users only.

    ✨ Happy coding!