Bobcares

Back Up and Restore DataStores on NFS | A Complete Guide

PDF Header PDF Footer

Learn how to back up and restore DataStores on NFS. Our NFS Support team is here to help you with your questions and concerns.

Back Up and Restore Data Stores on NFS | A Complete Guide

Back Up and Restore Data Stores on NFS | A Complete GuideNetwork File System is a widely used protocol for sharing files and directories across networked systems. It’s popular in enterprise environments and cloud-native deployments for its scalability and ease of integration.

However, backing up and restoring data in NFS environments requires careful planning to preserve data integrity, file permissions, and configuration settings.

Today, we will walk through the fundamentals of NFS, how to back up and restore NFS shares and permissions, and how to handle everyday challenges in NFS data management.

What is NFS?

NFS is a protocol that enables users to access files over a network just as if they were stored locally. Operating on a client-server model:

  • Server: Exports one or more directories, known as shares.
  • Client: Mounts these shares and interacts with them like local file systems.

Setting up an NFS share is straightforward. For instance, if you’re using a Debian system, here’s a helpful guide on exporting NFS shares in Debian that walks through the process.

NFS supports access control and security through various permission settings and configuration options, making it suitable for both small networks and large-scale infrastructures.

Backing Up NFS Share Data and Permissions

Proper backups of NFS shares ensure data availability and disaster recovery readiness. Here are the most effective ways to back up NFS data and permissions:

  • Tar and Rsync:

    Use these command-line tools to archive files or sync directories. Ensure we preserve permissions (`-p` for `rsync`, `–preserve-permissions` for `tar`).

  • Snapshot Tools:

    Filesystems like ZFS or Btrfs offer snapshot capabilities for point-in-time backups.

  • Backup Software:

    Tools like Bacula, Amanda, or Duplicity provide more advanced features, including incremental backups and encryption.

  • Automation:

    Use `cron` jobs or shell scripts to automate regular backups and integrate with remote storage solutions.

If you’re using Veeam in your environment, you can also explore how to back up NFS shares with Veeam, which offers step-by-step guidance for integrating Veeam with NFS storage systems.

Backing Up Data Stores on NFS

The backup process can include secrets and capability configurations when dealing with Kubernetes environments and NFS-backed data stores. Here’s a step-by-step process:

  1. First, backup Kubernetes Secrets:
    echo $(kubectl get secret rethink-secret -n $(kubectl get namespaces | grep arcsight | cut -d ' ' -f1) -o json | jq '.data["rethink-password"]' | sed 's/"//g') > rethink-secret-bkp
    echo $(kubectl get secret reporting-secret -n $(kubectl get namespaces | grep arcsight | cut -d ' ' -f1) -o json | jq '.data["reporting-password"]' | sed 's/"//g') > reporting-secret-bkp
  2. Then, undeploy capabilities:
    cd /opt/NFS_volume/arcsight-volume
  3. We can redeploy after backup depending on the update cycle to keep services functional.

Restoring NFS Share Data and Permissions

Follow these steps to restore NFS shares from a backup safely:

  1. Stop NFS Services on the server and unmount the shares from clients.
  2. Restore files and directories, preserving ownership and permissions.
  3. Then, restart the NFS service and remount the shares.
  4. Finally, verify access and security settings on the restored shares.

For virtual environments like Proxmox, check out this detailed tutorial on using NFS as a Proxmox backup server to streamline your storage strategy.

Restoring Kubernetes Data Stores

Here’s how to restore NFS-backed data stores in a Kubernetes environment:

  1. First, go to the backup directory:
    cd /opt/NFS_volume/arcsight-volume/backup
  2. Then, restore search data:
    rm -rf /opt/NFS_volume/arcsight-volume/search/*
    cp -R search/* /opt/NFS_volume/arcsight-volume/search
  3. Now, it is time to restore the management database:

    cd /opt/NFS_volume/arcsight-volume/mgmt/db/
    rm -rf h2.lock.db
    cp /opt/NFS_volume/arcsight-volume/backup/mgmt/db/h2.mv.db .
  4. Next, verify integrity:
    diff -r -s /opt/NFS_volume/arcsight-volume/mgmt/db/h2.mv.db /opt/NFS_volume/arcsight-volume/backup/mgmt/db/h2.mv.db
    diff -r -s /opt/NFS_volume/arcsight-volume/backup/search /opt/NFS_volume/arcsight-volume/search
  5. Then, reset directory permissions:
    chown 1999:1999 -R /opt/NFS_volume/arcsight-volume/
  6. Next, restore secrets:
    export RETHINK_SECRET=$(cat rethink-secret-bkp)
    kubectl get secret rethink-secret -n $(kubectl get namespaces | grep arcsight | cut -d ' ' -f1) -o json | jq '.data["rethink-password"]=env.RETHINK_SECRET' | kubectl apply -f -
    export REPORTING_SECRET=$(cat reporting-secret-bkp)
    kubectl get secret reporting-secret -n $(kubectl get namespaces | grep arcsight | cut -d ' ' -f1) -o json | jq '.data["reporting-password"]=env.REPORTING_SECRET' | kubectl apply -f -
  7. Now, restart Kubernetes pods:
    kubectl delete pods -n $(kubectl get namespaces | grep arcsight | cut -d ' ' -f1) –all
  8. Then, redeploy and validate. Make sure all pods are running:
    kubectl get pods –all-namespaces

Common Challenges and Best Practices

  • Challenges
    • Large data volumes can slow down backup and restore.
    • Cross-platform issues occur when different file systems or OS versions are involved.
    • Maintaining permissions and attributes is critical and often overlooked.
  • Solutions
    • Use incremental or differential backups to reduce time and storage.
    • Enable multi-threaded transfers for faster performance.
    • Choose compatible file systems (e.g., `ext4`, `xfs`) for smoother restores.
    • Leverage tools that understand NFS configurations, such as Bacula, Amanda, or ZFS/Btrfs.

An issue like “NFS returned a bad sequence ID error” can disrupt normal operations and backups. Learn how to troubleshoot the bad sequence ID error in NFS and maintain consistent file access.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

Whether we are managing a small NFS share or a Kubernetes-based data platform, having a reliable backup and restore strategy is important. With the right tools and procedures, we can ensure minimal downtime and maximum data integrity across the infrastructure.

In brief, our Support Experts demonstrated how to back up and restore DataStores on NFS.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

server management

Spend time on your business, not on your servers.

TALK TO US

Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF