Download PDF
Download page Back Up and Restore Using the Network File System Server.
Back Up and Restore Using the Network File System Server
You can back up the Virtual Appliance data to the Network File System (NFS) server. Follow these steps to back up the Virtual Appliance data:
Set Up the NFS Server
This section considers AlmaLinux OS as an example OS to install the NFS server. Follow these steps to install and configure the NFS server:
- Run the following commands to install the NFS server.
dnf install nfs-utils mkdir -p /mnt/nfs_share chown nobody:nobody /mnt/nfs_share chmod 777 -R /mnt/nfs_share/
CODE - Configure the NFS exports.
/mnt/nfs_share 10.0.203.0/24(rw,sync,no_subtree_check,no_root_squash) /mnt/nfs_share 10.0.202.0/24(rw,sync,no_subtree_check,no_root_squash)
CODE - Restart the NFS server:
systemctl restart nfs-server
CODE - Verify the NFS server status:
systemctl status nfs-server
CODE
Configure the NFS Parameters on Virtual Appliance
Edit the globals.yaml.gotmpl
file with the NFS server details:
# NFS parameters
nfs:
server: 10.0.203.142
path: /mnt/nfs_share
Configure the NFS Server on the globals.yaml.gotmpl
File
- Create a repository to back up the data in the NFS server.
You can create repository only for the Elasticsearch backup. By default, the
globals.yaml.gotmpl
file uses the repo3 repository for MySQL and PostgreSQL.appdcli run es_backup create-fs-repo virtual-appliance-repo-nfs
CODE - Enable the
fs
section for datastores to back up using the NFS server. Seeglobals.yaml.gotmpl
file.# Backup config for datastores backup: elasticsearch: fs: enabled: true storage: 5Gi
CODE# Backup config for datastores backup: postgresql: fs: enabled: true repoName: repo3 storage: 5Gipg-
CODE# Backup config for datastores backup: mysql: fs: enabled: true repoName: repo3 storage: 5Gi
CODE
Back Up the Virtual Appliance Data in the NFS Server
Snapshots capture the state of the datastore and can be used to restore data. You can store multiple snapshots in a single repository. The following commands stores the snapshots in the virtual-appliance-repo-nfs
repository.
Create a snapshot for each datastore:
appdcli run es_backup create-snapshot <repo-name> <snapshot-name>
Example
appdcli run es_backup create-snapshot virtual-appliance-repo-nfs es-snapshot
appdcli run pg_backup create-snapshot <repo-name> <snapshot-name>
Example
appdcli run pg_backup create-snapshot repo3 pg-snapshot
appdcli run mysql_backup create-snapshot <repo-name> <snapshot-name>
Example
appdcli run mysql_backup create-snapshot repo3 mysql-snapshot
Restore Snapshots from the NFS server
Use the snapshots that you have stored in NFS to restore the datastores.
- List the snapshots in the repository:
appdcli run es_backup list-snapshot <repo-name>
CODEExample
appdcli run es_backup list-snapshot virtual-appliance-repo-nfs
CODEappdcli run pg_backup list-snapshot <repo-name>
CODEExample
appdcli run pg_backup list-snapshot repo3
CODEappdcli run mysql_backup list-snapshot <repo-name>
CODEExample
appdcli run mysql_backup list-snapshot repo3
CODE - Restore the datastore by one of the snapshots:
appdcli run es_backup restore-snapshot <repo-name> <snapshot-name>
CODEExample
appdcli run es_backup restore-snapshot virtual-appliance-repo-nfs es_snapshot
CODEappdcli run pg_backup restore-snapshot <repo-name>
CODEExample
appdcli run pg_backup restore-snapshot repo3 pg_snapshot
CODEappdcli run mysql_backup restore-snapshot <repo-name>
CODEExample
appdcli run mysql_backup restore-snapshot repo3 mysql_snapshot
CODE
Delete the Snapshots from the NFS Server
If you no longer require the snapshot, you can delete the snapshot from NFS.
appdcli run es_backup delete-snapshot <repo-name> <snapshot-name>
Example
appdcli run es_backup delete-snapshot virtual-appliance-repo-nfs es_snapshot
appdcli run pg_backup delete-snapshot <repo-name>
Example
appdcli run pg_backup delete-snapshot repo3 pg_snapshot
appdcli run mysql_backup delete-snapshot <repo-name>
Example
appdcli run mysql_backup delete-snapshot repo3 mysql_snapshot