Back Up Using the S3 Compatible Storage of MinIO
You can back up the Virtual Appliance data to MinIO S3-compatible storage. Follow these steps to back up the Virtual Appliance data:
Set Up MinIO S3 Compatible Storage
Before you back up the Virtual Appliance data using MinIO, follow these steps to set up the MinIO server:
9000
port is available for the MinIO server.Configure MinIO Certificates on the Virtual Appliance
You require the CA certificates of MinIO on the Virtual Appliance to establish an SSL connection between the MinIO server and store snapshots.
Copy public.crt
of MinIO to the Virtual Appliance cluster.
- PostgreSQL
-
/var/appd/config/postgres-s3-ca.crt
- MySQL
-
/var/appd/config/mysql-s3-ca.crt
Elasticsearch requires the JKS format so convert the public.crt
to JKS file.
- Run the following command to generate the JKS file from the
public.crt
:keytool -importcert -keystore es-s3-ca.jks -storepass changeit -file public.crt -alias minio
- Copy the
es-s3-ca.jks
fileto the following location:
/var/appd/config
- Configure the truststore password in the
secrets.yaml
. For example,changeit
.See Edit thesecrets.yaml.encrypted
file.Note:- Access the MinIO Console to generate access and secret keys.
- Specify the
storepassword
ofes-s3-ca.jks
as thetrustStorePassword
in secrets. - To sync the changes in
secret.yaml
, run theappdcli sync
command:
# S3 secrets ## backup: elasticsearch: s3: access_key: WTFaWld3c1NHWWNOSzBWeDlXaHI= secret_key: TWtJY0NweVdIcEhJV0pxdzdIWkRnVld3dzAxODRqbjhnS1pnZHozag== trustStorePassword: changeit
Configure the MinIO Endpoint in theglobals.yaml.gotmplFile
Back Up the Virtual Appliance Data in S3 Compatible Storage
Snapshots capture the state of the datastore and can be used to restore data. You can store multiple snapshots in a single repository. The following commands stores the snapshots in the virtual-appliance-repo-minio
repository.
Create a snapshot for each datastore:
- Elasticsearch
-
appdcli run es_backup create-snapshot <repo-name> <snapshot-name>
Exampleappdcli run es_backup create-snapshot virtual-appliance-repo-minio es-snapshot
- PostgreSQL
-
appdcli run pg_backup create-snapshot <repo-name> <snapshot-name>
Exampleappdcli run pg_backup create-snapshot repo2 pg-snapshot
- MySQL
-
appdcli run mysql_backup create-snapshot <repo-name> <snapshot-name>
Exampleappdcli run mysql_backup create-snapshot repo2 mysql-snapshot
Restore Snapshots from the MinIO server
Use the snapshots that you have stored in MinIO server to restore the datastores.
helm delete controller -n cisco-controller
- List the snapshots in the repository:
- Elasticsearch
-
appdcli run es_backup list-snapshot <repo-name>
Exampleappdcli run es_backup list-snapshot virtual-appliance-repo-mino
- PostgreSQL
-
appdcli run pg_backup list-snapshot <repo-name>
Exampleappdcli run pg_backup list-snapshot repo2
- MySQL
-
appdcli run mysql_backup list-snapshot <repo-name>
Exampleappdcli run mysql_backup list-snapshot repo2
- Restore the datastore by one of the snapshots:
- Elasticsearch
-
appdcli run es_backup restore-snapshot <repo-name> <snapshot-name>
Exampleappdcli run es_backup restore-snapshot virtual-appliance-repo-mino es_snapshot
- PostgreSQL
-
appdcli run pg_backup restore-snapshot <repo-name>
Exampleappdcli run pg_backup restore-snapshot repo2 pg_snapshot
- MySQL
-
appdcli run mysql_backup restore-snapshot <repo-name>
Exampleappdcli run mysql_backup restore-snapshot repo2 mysql_snapshot
After the restore is successful, if the Controller is down, run the following command:
appdcli sync appd <profile>
Delete the Snapshots from the MinIO S3 Compatible Storage
If you no longer require the snapshot, you can delete the snapshot from the MinIO S3 Compatible Storage.
- Elasticsearch
-
appdcli run es_backup delete-snapshot <repo-name> <snapshot-name>
Exampleappdcli run es_backup delete-snapshot virtual-appliance-repo-mino es_snapshot
- PostgreSQL
-
appdcli run pg_backup delete-snapshot <repo-name>
Exampleappdcli run pg_backup delete-snapshot repo2 pg_snapshot
- MySQL
-
appdcli run mysql_backup delete-snapshot <repo-name>
Exampleappdcli run mysql_backup delete-snapshot repo2 mysql_snapshot