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
-
CODE
/var/appd/config/postgres-s3-ca.crt - MySQL
-
CODE
/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:CODEkeytool -importcert -keystore es-s3-ca.jks -storepass changeit -file public.crt -alias minio - Copy the
es-s3-ca.jksfileto the following location:CODE/var/appd/config - Configure the truststore password in the
secrets.yaml. For example,changeit.See Edit thesecrets.yaml.encryptedfile.Note:- Access the MinIO Console to generate access and secret keys.
- Specify the
storepasswordofes-s3-ca.jksas thetrustStorePasswordin secrets. - To sync the changes in
secret.yaml, run theappdcli synccommand:
CODE# S3 secrets ## backup: elasticsearch: s3: access_key: WTFaWld3c1NHWWNOSzBWeDlXaHI= secret_key: TWtJY0NweVdIcEhJV0pxdzdIWkRnVld3dzAxODRqbjhnS1pnZHozag== trustStorePassword: changeit
Configure the MinIO Endpoint in the globals.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
-
CODE
appdcli run es_backup create-snapshot <repo-name> <snapshot-name>ExampleCODEappdcli run es_backup create-snapshot virtual-appliance-repo-minio es-snapshot - PostgreSQL
-
CODE
appdcli run pg_backup create-snapshot <repo-name> <snapshot-name>ExampleCODEappdcli run pg_backup create-snapshot repo2 pg-snapshot - MySQL
-
CODE
appdcli run mysql_backup create-snapshot <snapshot-name>ExampleCODEappdcli run mysql_backup create-snapshot 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
-
CODE
appdcli run es_backup list-snapshot <repo-name>ExampleCODEappdcli run es_backup list-snapshot virtual-appliance-repo-mino - PostgreSQL
-
CODE
appdcli run pg_backup list-snapshot <repo-name>ExampleCODEappdcli run pg_backup list-snapshot repo2 - MySQL
-
CODE
appdcli run mysql_backup list-snapshot <repo-name>ExampleCODEappdcli run mysql_backup list-snapshot repo2
- Restore the datastore by one of the snapshots:
- Elasticsearch
-
CODE
appdcli run es_backup restore-snapshot <repo-name> <snapshot-name>ExampleCODEappdcli run es_backup restore-snapshot virtual-appliance-repo-mino es_snapshot - PostgreSQL
-
CODE
appdcli run pg_backup restore-snapshot <repo-name>ExampleCODEappdcli run pg_backup restore-snapshot repo2 pg_snapshot - MySQL
-
CODE
appdcli run mysql_backup restore-snapshot <repo-name>ExampleCODEappdcli 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
-
CODE
appdcli run es_backup delete-snapshot <repo-name> <snapshot-name>ExampleCODEappdcli run es_backup delete-snapshot virtual-appliance-repo-mino es_snapshot - PostgreSQL
-
CODE
appdcli run pg_backup delete-snapshot <repo-name>ExampleCODEappdcli run pg_backup delete-snapshot repo2 pg_snapshot - MySQL
-
CODE
appdcli run mysql_backup delete-snapshot <repo-name>ExampleCODEappdcli run mysql_backup delete-snapshot mysql_snapshot