<@U0A71G31CDV> how can I set default storage volum...
# questions-and-troubleshooting
z
@Rocky how can I set default storage volume for all the databases while creating
r
To set a default storage volume for all databases (and cloud-native tables) in your StarRocks cluster, you can use the
SET ... AS DEFAULT STORAGE VOLUME
statement. Once a storage volume is set as the default, any database created without an explicit
storage_volume
property will automatically use it. Step 1: Create a storage volume First, define your storage volume (S3, HDFS, Azure, etc.):
Copy code
sql
CREATE STORAGE VOLUME my_s3_volume
TYPE = S3
LOCATIONS = ("<s3://my-bucket/starrocks/>")
PROPERTIES (
    "aws.s3.region" = "us-east-1",
    "enabled" = "true"
);
Step 2: Set it as the cluster default Set the storage volume as the default for the entire cluster:
Copy code
sql
SET my_s3_volume AS DEFAULT STORAGE VOLUME;
Step 3: Verify the behavior Now, when you create a database without specifying a volume, it will default to `my_s3_volume`:
Copy code
sql
CREATE DATABASE my_new_db;

-- Verify the default was applied
SHOW CREATE DATABASE my_new_db;
Key Points: * Version: This feature is supported starting from v3.1. * Shared-data Clusters: In shared-data mode, a default storage volume is required because StarRocks uses it to store system statistics. * Permissions: You must have the
USAGE
privilege on the specific storage volume to set it as the default. * Override: You can still override the default for a specific database by using the
PROPERTIES ("storage_volume" = "other_volume")
clause during
CREATE DATABASE
. References • sql-reference/sql-statements/cluster-management/storage_volume/SET_DEFAULT_STORAGE_VOLUME.md • quick_start/shared-data.md • deployment/shared_data/azure.md • deployment/shared_data/hdfs.md • sql-reference/sql-statements/Database/ALTER_DATABASE.md • deployment/shared_data/s3.md
z
@Rocky and this set is persistent so after restart it will keep that default value? or I should add it in configs as well
r
Yes, the
SET ... AS DEFAULT STORAGE VOLUME
command is persistent. Like other StarRocks metadata (such as users, roles, or database schemas), this setting is stored in the FE (Front End) metadata Edit Log. Once you run the command, the configuration is saved to the cluster's persistent state and will remain the default even after a full cluster restart. Do you need to add it to
fe.conf
?
No, you do not need to add it to the configuration files. In fact, StarRocks has moved toward managing storage volumes through SQL rather than static config files: 1. SQL-based Management (Preferred): Managing storage volumes via SQL is the standard approach since StarRocks v3.1. It allows you to change volumes dynamically without restarting the cluster. 2. Legacy Configs: In older versions or specific shared-data deployments, you might have seen object storage properties (like
aws_s3_path
,
aws_s3_endpoint
) in
fe.conf
. However, if you are using the
STORAGE VOLUME
feature, the SQL command is the correct and persistent way to handle it. 3. `enable_load_volume_from_conf`: There is an FE configuration parameter
enable_load_volume_from_conf
(default is
false
in v3.4+). If set to
true
, StarRocks would try to create a volume based on
fe.conf
properties at startup. You generally don't need this if you are manually creating and setting your storage volumes via SQL. How to verify it's still set You can verify that your volume is still the default at any time by running:
Copy code
sql
DESC STORAGE VOLUME <volume_name>;
-- OR
SHOW STORAGE VOLUMES;
Look for the
IsDefault
column (it should say
true
). Summary: Run the SQL command once, and you're done. No config file changes are required. References • administration/management/FE_configuration.md • administration/management/BE_configuration.md • sql-reference/sql-statements/cluster-management/storage_volume/CREATE_STORAGE_VOLUME.md
z
@Rocky and what if I move starrocks version and new version has some extra system databases and starrocks operator via helm should create them as well it will be created under that new storage volume?
r
Yes, any new system databases created during a version upgrade will automatically use your default storage volume. Here is how that process works in the context of upgrades and the StarRocks Operator: 1. Engine-Level Inheritance In StarRocks (especially in shared-data mode), the "Default Storage Volume" acts as a global fallback. When the StarRocks FE (Front End) performs an upgrade and detects it needs to create a new system database (like
_statistics_
or future internal tables): * The FE's internal "Create Database" logic is triggered. * Since system databases are created without an explicit
storage_volume
property, the engine checks for the cluster-wide default. * The new database is then automatically associated with your persistent default volume. 2. StarRocks Operator & Helm The StarRocks Operator and Helm charts focus on infrastructure-level persistence (Kubernetes Persistent Volumes for FE metadata, FE logs, and BE local caches). They do not usually manage SQL-level objects like storage volumes. * The Operator's Role: It ensures your FE pods are running the new version. * The FE's Role: Once the new version's FE pod starts, it runs its own internal "migration" or "initialization" scripts. These scripts are what create the new system databases. * Because the FE has already persisted your
SET ... AS DEFAULT STORAGE VOLUME
setting in its metadata (the Edit Log), it knows exactly which volume to use for these new system databases during the upgrade. 3. Shared-Data Requirements In shared-data clusters, having a default storage volume is actually mandatory for this exact reason. StarRocks requires a place to store system-level data (like CBO statistics) that is accessible by all compute nodes. If you didn't have one, the upgrade/initialization might even fail or fallback to a legacy
fe.conf
path if configured. Summary of What to Expect: * Persistence: Your
DEFAULT
setting survives the upgrade because it is stored in the FE metadata. * Automatic: You don't need to manually move system databases to the new volume; the FE handles this during the upgrade process. * Verification: After an upgrade, you can run
SHOW CREATE DATABASE <new_system_db>;
to confirm it inherited the correct
storage_volume
property. References • sql-reference/sql-statements/cluster-management/storage_volume/SET_DEFAULT_STORAGE_VOLUME.md • deployment/shared_data/azure.md • quick_start/shared-data.md • deployment/shared_data/feature-support-shared-data.md • administration/management/FE_configuration.md • deployment/sr_operator.md References • deployment/shared_data/feature-support-shared-data.md • loading/loading_introduction/troubleshooting_loading.md • sql-reference/System_variable.md • sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_PROC.md • deployment/shared_data/azure.md • faq/operation_maintenance_faq.md • faq/shared_data_faq.md
z
@Rocky how to check whats default storage volume?
r
To check which storage volume is currently set as the default, you can use the
DESC STORAGE VOLUME
command. Method 1: Check a specific volume If you know the name of a volume and want to see if it is the default, run:
Copy code
sql
DESC STORAGE VOLUME my_s3_volume;
Look for the
IsDefault
column in the output. It will be
true
if it is the default, and
false
otherwise. Method 2: See all volumes first If you don't remember the names of your volumes, first list them all:
Copy code
sql
SHOW STORAGE VOLUMES;
This will return a list of volume names. Then, use
DESC STORAGE VOLUME <name>
on the candidates to find the one marked as
IsDefault: true
. Method 3: Vertical Output (Recommended) Using the
\G
suffix in the MySQL client makes the
IsDefault
flag much easier to read:
Copy code
sql
DESC STORAGE VOLUME my_s3_volume\G
Example Output:
Copy code
text
*************************** 1. row ***************************
     Name: my_s3_volume
     Type: S3
IsDefault: true  <-- This indicates it is the default
 Location: <s3://my-bucket/starrocks/>
...
Note on Shared-Data Clusters In a shared-data cluster, if you haven't manually set a default volume but the cluster is running, it is likely using a "built-in" volume created from your
fe.conf
properties (if
enable_load_volume_from_conf
was true during initial setup). You can still find this volume name using
SHOW STORAGE VOLUMES
. References • sql-reference/sql-statements/cluster-management/storage_volume/SHOW_STORAGE_VOLUMES.md • sql-reference/sql-statements/cluster-management/storage_volume/DESC_STORAGE_VOLUME.md • sql-reference/sql-statements/cluster-management/storage_volume/CREATE_STORAGE_VOLUME.md • deployment/shared_data/feature-support-shared-data.md • sql-reference/information_schema/partitions_meta.md