Backup and Restore the TSDB
You can backup and restore the Time Series Database (TSDB) separately from other configuration elements. You must set a user-defined HB_EXTRA_MOUNT1 environment variable on the Paragon Insights server prior to any back up or restore operation.
For example, use the following command to set the environment variable.
export HB_EXTRA_MOUNT1=/root/.kube/config
Here, HB_EXTRA_MOUNT1 is a variable and is user defined.
The backup and restore operations for the TSDB are available only through the Paragon
Insights CLI. The backup and restore commands are invoked by using a predefined python
script, healthbot.py
. You must have root access to the CLI interface of the
Paragon Insights server in order to issue these commands.
The generic command along with the required and optional arguments (in square brackets), for performing backup and restore, is described here with examples.
/var/local/healthbot/healthbot tsdb (backup|restore) [-h] [--database DATABASE] [--all] --path PATH
The required arguments for the /var/local/healthbot/healthbot tsdb
command
are:
-
backup
—perfom a backup operation -
restore
—perform a restore operation -
--path
-
For backup:
PATH_TO_DIR
—path to the directory where the backup file will be generated. -
For restore:
PATH_TO_DIR/BACKUP_FILENAME
—absolute path of backup file that needs to be restored.
-
-
/var/local/healthbot/healthbot tsdb stop-services
—stop service -
/var/local/healthbot/healthbot tsdb start-services --port portnumber
—start serviceNote:In Paragon Automation, the TSDB port is not exposed by default. External API queries to TSDB do not need this port to be exposed as well. However, if you use external tools such as Grafana, you need to run the following query to the TSDB directly (and not through APIs) to expose the TSDB port:
/var/local/healthbot/healthbot tsdb start-services
The optional arguments for the /var/local/healthbot/healthbot tsdb
command
are:
-h, --help show this help message and exit --database DATABASE Takes backup (or restore) of the given list of databases. Either database or all flag must be configured --all Takes backup (or restores) of all the databases. Either database or all flag must be configured
Back up the TSDB
/var/local/healthbot/healthbot tsdb backup --all --path PATH_TO_DIR
Example – Back up the TSDB and Store it in HB_EXTRA_MOUNT3
/var/local/healthbot/healthbot tsdb backup --all --path $HB_EXTRA_MOUNT3
Restore the TSDB
/var/local/healthbot/healthbot tsdb restore --all --path PATH_TO_DIR/BACKUP_FILENAME
Example – Restore the TSDB from HB_EXTRA_MOUNT2
/var/local/healthbot/healthbot tsdb restore --all --path $HB_EXTRA_MOUNT2