Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Backup to NFS Mount Questions

Discussion in 'Data Protection' started by ronaldst, May 13, 2018.

  1. ronaldst

    ronaldst Well-Known Member

    Joined:
    Feb 22, 2016
    Messages:
    51
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    I am questioning my current backup configuration and am looking at some other alternatives to improve it.

    Current backup configuration
    I currently backup data to local directory /backup and two offsite locations (FTP + Amazon S3). My backup type is Compressed, and I run 6 daily backups (6 retention) + 1 weekly (2 retention). I have Retain backups in the default backup directory enabled, simply because users finds it helpful to be able to restore daily backups from their cPanel. It's such an awesome feature.

    The main issue with this setup is storage space in /backup. As of now /backup is 128GB and increasing, and this just isn't optimal for much longer.

    NFS Storage
    I got dedicated servers at OVH and these come with FTP/NFS/CIFS backup storage. I've yet to utilize this, but is something I want to implement. I am looking at options to use this storage for /backup, mainly to maintain the restore functions in users cPanels.

    On my testserver I mounted the OVH storage (NFS/TCP) to /backup-nfs, and changed the Default Backup Directory in WHM Backup Configuration. I transferred about 10GB worth of files to the server and ran the backup script to see if this actually works. And it does, completed 3 runs with no errors.

    Is this a viable option?

    I'm not currently worried about the security of the transfers, as the storage is within the same LAN structure, and connections are locked to pre-defined IP addresses. Should I be?

    Optimal solution
    I do not want to loose the function Retain backups in the default backup directory offers. Users benefit greatly being able to restore daily backups from their cPanel, and it's something I get great feedback from. Users rarely need a full month of "live" retention though, 1 weekly backup + 3 daily might be sufficient.

    The optimal solution (in my mind) would be to retain a fewer amount of backups in /backup, while a larger amount of retention on external storage (FTP/Amazon S3). Are there any workarounds to do that?

    I noticed that the WHM Backup Configuration have an option within Additional Destinations called Additional Local Directory. If I use this option for the NFS mount /backup-nfs, and disable "Retain backups in the default backup directory /backup, will users be able to restore backups the way they can when using /backup?

    For the ones running servers with a large amount of user data, how do you solve this? Without the Retain backups in the default backup directory option, every backup restoration will have to be done manually by admin/support, and isn't very efficient.

    Incremental backups could be an option to save space, but this seem hard to combine with external destinations not supporting incremental (like FTP or Amazon S3).
     
  2. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    93
    Likes Received:
    9
    Trophy Points:
    58
    Hi we do backups to nfs for the same space reasons.

    I don’t think you can use additional local directory as it’ll still back up locally first.

    We have the cpanel servers saving directly to the nfs server with incremental backups, they then copy the files to 2 remote locations.

    Our nfs is another vm in a vitalised environment on the same host, but I think nfs4 has better security.

    We restrict incoming ip’s on the nfs vm to justcthe host servers, then on the cpanel host servers allow the nfs.

    One thing, you may need to set no_root_squash in etc/exports, not usually recommended but without that we had permission errors especially if zipping the system files. Probably only affects incremental when system files are copied to remote.

    All in all it works well and solves the space issue on the cpanel vms.

    Unfortunately if you choose to retain the files on the nfs it’ll retain all of them, cpanel does not allow us to control what we retain.

    I guess you could create a cron script to delete some on the nfs?

    Hope this helps!
     
  3. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    836
    Likes Received:
    62
    Trophy Points:
    103
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
  4. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    93
    Likes Received:
    9
    Trophy Points:
    58
    Absolutely, cpanel doesn't support it, but for many years local backup space has been an issue.

    We virtualise servers to make better use of CPU resources to avoid leaving so much unused, so why have premium SSD and only be able to use half of it.
    Local backups are more problems than the risks of NFS. It'll check the local space at the beginning of the backup and fail the whole backup if not enough, how much is enough, if you use SSD on a 100mb connection, you need more as it backs up quicker than it transfers and crashes the server when full. At least with NFS that risk and management of space is removed.

    We can then have cpanel servers running at 80-90% capacity if required.

    OP another way which is more supported is to mount another drive to the cpanel server for backups (if you have a spare slot on dedicated) or a remote drive on virtual, but you need this for each VM whereas NFS mount can be shared - (different folders all allowed by IP)

    It's discussions like this which push development and ideas, so even though not supported, it's still a important area of hosting.
     
    cPanelLauren likes this.
  5. ronaldst

    ronaldst Well-Known Member

    Joined:
    Feb 22, 2016
    Messages:
    51
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    I am currently testing NFS mounting a backup directory now, and so far it seem to be working well.

    I am actually thinking that cPanel have not properly solved the challenges regarding backups with the current version of WHM. Being able to control the amount of locally stored backups is such a basic feature, and vital to space management on any server.

    Retention settings on remote destinations are working flawless, and different type of retentions can be set up for different types of backups.

    I am thinking that that retention settings of local and remote backups should be separated. Allow one type of retention on local storage, and another on remote storage.

    Alternatively, implementing a way of restoring backups from remote destinations, similar to the one available when files are stored in the local backup directory.

    I am thinking this would benefit most server setups using WHM, either being dedicated servers or virtual ones.

    Is there anything planned (within the development team) to update the backup system?
     
Loading...

Share This Page