Boopathi G
04/20/2026, 10:10 AMRocky
04/20/2026, 10:11 AMBACKUP command is focused on data objects rather than system-wide configuration.
Here is the breakdown for your disaster recovery (DR) validation:
1. Recommended Restore Approach
In a complete loss scenario, the recommended approach is a hybrid of cluster re-provisioning and state restoration:
* Step 1: Re-provision the Kubernetes infrastructure (Operator, Secrets, and StarRocks StatefulSets).
* Step 2: FE State Recovery. Restore the FE metadata (meta_dir) from a PV snapshot (e.g., using Velero or cloud-native storage snapshots). This is the only way to recover users, privileges, resource groups, and the internal state of the cluster (BDBJE logs).
* Step 3: Data Recovery. Run the RESTORE command from your S3/MinIO repository to pull the actual table data back into the BEs.
2. Does BACKUP include all necessary metadata?
No, it is not a "system backup."
* Included: Table schemas, partition definitions, view definitions, UDFs (v3.4+), and the actual data (snapshots of tablets).
* NOT Included: User accounts, RBAC (privileges/roles), Resource Groups, and Colocate Join groups.
* Conclusion: You must separately back up the FE meta_dir if you want to avoid manually re-creating users and re-granting permissions.
3. Production DR Pattern for K8s Shared-Nothing
For a production-grade DR on Kubernetes, the standard pattern is:
1. Logical BACKUP (to Object Storage): Regularly schedule BACKUP tasks for your critical databases/tables to S3/MinIO. This is your primary source for data integrity and cross-cluster migration.
2. FE Volume Snapshots: Use a tool like Velero or your storage provider’s snapshotting capability to snapshot the FE PVs (specifically the meta volume).
_ _Note:* Snapshots of BE PVs in shared-nothing are often avoided because they are difficult to keep consistent across multiple replicas during high-load periods. Logical RESTORE is the preferred way to rebuild BE data.
3. Metadata DDL Export (Secondary): As a fallback, many users periodically export DDLs for all users and grants (SHOW CREATE USER, SHOW GRANTS) to a Git repository or S3.
4. Is there a "Full Cluster Backup" command?
* Shared-Nothing: There is no single command. You rely on the Hybrid approach (Logical Backup + PV Snapshots).
* Shared-Data (Cloud-Native): StarRocks 3.4.2+ introduced Cluster Snapshot, which does back up everything (data + FE metadata) to object storage. However, this is only available for shared-data architecture (using CN nodes and centralized storage). It cannot be used in your shared-nothing BE setup.
Summary Checklist for your DR Plan:
Component | Recovery Mechanism | Why?
Users/Privileges | FE PV Snapshot (or DDL Export) | Not covered by BACKUP.
Table Schema | BACKUP or FE Snapshot | Both contain it; RESTORE recreates it automatically.
Data (BE) | RESTORE from S3 | Safest way to ensure consistency in shared-nothing.
FE Metadata | FE PV Snapshot | Essential to recover the BDBJE cluster ID and edit logs.
Important Note on FE Restore: If you restore an FE meta_dir to a new environment with different IPs or a fresh cluster, you may need to start the first FE node with the configuration bdbje_reset_election_group = true to allow it to elect itself as a new Leader and bypass the old node list.
References
• sql-reference/sql-statements/backup_restore/RESTORE.md
• administration/user_privs/authorization/privilege_item.md
• administration/management/Backup_and_restore.mdRocky
04/20/2026, 10:11 AM