Backup and Restore Supported by Mavis
Our system provides backup and disaster recovery functions, supporting the following two backup methods:
- Method One: Full Backup and Restore of Mavis: Perform a complete system backup covering all data and configurations.
Backup File Naming Convention (Including Today's Date):
-
-
xx-xx-xxxx-backup-full => Full system backup of Mavis (all data and configurations)
-
- Method Two: Separate Backup and Restore of Mavis (System and Database + Storage): Focus on improving the recovery time of the Mavis system by backing up the Mavis system first, followed by backing up the log replay records to ensure quick restoration of system usage.
Partial Backup File Naming Convention (Including Today's Date):
-
-
xx-xx-xxxx-backup-exclude-storage => Mavis system and database, excluding storage backup (log videos, etc.)
-
xx-xx-xxxx-backup-only-storage => Mavis storage backup (mainly backing up log video files and other data)
-
Support for Multiple Storage Sources
Velero supports various object storage solutions, allowing cluster resources to be easily saved to cloud or local storage. Supported object storage includes AWS, Azure, GCP, and S3-compatible local storage such as Minio (see Minio installation documentation).
Execution Steps for Backup and Restore
1. Set Backup Storage Source
-
The backup steps for standalone and HA three-node architecture are the same; for HA three-node architecture, just execute the backup command on the first Master01.
Enter the storage source command:
curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | bash -s init
Choose the storage source to provide as S3 or Azure Blob
*S3
Enter the S3 information and confirm the input before typing "y" to continue execution.
Field Descriptions and Examples: | AWS | Minio |
Enter your s3 access key | s3 access key |
access key or login account e.g.:minioadmin |
Enter your s3 secret key | s3 secret key |
secret key or password e.g.:minioadmin |
Enter your bucket region [minio] |
input region e.g.:ap-northeast-1 |
default is minio, no input needed |
Enter your S3 URL [https://s3.$REGION.amazonaws.com:443] |
input S3 URL needs to set region e.g.:https://s3.ap-northeast-1.amazonaws.com:443 |
input minio url e.g.:http://192.168.89.122:9000 |
Enter your bucket name |
input bucket name e.g.:shun-mavisdemo-backup-restore-100g |
input bucket name e.g.:mavis-backup-minio |
*Azure Blob
Enter Azure information and confirm the input before typing "y" to continue execution.
Field Descriptions and Examples: | Azure Blob |
Enter your Azure storage account name: | e.g.:shunmavisdemo |
Enter your Azure storage account key | storage account key |
Enter your Azure container name: |
input containe name e.g.:mavis-backup |
Enter your Azure subscription ID: |
input subscription ID |
Enter your Azure resource group: |
input storage account 所屬的resource group e.g.:shun-demo-server_group |
Enter your Azure tenant ID: |
input tenant ID |
Enter your Azure client ID: |
input client ID |
Enter your Azure client secret |
input client secret |
(Azure Blob field-related information: Please refer to Azure Storage Account Creation, How to Obtain the Cloud Key (API Key))
If you see this log, it indicates that the storage source configuration is complete.
Note: The storage source configuration only needs to be set once; you can skip this step for subsequent backup executions!
2. Execute Backup
- Method One: Directly Execute "Mavis Full Backup" Command:
curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | bash -s backup
If you see the following message, it indicates the backup was successful:
- Full backup file name: [日期*-backup-full]
- [Backup completed with status: Completed.]
- Method Two: Separate Backup and Restore of Mavis (System and Database + Storage):
*First, execute the command for "Mavis System and Database Backup (excluding log replay and other data)":
curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | BACKUP_STORAGE_VOLUME=false bash -s backup
If you see the following message, it indicates the backup was successful:
- System and database backup file name: [日期*-backup-exclude-storage]
- [Backup completed with status: Completed.]
*Then execute the command for "Mavis Storage Backup (including log replay and other data)":
curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | ONLY_STORAGE_VOLUME=true bash -s backup
If you see the following message, it indicates the backup was successful:
- Storage backup file name: [日期*-backup-only-storage]
- [Backup completed with status: Completed.]
3. Check Backup Files
Command to view backup files: Display all backup files
velero backup get
4. Execute Restore
- The restore steps for standalone and HA three-node architecture differ only in Steps 1 and 2; the remaining operations are the same.
Standalone Version:
-
Please prepare a new machine with the same specifications. Note: If the new machine's IP address differs from the old machine's, please update the DNS record to point to the new machine's IP address.
-
Install the k3s environment on the new machine:
Installation Command for K3S:
curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | bash -s install
Installation success message for K3S:
--------------------------------------------------------------------------------------------
HA Three-Node Architecture:
1.Prepare three new machines with the same architecture and specifications as the existing three machines.
Note: If the new machines' IP addresses differ from the old machines', please update the DNS records to point to the new machines' IP addresses.
2.Install the k3s environment on the new Master01 machine:
Installation Command for K3S:curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | bash -s install_cluster
1. Enter the IPs of the three machines in sequence.
2. Enter the account and password that have the same sudo privileges on all three machines (this example uses the same password for root on all three machines).
Success message for K3S installation in HA three-node architecture:
Confirm the status of the three clusters: all three should be in "Ready" status, indicating normal operation:
kubectl get node
-------------------------------------------------------------------------------- -
Set Backup Storage Source
Enter the storage source command:
curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | bash -s init
Choose the storage source to provide as S3 or Azure.
*S3
Enter the S3 information and confirm the input before typing "y" to continue execution.Field Descriptions and Examples: AWS Minio Enter your s3 access key s3 access key access key or login account
e.g.:minioadmin
Enter your s3 secret key s3 secret key secret key or password
e.g.:minioadmin
Enter your bucket region [minio] input region
e.g.:ap-northeast-1
default is minio, no input needed Enter your S3 URL [https://s3.$REGION.amazonaws.com:443] input S3 URL needs to set region
e.g.:https://s3.ap-northeast-1.amazonaws.com:443
input minio url
e.g.:http://192.168.89.122:9000
Enter your bucket name input bucket name
e.g.:shun-mavisdemo-backup-restore-100g
input bucket name
e.g.:mavis-backup-minio
*Azure
Enter Azure information and confirm the input before typing "y" to continue execution.
Field Descriptions and Examples: Azure Blob Enter your Azure storage account name: e.g.:shunmavisdemo Enter your Azure storage account key storage account key Enter your Azure container name: input containe name
e.g.:mavis-backup
Enter your Azure subscription ID: input subscription ID
Enter your Azure resource group: input storage account 所屬的resource group
e.g.:shun-demo-server_group
Enter your Azure tenant ID: input tenant ID
Enter your Azure client ID: input client ID
Enter your Azure client secret input client secret
If you see this log, it indicates that the storage source configuration is complete. -
Execute Restore
- Method One: When using "Mavis Full Backup", please restore using this method:
curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | bash -s restore
The window will display all backup files. Enter the latest full backup file name to proceed with the complete restoration of Mavis (example: 2024-05-28-133830-backup-full). After entering the name, press the Enter key to start the restoration (full backup).
If you see the following message, it indicates that the restoration was successful, and the platform can start functioning normally.
-
Method 2: For "Mavis Separate Backup and Restore," please restore separately for "System and Database" and "Storage.
You can focus on improving the recovery time of the Mavis system by prioritizing the restoration of the Mavis system. Subsequently, you can execute the log replay record backup to ensure the system is restored for use as soon as possible.
*For restoring the "System and Database," please first execute the restoration command:curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | bash -s restore
The window will display all backup files. Enter the latest Mavis system and database file name to proceed with the file restoration (example: 2024-05-30-174036-backup-exclude-storage). After entering the name, press the Enter key to start the restoration.
If you see the following message, it indicates that the restoration was successful, and you can log in to Mavis for operation. However, the connection record function will temporarily be unavailable (you will need to wait for the restoration of the Mavis storage backup for the connection record function to return to normal).
-
*For restoring "Storage," please first execute the restoration command:curl -sSL https://pentium-repo.s3.ap-northeast-1.amazonaws.com/mavis/latest/backup.sh | bash -s restore
The window will display all backup files. Enter the latest Mavis storage file name to proceed with the file restoration (example: 2024-05-30-174214-backup-only-storage). After entering the name, press the Enter key to start the restoration.
-
If you see the following message, it indicates that the restoration was successful, and the connection record function has been restored. You can now play new and old log replay video files!