Backing Up Product Data
Automated Backup: Using the ncc backup
Command
To make a complete backup of your Paragon Active Assurance system, first stop services as follows:
sudo ncc services stop --with-kafka --with-zookeeper --without-timescaledb
Then run the command
sudo ncc backup
Finally, restart services:
sudo ncc services start --with-kafka --with-zookeeper --without-timescaledb
The backup command takes backups of all the following:
- Main PostgreSQL database
- Plugin service PostgreSQL database
- Plugin service files
- RRD filescons
- TimescaleDB database
- TimescaleDB configuration files
- OpenVPN keys
- SSL certificates and keys
- Control Center configuration files
- Licenses
Options:
--without-rrd
creates a backup without the RRD files (paa_cc_rrd.tar.gz
)--without-timescaledb
creates a backup without the TimescaleDB database (paa_cc_timescaledb.tar.gz
)--without-configs
creates a backup without the Control Center configuration files (paa_cc_configs.tar.gz
)--without-db
creates a backup without the main and plugin service databases (paa_cc_postgres.sql
andpaa_cc_plugins.sql
)
The output file is a tarball named according to the pattern
paa_backup-version-yyyy-mm-dd_hh-mm-ss.tar.gz
.
These files serve as input to restoring the system with the ncc restore
command; see the chapter Restoring Product Data
from Backup.
Troubleshooting: Manual Backup
Should the ncc backup
command fail for some reason, you can achieve the
same result manually by following the steps in this section.
To make a consistent backup of your Paragon Active Assurance data, you need to stop all services accessing the database before starting the backup procedure. It is possible to make backups of a live system, but data consistency cannot then be guaranteed.
Proceed as follows:
-
Stop Paragon Active Assurance services:
sudo ncc services stop --with-kafka --with-zookeeper --without-timescaledb
-
Make backups according to the subsections below.
-
Start Paragon Active Assurance services:
sudo ncc services start --with-kafka --with-zookeeper --without-timescaledb
- Backing Up the Main PostgreSQL Database and Plugin Database
- Backing Up the RRD Files
- Backing Up Plugin Files
- Backing Up the TimescaleDB Database
- Backing Up the OpenVPN Keys
- Backing Up the SSL Certificates and Keys
- Backing Up the Licenses
- Backing Up the Configuration Files
Backing Up the Main PostgreSQL Database and Plugin Database
The plugin database is created along with the main PostgreSQL database, but it needs to be backed up separately.
Run these commands:
pg_dump -h localhost -U netrounds netrounds > cc_postgres.sql pg_dump -h localhost -U netrounds paa-plugins > paa_plugins.sql
The pg_dump
command will ask for a password which can be found in
/etc/netrounds/netrounds.conf
under "postgres database". The default
password is "netrounds".
To learn about advanced options of pg_dump
, such as compression, type
pg_dump --help
Alternatively, you may want to back up the database in binary format. If so, use this command:
pg_dump -h localhost -U netrounds -Fc netrounds > cc_postgres.binary pg_dump -h localhost -U netrounds -Fc paa-plugins > paa_plugins.binary
Backing Up the RRD Files
The RRD (round-robin database) files contain the Paragon Active Assurance measurement data.
-
For a small-scale setup (< 50 GB), use this backup command:
sudo tar -czf cc_rrd.tar.gz /var/lib/netrounds/rrd
-
For a large-scale setup (> 50 GB), making a tarball of the RRD files might take too long, and taking a snapshot of the volume can be a better idea. Possible solutions for doing this include: using a file system that supports snapshots, or taking a snapshot of the virtual volume if the server is running in a virtual environment.
Backing Up Plugin Files
Back up plugin files with the commands
sudo tar -czf paa_plugins.tar.gz /var/lib/netrounds/plugins sudo tar -czf paa_plugin_keys.tar.gz /etc/netrounds/plugin_keys
Backing Up the TimescaleDB Database
To back up the TimescaleDB database, you must first start it.
Backup of the TimescaleDB database also requires the timescaledb
service
related to the Streaming API to be enabled and running:
sudo ncc services enable timescaledb sudo ncc services start timescaledb
For more information on this API, see the document Streaming API Guide.
To back up the TimescaleDB database manually, run:
sudo /etc/netrounds/backup-restore-timescaledb.sh --backup <backup dir>
Backups of TimescaleDB data are stored in
/var/lib/netrounds/rrd/timescaledb/pgbackrest/repo/<backup
dir>
.
Backing Up the OpenVPN Keys
Use this command:
sudo tar -czf cc_openvpn.tar.gz /var/lib/netrounds/openvpn
Backing Up the SSL Certificates and Keys
This procedure creates a TAR archive that might contain duplicates as the same cert/key file may be mentioned in multiple configuration files.
-
Create a TAR archive
paa_cc_certs.tar
:export TAR_ARCHIVE="paa_cc_41_certs_and_secret.tar" sudo tar -cf "$TAR_ARCHIVE" --files-from /dev/null
-
Collect the secret key path:
- Open the file
etc/netrounds/netrounds.conf
. - Copy the value for the
SECRET_KEY_FILE
setting without single/double quotes (<SECRET_KEY_FILE value
>) -
Paste the value you just obtained at the end of this command:
sudo tar --append --file="$TAR_ARCHIVE" -C / <SECRET_KEY_FILE value>
- Open the file
-
Collect the certificate from the services configuration files:
- Open the file
/etc/netrounds/consolidated.yaml
. -
Copy the value
<cert path>
for bothssl-key
andssl-cert
directives, but only if they are uncommented and have a name different fromssl-cert-snakeoil
.Example:
- Copy this one:
/etc/certs/fullchain.pem
- Don't copy this one:
/etc/ssl/certs/ssl-cert-snakeoil.pem
- Copy this one:
-
Paste the value you just copied at the end of this command:
sudo tar --append --file="$TAR_ARCHIVE" -C / <cert path>
- Repeat the steps above for the files
/etc/netrounds/plugin.yaml
and/etc/netrounds/test-agent-gateway.yaml
.
- Open the file
-
Collect the certificates used by the Apache web server:
- Open the file
/etc/apache2/sites-available/netrounds-restol-standalone.conf
. - Copy the value
<cert path>
for bothSSLCertificateFile
andSSLCertificateKeyFile
directives, but only if they are uncommented and have a name different fromssl-cert-snakeoil
. -
Paste the value you just copied at the end of this command:
sudo tar --append --file="$TAR_ARCHIVE" -C / <cert path>
- Repeat the steps above for the file
/etc/apache2/sites-available/netrounds-ssl.conf
.
- Open the file
-
Compress the archive further with gzip and create the file
paa_cc_certs.tar.gz
:gzip "$TAR_ARCHIVE"
Backing Up the Licenses
Use this command:
sudo tar -czf cc_license.tar.gz /var/lib/netrounds/license
Backing Up the Configuration Files
Make copies of the following files:
/etc/apache2/sites-available/netrounds-ssl.conf
/etc/apache2/sites-available/netrounds.conf
/etc/netrounds/consolidated.yaml
/etc/netrounds/metrics.yaml
/etc/netrounds/netrounds.conf
/etc/netrounds/plugin.yaml
/etc/netrounds/probe-connect.conf
/etc/netrounds/restol.conf
/etc/netrounds/test-agent-gateway.yaml
/etc/netrounds/timescaledb.conf
/etc/openvpn/netrounds.conf
For example:
cp /etc/apache2/sites-available/netrounds-ssl.conf /etc/apache2/sites-available/netrounds-ssl.conf.old