Configuration backups¶
For more “lightweight” backup and restore operations, the scrut_conf_dump.sh
and scrut_conf_restore.sh
scripts (both located in /home/plixer/scrutinizer/database/utils
) can be used to target only the application/configuration data of a Plixer Scrutinizer instance, including:
User-added maps
Dashboards
IP groups
Saved reports
3rd-party integration settings
Configuration backups do not include any collected flow data.
Note
In distributed environments, the primary reporter regularly syncs application/configuration data to remote collectors. Only the configuration backup of the primary reporter is needed to perform a restore for the cluster.
scrut_conf_dump.sh
and scrut_conf_restore.sh
use Postgres’s pg_dump and pg_restore utils and respect the same set of environment variables:
Variable |
Description |
Default |
---|---|---|
|
Location of the backup file |
|
|
IP address or hostname of the PostgreSQL database |
|
|
Role/user used to connect to PGHOST |
|
|
The database to access at PGHOST |
|
Backing up configuration data¶
To create a backup of a Plixer Scrutinizer server’s current configuration data, follow these steps:
Stop the
httpd
andplixer_flow_collector
services:sudo /bin/systemctl stop httpd sudo /bin/systemctl stop plixer_flow_collector
Run the backup script.
To save the backup file to the default location:
~/scrutinizer/database/utils/scrut_conf_dump.sh
To use a custom location/filename:
mkdir /tmp/CONF_BACKUP_DIR touch /tmp/CONF_BACKUP_DIR/CONF_BACKUP.dump DUMP=/tmp/CONF_BACKUP_DIR/CONF_BACKUP.dump ~/scrutinizer/database/utils/scrut_conf_dump.sh
Restart the stopped services:
sudo /bin/systemctl start httpd sudo /bin/systemctl start plixer_flow_collector
Restoring configuration data¶
To restore configuration data to a Plixer Scrutinizer server from a backup file, follow these steps:
Stop the
httpd
andplixer_flow_collector
services:sudo /bin/systemctl stop httpd sudo /bin/systemctl stop plixer_flow_collector
Run the restore script.
To restore from the default backup location/file:
~/scrutinizer/database/utils/scrut_conf_dump.sh
To restore from a specified location/file:
PGHOST=SCRUTINIZER_IP DUMP=/tmp/CONF_BACKUP_DIR/CONF_BACKUP.dump ~/scrutinizer/database/utils/scrut_conf_restore.sh
Restart the stopped services:
sudo /bin/systemctl start httpd sudo /bin/systemctl start plixer_flow_collector
Resync the access table:
psql -c "SELECT setval(pg_get_serial_sequence('plixer.access', 'access_id'), COALESCE(max(access_id) + 1, 1), false) FROM plixer.access;"
Note
scrut_conf_restore.sh
should only be used for restoring configuration data for the same Plixer Scrutinizer server/appliance. To apply a configuration backup to a different server, follow the steps for backup migrations in the migration guides.
Additional notes
pg_restore
errors typically only cause the restore to fail for the table associated with the error. Other tables should still be restored successfully.Errors associated with duplicate keys usually indicate a conflict between existing rows in the table and the rows being restored.
pg_restore: [archiver (db)] Error from TOC entry 51348; 0 17943 TABLE DATA exporters plixer pg_restore: [archiver (db)] COPY failed for table "exporters": ERROR: duplicate key value violates unique constraint "exporters_pkey" DETAIL: Key (exporter_id)=(\x0a4d4d0a) already exists.
The conflicting keys should be removed from the table before attempting to restore again.
If you are swapping IP addresses, the database keys should be rotated using
scrut_util --pgcerts --verbose
, because the backed up keys will be associated with the old address.