[Containers] Backup and Restore Guide
1. Backup
1.1. Automatic Backup
Automatic backups are configured to run at specified intervals defined in the values files. Each backup generates a tar.gz
archive, which is then uploaded to a remote server using SCP. The backup schedule and remote server connection settings are specified in the following values files:
Service | Values File | Location in File |
---|---|---|
Cassandra |
|
|
Zookeeper |
|
|
Elasticsearch |
|
|
Configmaps/Secrets |
|
|
The available settings are:
Setting | Required | Description | Example |
---|---|---|---|
schedule | true | Schedule in crontab format | 30 23 * * * |
user | true | Username to connect as | backup |
address | true | Remote server address | 10.0.0.2 |
path | true | Path on the remote server | /backup/cassandra/ |
key | false | SSH key in base64 format |
If the key is left empty, the SSH key for connecting to the remote server must be stored in two Kubernetes secrets named k8ssandra-prod-backup-key
and veridiumid-backup-key
, under the key backup.key
.
1.2. On-Demand Backup (optional)
1.2.1. Cassandra
To perform an on-demand backup for Cassandra, execute the following command inside the cassandra-prod-default-sts-0
pod:
/scripts/backup-cassandra.sh
1.2.2. Zookeeper
To perform an on-demand backup for Zookeeper, execute the following command inside the vid-maintenance
pod:
/scripts/backup-zookeeper.sh
1.2.3. Elasticsearch
To perform an on-demand backup for Elasticsearch, execute the following command inside the vid-maintenance
pod:
/scripts/backup-elasticsearch.sh
1.2.4. Configmaps and Secrets
To perform an on-demand backup for Configmaps and Secrets, execute the following command inside the vid-maintenance
pod:
/scripts/backup-configmaps-secrets.sh
2. Restore
2.1. Cassandra
Download the backup archive from the remote server to the
cassandra-prod-default-sts-0
pod.Rename the archive to
backup_cassandra.tar.gz
and place it in the/tmp
folder.Execute the following command to restore Cassandra:
/scripts/restore-cassandra.sh <path/to/backup.tar.gz>
2.2. Zookeeper
Download the backup archive from the remote server to the
vid-maintenance
pod (typically place it in the/tmp
folder).Execute the following command to restore Zookeeper, specifying the path to the backup archive:
/scripts/restore-zookeeper.sh <path/to/backup.tar.gz>
2.3. Elasticsearch
Download the backup archive from the remote server to the
vid-maintenance
pod (typically place it in the/tmp
folder).Execute the following commands to restore Elasticsearch, specifying the path to the backup archive:
/scripts/restore-elasticsearch.sh <path/to/backup.tar.gz>
2.4. Configmaps and Secrets
Download the backup archive from the remote server to the
vid-maintenance
pod (typically place it in the/tmp
folder).Execute the following commands to restore Configmaps and Secrets, specifying the path to the backup archive:
/scripts/restore-configmaps-secrets.sh <path/to/backup.tar.gz>