A meta snapshot is a backup of meta service’s data at a specific point in time. Meta snapshots are persisted in object storage. RisingWave supports multiple object storage backends including S3, MinIO, Google Cloud Storage (GCS), Alibaba Cloud OSS, Huawei Cloud OBS, Azure Blob Storage, HDFS, WebHDFS, and local filesystem.Documentation Index
Fetch the complete documentation index at: https://docs.risingwave.com/llms.txt
Use this file to discover all available pages before exploring further.
Set backup parameters
Before you can create a meta snapshot, you need to set thebackup_storage_url and backup_storage_directory system parameters prior to the first backup attempt.
If these parameters are not explicitly set, RisingWave will automatically initialize them from your state store configuration: backup_storage_url will default to your state_store URL (or “memory” if using in-memory state store), and backup_storage_directory will default to {data_directory}/backup.
To learn about how to configure system parameters, see How to configure system parameters.
Create a meta snapshot
Meta snapshot is created by meta service whenever requested by users. There is no automatic process in the RisingWave kernel that creates meta snapshot regularly. However, external tools like RisingWave Console can provide automated backup scheduling and management. Using RisingWave Console You can create and manage metadata snapshots through the RisingWave Console, which provides a web-based interface for snapshot operations including manual snapshot creation and automated backup configuration. Using Command Line Here’s an example of how to create a new meta snapshot withrisectl:
risectl is included in the pre-built RisingWave binary. Use the following command instead:
View existing meta snapshots
The following SQL command lists existing meta snapshots:rw_catalog.rw_meta_snapshot catalog also includes a state_table_info field containing detailed state table information in JSON format.
Delete a meta snapshot
Here’s an example of how to delete a meta snapshot withrisectl:
Restore from a meta snapshot
Below are two separate methods to restore from a meta snapshot using SQL database and etcd as the meta store backend.SQL database as meta store backend
If the cluster has been using a SQL database as meta store backend, follow these steps to restore from a meta snapshot.-
Shut down RisingWave nodes, including meta, compute, compactor and frontend.
This step is especially important because the meta backup and recovery process does not replicate SST files. It is not permitted for multiple clusters to run with the same SSTs set at any time, as this can corrupt the SST files.
-
If the Elastic Disk Cache feature is enabled, clear the disk cache on every node where disk cache is enabled before starting the restored cluster. Specifically, delete the contents of the directories configured by
storage.meta_file_cache.dirandstorage.data_file_cache.dir, or delete and then recreate those directories with the correct permissions before starting the restored cluster. -
Create a new meta store, i.e., a new SQL database. This database must have the same table structure as the original, but all tables must be empty. To achieve this, you can either:
- Use database-specific tools (e.g.,
pgdumpfor Postgres) to duplicate table schemas, or - Use the schema migration tool to create tables, then truncate those non-empty tables populated by the tool. The version of the migration tool must match the version of the meta snapshot. For example, if the meta snapshot was created with RisingWave v2.4.3, the migration tool should also be from RisingWave v2.4.3.
- Use database-specific tools (e.g.,
-
Restore the meta snapshot to the new meta store.
restore-metareads snapshot data from backup storage and writes them to meta store and hummock storage. For example, given the cluster settings below:Parameters torisectl meta restore-metashould be:--backup-storage-url s3://backup_bucket.--backup-storage-directory backup_data.--hummock-storage-url s3://state_bucket. Note that thehummock+prefix is stripped.--hummock-storage-directory state_data.
--dry-run: Print the target snapshot without restoring (default: false)--read-attempt-timeout-ms: Read timeout for object store operations (default: 600000)--read-retry-attempts: Maximum retry attempts for object store reads (default: 3)--validate-integrity: Verify all referenced objects exist in object store (default: false)--overwrite-hummock-storage-endpoint: Overwrite storage endpoint system parameters (default: false)--overwrite-backup-storage-url: Override backup storage URL in restored meta store--overwrite-backup-storage-directory: Override backup storage directory in restored meta store--sql-url-params: Additional SQL connection parameters (e.g.,sslmode=disable)
- Configure meta service to use the new meta store.
etcd as meta store backends
If the cluster has been using etcd as meta store backend, follow these steps to restore from a meta snapshot.-
Shut down RisingWave nodes, including meta, compute, compactor and frontend.
This step is especially important because the meta backup and recovery process does not replicate SST files. It is not permitted for multiple clusters to run with the same SSTs set at any time, as this can corrupt the SST files.
- Create a new meta store, i.e. a new and empty etcd instance.
-
Restore the meta snapshot to the new meta store.
If etcd enables authentication, also specify the following:
restore-metareads snapshot data from backup storage and writes them to meta store and hummock storage. For example, given the cluster settings below:Parameters torisectl meta restore-metashould be:--backup-storage-url s3://backup_bucket.--backup-storage-directory backup_data.--hummock-storage-url s3://state_bucket. Note that thehummock+prefix is stripped.--hummock-storage-directory state_data.
--dry-run: Print the target snapshot without restoring (default: false)--read-attempt-timeout-ms: Read timeout for object store operations (default: 600000)--read-retry-attempts: Maximum retry attempts for object store reads (default: 3)--validate-integrity: Verify all referenced objects exist in object store (default: false)--overwrite-hummock-storage-endpoint: Overwrite storage endpoint system parameters (default: false)--overwrite-backup-storage-url: Override backup storage URL in restored meta store--overwrite-backup-storage-directory: Override backup storage directory in restored meta store--sql-url-params: Additional SQL connection parameters (e.g.,sslmode=disable)
- Configure meta service to use the new meta store.