Configuring data backup and restoration
To back up data
Set the following parameters in the disaster-recovery.config file located at helix-on-prem-deployment-manager/utilities/disaster-recovery/dr-configs:
Parameter
Description
Example
DR_PTPOSTGRESSet this parameter to yes to back up the PostgreSQL database.
DR_PTPOSTGRES=yesDR_VICTORIAMETRICSSet this parameter to yes to back up VictoriaMetrics.
DR_VICTORIAMETRICS=yesDR_ELASTICSEARCHSet this parameter to yes to back up Elasticsearch data.
DR_ELASTICSEARCH=yesBUCKET_NAMESpecify a name for the bucket where you want to save all the backed-up data.
Important:
Use the following conventions while assigning a bucket name:
- It can have 3 to 63 characters.
- It can have lowercase letters, numbers, and hyphens (-).
- It must begin and end with an alphabet or a number.
- It must not start with xn-- as it might get interpreted as a Punycode format; for example, xn–bucketname.
- It must not have uppercase letters, periods (.), and underscores (_).
- It must not have hyphens next to periods (.); for example, my-.bucket.com or my.-bucket.
- It must not end with a hyphen or -s3alias (-s3alias is reserved for the MinIO bucket access point alias name).
BUCKET_NAME=helixdr-backup
SITE_NAMESpecify a name for the directory where you want to save all the data from a specific region.
This directory gets created inside the bucket that you defined in the BUCKET_NAME parameter.
SITE_NAME=site-ARESTORE_MINIO_S3_REGIONSpecify a region where you want the bucket to be created to restore your backed-up data.
RESTORE_MINIO_S3_REGION=OhioBACKUP_MINIO_S3_REGIONSpecify a region where you want the bucket to be created to back up your data.
BACKUP_MINIO_S3_REGION=DefaultConfigurations specific to Elasticsearch
ES_LOGS_DR_BACKUP_CRON_SCHEDULESpecify the interval at which you want to run an incremental backup of the Elasticsearch log data.
By default, Elasticsearch log data is incrementally backed up at 60 minute intervals.
Important: An incremental backup is a backup type that only copies data that has changed or was created after the previous backup.
ES_LOGS_DR_BACKUP_CRON_SCHEDULE="*/30 * * * *"
In this example, Elasticsearch log data is incrementally backed up at 30 minute intervals.
ES_LOGS_FULL_BACKUP_INTERVAL_MINUTESSpecify the interval at which you want to run a full backup of the Elasticsearch log data.
By default, Elasticsearch log data is fully backed up at 1440 minute intervals.
ES_LOGS_FULL_BACKUP_INTERVAL_MINUTES=720In this example, Elasticsearch log data is fully backed up at 12 hour intervals.
ES_EVENTS_DR_BACKUP_CRON_SCHEDULESpecify the interval at which you want to run an incremental backup of the Elasticsearch event data.
By default, Elasticsearch event data is incrementally backed up at 60 minute intervals.
ES_EVENTS_DR_BACKUP_CRON_SCHEDULE="0 * * * *"ES_EVENTS_FULL_BACKUP_INTERVAL_MINUTESSpecify the interval at which you want to run a full backup of the Elasticsearch event data.
By default, Elasticsearch event data is fully backed up at 1440 minute intervals.
ES_EVENTS_FULL_BACKUP_INTERVAL_MINUTES=1440Configurations specific to the Patroni PostgreSQL database
PATRONI_PG_BACKUP_CRON_SCHEDULESpecify the interval at which you want to run an incremental backup of the Patroni PostgreSQL.
By default, Patroni PostgreSQL is incrementally backed up at 60 minute intervals.
PATRONI_PG_BACKUP_CRON_SCHEDULE="0 */1 * * *"PATRONI_PG_DELTA_MAX_STEPSSpecify the number of incremental backups that you want to retain.
PATRONI_PG_DELTA_MAX_STEPS=23In this example, 23 incremental data backups are retained.
PATRONI_PG_FULL_BACKUP_TO_RETAINSpecify the number of full backups that you want to retain.
This parameter is dependent on the PATRONI_PG_DELTA_MAX_STEPS parameter.
For example, if you set:
PATRONI_PG_BACKUP_CRON_SCHEDULE="0 */1 * * *"PATRONI_PG_DELTA_MAX_STEPS=23 and PATRONI_PG_FULL_BACKUP_TO_RETAIN=5
Incremental backups are run every hour. After 23 incremental backups, the 24th backup will be a full backup and 5 such full backups are retained. Every day a full backup is run, and you will have 5 days of backed-up data.
After the specified number of data backups are created, the oldest backed-up data is purged.
PATRONI_PG_FULL_BACKUP_TO_RETAIN=5In this example, 5 full data backups are retained.
PATRONI_PG_FULL_BACKUP_RETENTION_TYPEUse this parameter to define whether data retention should be based on count (number of backups to be retained) or time (duration for which the backups must be retained).
The possible values are count and time.
The default value is count. BMC recommends that you use the default value.
PATRONI_PG_FULL_BACKUP_RETENTION_TYPE=countConfigurations specific to VictoriaMetrics
VM_DISABLE_HOURLYSpecify if you want to enable or disable the hourly backup of VictoriaMetrics.
Specify true to disable the hourly backup or specify false to enable the hourly backup.
The default value is false.
VM_DISABLE_HOURLY=falseVM_DISABLE_DAILYSpecify if you want to enable or disable the daily backup of VictoriaMetrics.
Specify true to disable the daily backup or specify false to enable the daily backup.
The default value is false.
VM_DISABLE_DAILY=falseVM_DISABLE_WEEKLYSpecify if you want to enable or disable the weekly backup of VictoriaMetrics.
Specify true to disable the weekly backup or specify false to enable the weekly backup.
The default value is false.
VM_DISABLE_WEEKLY=falseVM_DISABLE_MONTHLYSpecify if you want to enable or disable the monthly backup of VictoriaMetrics.
Specify true to disable the hourly backup or specify false to enable the monthly backup.
The default value is false.
VM_DISABLE_MONTHLY=falseVM_KEEPLAST_HOURLYSpecify the number of hourly backups that you want to retain.
VM_KEEPLAST_HOURLY=24VM_KEEPLAST_DAILYSpecify the number of daily backups that you want to retain.
VM_KEEPLAST_DAILY=2VM_KEEPLAST_WEEKLYSpecify the number of weekly backups that you want to retain.
VM_KEEPLAST_WEEKLY=2VM_KEEPLAST_MONTHLYSpecify the number of monthly backups that you want to retain.
VM_KEEPLAST_MONTHLY=2Configurations specific to the VictoriaMetrics aggregator
VMAGG_DISABLE_HOURLYSpecify if you want to enable or disable the hourly backup of the VictoriaMetrics aggregator.
Specify true to disable the hourly backup or specify false to enable the hourly backup.
The default value is false.
VMAGG_DISABLE_HOURLY=falseVMAGG_DISABLE_DAILYSpecify if you want to enable or disable the daily backup of the VictoriaMetrics aggregator.
Specify true to disable the daily backup or specify false to enable the daily backup.
The default value is false.
VMAGG_DISABLE_DAILY=falseVMAGG_DISABLE_WEEKLYSpecify if you want to enable or disable the weekly backup of the VictoriaMetrics aggregator.
Specify true to disable the weekly backup or specify false to enable the weekly backup.
The default value is false.
VMAGG_DISABLE_WEEKLY=falseVMAGG_DISABLE_MONTHLYSpecify if you want to enable or disable the monthly backup of the VictoriaMetrics aggregator.
Specify true to disable the hourly backup or specify false to enable the monthly backup.
The default value is false.
VMAGG_DISABLE_MONTHLY=falseVMAGG_KEEPLAST_HOURLYSpecify the number of hourly backups that you want to retain.
VMAGG_KEEPLAST_HOURLY=24VMAGG_KEEPLAST_DAILYSpecify the number of daily backups that you want to retain.
VMAGG_KEEPLAST_DAILY=2VMAGG_KEEPLAST_WEEKLYSpecify the number of weekly backups that you want to retain.
VMAGG_KEEPLAST_WEEKLY=2VMAGG_KEEPLAST_MONTHLYSpecify the number of monthly backups that you want to retain.
VMAGG_KEEPLAST_MONTHLY=2Run the disaster recovery utility to back up the data:
./utilities/disaster-recovery/disaster-recovery.sh backupAfter you run the disaster recovery utility, data is backed up regularly at scheduled intervals.
To restore data
Set the following parameters in the disaster-recovery.config file located at helix-on-prem-deployment-manager/utilities/disaster-recovery/dr-config:
Parameter
Description
Example
DR_PTPOSTGRESSet this parameter to yes to restore the PostgreSQL database.
DR_PTPOSTGRES=yesDR_VICTORIAMETRICSSet this parameter to yes to restore VictoriaMetrics.
DR_VICTORIAMETRICS=yesDR_ELASTICSEARCHSet this parameter to yes to restore Elasticsearch data.
DR_ELASTICSEARCH=yesRun the disaster recovery utility to restore the data:
./utilities/disaster-recovery/disaster-recovery.sh restore
To restart the data backup
When you run the disaster recovery utility to restore data, it stops the scheduled data backup process. You must rerun the disaster recovery utility to restart the data backup process.
To restart the data backup process, perform the following steps:
- Review the parameters that you had set in the disaster-recovery.config file located at helix-on-prem-deployment-manager/utilities/disaster-recovery/dr-configs.
Run the disaster recovery utility to back up the data:
./utilities/disaster-recovery/disaster-recovery.sh backupAfter you run the disaster recovery utility, data is backed up regularly at scheduled intervals.