> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# CREATE STORAGE VOLUME

> CREATE STORAGE VOLUME creates a storage volume for a remote storage system.

CREATE STORAGE VOLUME creates a storage volume for a remote storage system. This feature is supported from v3.1.

A storage volume consists of the properties and credential information of the remote data storage. You can reference a storage volume when you create databases and cloud-native tables in a shared-data cluster.

> **CAUTION**
>
> Only users with the CREATE STORAGE VOLUME privilege on the SYSTEM level can perform this operation.
>
> In shared-data mode, the database performs a storage accessibility check for each `LOCATION` during `CREATE STORAGE VOLUME` when the FE configuration item `enable_storage_volume_access_check` is enabled (enabled by default). If this check is enabled and credential, endpoint, or network access is invalid, the statement fails immediately. You can turn off this check by disabling `enable_storage_volume_access_check`.

## Syntax

```SQL theme={null}
CREATE STORAGE VOLUME [IF NOT EXISTS] <storage_volume_name>
TYPE = { S3 | HDFS | AZBLOB | ADLS2 | GS }
LOCATIONS = ('<remote_storage_path>')
[ COMMENT '<comment_string>' ]
PROPERTIES
("key" = "value",...)
```

## Parameters

| **Parameter** | **Description** |
| - | - |
| storage\_volume\_name | The name of the storage volume. Please note that you cannot create a storage volume named `builtin_storage_volume` because it is used to create the builtin storage volume. For the naming conventions, see [System limits](/documents/4.2/sql-reference/System_limit.md). |
| TYPE | The type of the remote storage system. Valid values: `S3`, `HDFS`, `AZBLOB`, `ADLS2`, and `GS`. `S3` indicates AWS S3 or S3-compatible storage systems. `AZBLOB` indicates Azure Blob Storage (supported from v3.1.1 onwards). `ADLS2` indicates Azure Data Lake Storage Gen2 (supported from v3.4.1 onwards). `HDFS` indicates an HDFS cluster. `GS` indicates Google Storage (access with native SDK, supported from v3.5.1 onwards). |
| LOCATIONS | The storage locations. The format is as follows:<ul><li>For AWS S3 or S3 protocol-compatible storage systems: `s3://<s3_path>`. `<s3_path>` must be an absolute path, for example, `s3://testbucket/subpath`. Note that if you want to enable the [Partitioned Prefix](#partitioned-prefix) feature for the storage volume, you can only specify the bucket name, and specifying a sub-path is not allowed.</li><li>For Azure Blob Storage: `azblob://<azblob_path>`. `<azblob_path>` must be an absolute path, for example, `azblob://testcontainer/subpath`.</li><li>For Azure Data Lake Storage Gen2: `adls2://<file_system_name>/<dir_name>`. Example: `adls2://testfilesystem/starrocks`.</li><li>For GS with native SDK: `gs://<gs_path>`. `<gs_path>` must be an absolute path, for example, `gs://testcbucket/subpath`.</li><li>For HDFS: `hdfs://<host>:<port>/<hdfs_path>`. `<hdfs_path>` must be an absolute path, for example, `hdfs://127.0.0.1:9000/user/xxx/starrocks`.</li><li>For WebHDFS: `webhdfs://<host>:<http_port>/<hdfs_path>`, where `<http_port>` is the HTTP port of the NameNode. `<hdfs_path>` must be an absolute path, for example, `webhdfs://127.0.0.1:50070/user/xxx/starrocks`.</li><li>For ViewFS：`viewfs://<ViewFS_cluster>/<viewfs_path>`, where `<ViewFS_cluster>` is the ViewFS cluster name. `<viewfs_path>` must be an absolute path, for example, `viewfs://myviewfscluster/user/xxx/starrocks`.</li></ul> |
| COMMENT | The comment on the storage volume. |
| PROPERTIES | Parameters in the `"key" = "value"` pairs used to specify the properties and credential information to access the remote storage system. For detailed information, see [PROPERTIES](#properties). |

### PROPERTIES

The table below lists all available properties of storage volumes. Following the table are the usage instructions of these properties, categorized by different scenarios from the perspectives of [Credential information](#credential-information) and [Features](#features).

| **Property** | **Description** |
| - | - |
| enabled | Whether to enable this storage volume. Default: `false`. Disabled storage volume cannot be referenced. |
| aws.s3.region | The region in which your S3 bucket resides, for example, `us-west-2`. |
| aws.s3.endpoint | The endpoint URL used to access your S3 bucket, for example, `https://s3.us-west-2.amazonaws.com`. \[Preview] From v3.3.0 onwards, the Amazon S3 Express One Zone storage class is supported, for example, `https://s3express.us-west-2.amazonaws.com`. |

**Beta feature**

[Advice on use of Beta features](/documents/4.2/maturity/features.md)

|
\| aws.s3.use\_aws\_sdk\_default\_behavior | Whether to use the default authentication credential of AWS SDK. Valid values: `true` and `false` (Default). |
\| aws.s3.use\_instance\_profile         | Whether to use Instance Profile and Assumed Role as credential methods for accessing S3. Valid values: `true` and `false` (Default).<ul><li>If you use IAM user-based credential (Access Key and Secret Key) to access S3, you must specify this item as `false`, and specify `aws.s3.access_key` and `aws.s3.secret_key`.</li><li>If you use Instance Profile to access S3, you must specify this item as `true`.</li><li>If you use Assumed Role to access S3, you must specify this item as `true`, and specify `aws.s3.iam_role_arn`.</li><li>And if you use an external AWS account, you must specify this item as `true`, and specify `aws.s3.iam_role_arn` and `aws.s3.external_id`.</li></ul> |
\| aws.s3.use\_web\_identity\_token\_file  | Whether to use a web identity token file to access S3. Valid values: `true` and `false` (Default). When enabled, the AWS SDK on each worker reads the token file and IAM role from the `AWS_WEB_IDENTITY_TOKEN_FILE` and `AWS_ROLE_ARN` environment variables. |
\| aws.s3.access\_key                   | The Access Key ID used to access your S3 bucket.             |
\| aws.s3.secret\_key                   | The Secret Access Key used to access your S3 bucket.         |
\| aws.s3.iam\_role\_arn                 | The ARN of the IAM role that has privileges on your S3 bucket in which your data files are stored. |
\| aws.s3.external\_id                  | The external ID of the AWS account that is used for cross-account access to your S3 bucket. |
\| aws.s3.enable\_path\_style\_access     | Whether to use the Path Style to access S3.\
Valid values: `true` and `false`. Default: `false`. |
\| azure.blob.endpoint                 | The endpoint of your Azure Blob Storage Account, for example, `https://test.blob.core.windows.net`. |
\| azure.blob.shared\_key               | The Shared Key used to authorize requests for your Azure Blob Storage. |
\| azure.blob.sas\_token                | The shared access signatures (SAS) used to authorize requests for your Azure Blob Storage. |
\| azure.adls2.endpoint                | The endpoint of your Azure Data Lake Storage Gen2 Account, for example, `https://test.dfs.core.windows.net`. |
\| azure.adls2.shared\_key              | The Shared Key used to authorize requests for your Azure Data Lake Storage Gen2e. |
\| azure.adls2.sas\_token               | The shared access signatures (SAS) used to authorize requests for your Azure Data Lake Storage Gen2. |
\| azure.adls2.oauth2\_use\_managed\_identity | Whether to use Managed Identity to authorize requests for your Azure Data Lake Storage Gen2. Default: `false`. |
\| azure.adls2.oauth2\_tenant\_id        | The Tenant ID of the Managed Identity used to authorize requests for your Azure Data Lake Storage Gen2. |
\| azure.adls2.oauth2\_client\_id        | <ul><li>For Managed Identity Authentication: The Client ID of the Managed Identity used to authorize requests for your Azure Data Lake Storage Gen2.</li><li>For Workload Identity: The client ID (application ID) of the Azure AD application (user-assigned managed identity or app registration) associated with the workload identity.</li></ul> |
\| azure.adls2.oauth2\_token\_file | Path to the federated token file for Workload Identity authentication. Mount the token file at the same path and make it readable on every FE and CN. |
\| gcp.gcs.service\_account\_email	      | The email address in the JSON file generated at the creation of the Service Account, for example, `user@hello.iam.gserviceaccount.com`. |
\| gcp.gcs.service\_account\_private\_key\_id | The Private Key ID in the JSON file generated at the creation of the Service Account. |
\| gcp.gcs.service\_account\_private\_key | The Private Key in the JSON file generated at the creation of the Service Account, for example, `-----BEGIN PRIVATE KEY----xxxx-----END PRIVATE KEY-----\n`. |
\| gcp.gcs.impersonation\_service\_account | The Service Account that you want to impersonate if you use the impersonation-based authentication.          |
\| gcp.gcs.use\_compute\_engine\_service\_account | Whether to use the Service Account that is bound to your Compute Engine. |
\| gcp.gcs.direct\_read.allow\_extended\_lifetime | Whether to accept a GCS direct-read token whose actual lifetime exceeds `starrocks_catalog_direct_read_sts_max_duration_second`. Default: `false`. Source administrators can set `true` to accept the provider lifetime (typically one hour). The configured ceiling still limits cache reuse and query admission, but does not shorten the issued token. Read-only and table-directory restrictions remain enforced. |
\| hadoop.security.authentication      | The authentication method. Valid values: `simple`(Default) and `kerberos`. `simple` indicates simple authentication, that is, username. `kerberos` indicates Kerberos authentication. |
\| username                            | Username used to access the NameNode in the HDFS cluster.    |
\| hadoop.security.kerberos.ticket.cache.path | The path that stores the kinit-generated Ticket Cache. |
\| dfs.nameservices                    | Name of the HDFS cluster.                                    |
\| dfs.ha.namenodes.`<ha_cluster_name>`                   | Name of the NameNode. Multiple names must be separated by commas (,). No space is allowed in the double quotes. `<ha_cluster_name>` is the name of the HDFS service specified in `dfs.nameservices`. |
\| dfs.namenode.rpc-address.`<ha_cluster_name>`.`<NameNode>` | The RPC address information of the NameNode. `<NameNode>` is the name of the NameNode specified in `dfs.ha.namenodes.<ha_cluster_name>`. |
\| dfs.client.failover.proxy.provider                    | The provider of the NameNode for client connection. The default value is `org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider`. |
\| fs.viewfs.mounttable.`<ViewFS_cluster>`.link./`<viewfs_path>` | The path to the ViewFS cluster to be mounted. Multiple paths must be separated by commas (,). `<ViewFS_cluster>` is the ViewFS cluster name specified in `LOCATIONS`. |
\| aws.s3.enable\_partitioned\_prefix    | Whether to enable the Partitioned Prefix feature for the storage volume. Default: `false`. For more information about this feature, see [Partitioned Prefix](#partitioned-prefix). |
\| aws.s3.num\_partitioned\_prefix       | The number of prefixes to be created for the storage volume. Default: `256`. Valid range: \[4, 1024].|
\| aws.s3.direct\_read.vendor           | Which object store this volume's endpoint reaches, for the database external catalog `direct_lake` transport to know whose STS mints its read-only credential. Valid values: `aws`, `aliyun`, `tencent`, `huawei`, `s3_compatible`. Derived from `aws.s3.endpoint` when unset; only needed when a deployment fronts a public cloud with a domain of its own. |
\| aws.s3.direct\_read.sts\_role\_arn      | The role the `direct_lake` credential is minted by assuming. Required for Aliyun OSS, whose STS offers only AssumeRole and so cannot derive a credential from an access key: set it to a RAM role that can read this data and that the volume's own user may assume. Ignored on the other stores. Where that STS lives is `aws.s3.sts.endpoint` / `aws.s3.sts.region`, the same properties every other STS call on this volume uses. |
\| aws.s3.direct\_read.huawei.enabled | Whether Huawei OBS direct reads are enabled for this source volume. Default: `false`. Set to `true` only after confirming that the source identity has only the required OBS permissions and, for SSE-KMS objects, the necessary KMS permissions. This is an administrator assertion, not an automatic IAM permission check. It does not affect the source cluster’s own access to the volume. |
\| hdfs.direct\_read.allow\_unscoped | Whether to allow HDFS direct reads without a path or read-only credential boundary. Default: `false`. Actual access depends on the effective HDFS identity and permissions, and may include other tables, paths outside the volume, and writes or deletes. Enable only for a trusted querying cluster after reviewing its HDFS permissions and NameNode/DataNode connectivity. Otherwise use `starrocks.scan.transport=arrow_flight` or `brpc_chunk`. |

#### GCS credential lifetime exception

GCS can return a one-hour token even when a shorter lifetime is requested. By default, direct reads fail if the returned expiration exceeds the requested ceiling or is unknown. A user with `ALTER` privilege on the source storage volume can explicitly accept the longer lifetime on the source cluster:

```sql theme={null}
ALTER STORAGE VOLUME gcs_volume
SET ("gcp.gcs.direct_read.allow_extended_lifetime" = "true");
```

For example, with a 900-second ceiling and this option enabled, FE stops reusing the cached credential after at most 900 seconds, while its GCS token may remain usable for about one hour. Revoking SQL access prevents subsequent authorized issuance; it does not revoke tokens already delivered. Setting this option to `false` prevents subsequent requests from reusing credentials cached under the exception. Unknown or expired tokens are rejected even with the option enabled. The querying cluster cannot override this option. Mint audit logs report actual `lifetime_s` and `token_expires_at` separately from `reuse_lifetime_s` and `reuse_until`; accepted lifetime exceptions also produce a warning. If the shorter security window is mandatory, use `starrocks.scan.transport=arrow_flight` or `brpc_chunk` instead.

#### Dedicated identity for Huawei OBS direct reads

Huawei OBS direct reads are disabled by default. Huawei's temporary policy restricts OBS permissions only; other service permissions are inherited from the source identity. Use a dedicated identity with only the required OBS permissions and, when reading SSE-KMS objects, the necessary KMS permissions on the relevant keys. The temporary policy cannot grant missing KMS permissions.

After confirming these permissions, a user with `ALTER` privilege on the source storage volume can enable direct reads **on the source cluster**:

```sql theme={null}
ALTER STORAGE VOLUME obs_volume
SET ("aws.s3.direct_read.huawei.enabled" = "true");
```

This setting records acceptance of the permission requirements; the database does not inspect IAM policies. The querying cluster cannot override it. Set the property to `false` to stop subsequent requests from receiving credentials, including cached credentials. Credentials already issued remain valid until expiration. Source-cluster reads and writes are unaffected.

#### SSE-KMS permissions for direct reads

For `direct_lake`, configure KMS permissions in addition to object-read permissions when required by the provider:

* **AWS S3:** The session policy includes `kms:Decrypt`, restricted to calls through S3 and the scanned object ARNs. It also accepts the bucket ARN encryption context used by S3 Bucket Keys; object reads remain restricted to the scanned prefixes. The source identity and key policy must permit decryption. This KMS statement is not sent to S3-compatible stores such as MinIO.
* **Aliyun OSS:** The session policy includes `kms:Decrypt` for custom CMKs. Use a dedicated RAM role and restrict its KMS permissions to the required keys. The session policy does not restrict KMS calls to OSS or to table paths, so the temporary credential can also call KMS directly for keys allowed by the role.
* **Tencent COS:** Configure the COS service role `COS_QCSRole` with `QcloudKMSAccessForCOSRole` as described in the provider's SSE-KMS setup. The temporary session policy remains restricted to COS actions.

#### Credential information

For a comparison of credential combinations supported by FE and storage volumes, see
[AWS credential support for storage volumes](/documents/4.2/sql-reference/sql-statements/cluster-management/storage_volume/AWS_CREDENTIAL_SUPPORT.md).

##### AWS S3

* If you use the default authentication credential of AWS SDK to access S3, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "aws.s3.region" = "<region>",
  "aws.s3.endpoint" = "<endpoint_url>",
  "aws.s3.use_aws_sdk_default_behavior" = "true"
  ```

* If you use IAM user-based credential (Access Key and Secret Key) to access S3, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "aws.s3.region" = "<region>",
  "aws.s3.endpoint" = "<endpoint_url>",
  "aws.s3.use_aws_sdk_default_behavior" = "false",
  "aws.s3.use_instance_profile" = "false",
  "aws.s3.access_key" = "<access_key>",
  "aws.s3.secret_key" = "<secrete_key>"
  ```

* If you use Instance Profile to access S3, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "aws.s3.region" = "<region>",
  "aws.s3.endpoint" = "<endpoint_url>",
  "aws.s3.use_aws_sdk_default_behavior" = "false",
  "aws.s3.use_instance_profile" = "true"
  ```

* If you use a web identity token file, such as an EKS IAM role for a service account (IRSA), set the following
  properties. Set `AWS_WEB_IDENTITY_TOKEN_FILE` and `AWS_ROLE_ARN` in the environment of every worker that accesses the
  storage volume.

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "aws.s3.region" = "<region>",
  "aws.s3.endpoint" = "<endpoint_url>",
  "aws.s3.use_aws_sdk_default_behavior" = "false",
  "aws.s3.use_instance_profile" = "false",
  "aws.s3.use_web_identity_token_file" = "true"
  ```

  To assume another IAM role after obtaining credentials through web identity, additionally set
  `aws.s3.iam_role_arn`. For cross-account access, you can also set `aws.s3.external_id`.

  **Caution**

  Before using web identity for a storage volume, make sure every FE, StarManager, BE, and CN in the cluster supports
  this authentication method. During a rolling upgrade, do not use the storage volume until all nodes are upgraded.

* If you use Assumed Role to access S3, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "aws.s3.region" = "<region>",
  "aws.s3.endpoint" = "<endpoint_url>",
  "aws.s3.use_aws_sdk_default_behavior" = "false",
  "aws.s3.use_instance_profile" = "true",
  "aws.s3.iam_role_arn" = "<role_arn>"
  ```

* If you use Assumed Role to access S3 from an external AWS account, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "aws.s3.region" = "<region>",
  "aws.s3.endpoint" = "<endpoint_url>",
  "aws.s3.use_aws_sdk_default_behavior" = "false",
  "aws.s3.use_instance_profile" = "true",
  "aws.s3.iam_role_arn" = "<role_arn>",
  "aws.s3.external_id" = "<external_id>"
  ```

##### MinIO

If you use MinIO, set the following properties:

```SQL theme={null}
"enabled" = "{ true | false }",

-- For example: us-east-1
"aws.s3.region" = "<region>",

-- For example: http://172.26.xx.xxx:39000
"aws.s3.endpoint" = "<endpoint_url>",

"aws.s3.access_key" = "<access_key>",
"aws.s3.secret_key" = "<secrete_key>"
```

##### Azure Blob Storage

Creating a storage volume on Azure Blob Storage is supported from v3.1.1 onwards.

* If you use Shared Key to access Azure Blob Storage, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "azure.blob.endpoint" = "<endpoint_url>",
  "azure.blob.shared_key" = "<shared_key>"
  ```

* If you use shared access signatures (SAS) to access Azure Blob Storage, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "azure.blob.endpoint" = "<endpoint_url>",
  "azure.blob.sas_token" = "<sas_token>"
  ```

**Note**

The hierarchical namespace must be disabled when you create the Azure Blob Storage Account.

##### Azure Data Lake Storage Gen2

Creating a storage volume on Azure Data Lake Storage Gen2 is supported from v3.4.1 onwards.

* If you use Shared Key to access Azure Data Lake Storage Gen2, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "azure.adls2.endpoint" = "<endpoint_url>",
  "azure.adls2.shared_key" = "<shared_key>"
  ```

* If you use shared access signatures (SAS) to access Azure Data Lake Storage Gen2, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "azure.adls2.endpoint" = "<endpoint_url>",
  "azure.adls2.sas_token" = "<sas_token>"
  ```

* If you use Managed Identity to access Azure Data Lake Storage Gen2, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "azure.adls2.endpoint" = "<endpoint_url>",
  "azure.adls2.oauth2_use_managed_identity" = "true",
  "azure.adls2.oauth2_tenant_id" = "<tenant_id>",
  "azure.adls2.oauth2_client_id" = "<client_id>" 
  ```

* If you use Workload Identity to access Azure Data Lake Storage Gen2, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "azure.adls2.endpoint" = "<endpoint_url>",
  "azure.adls2.oauth2_tenant_id" = "<service_principal_tenant_id>",
  "azure.adls2.oauth2_client_id" = "<service_client_id>",
  "azure.adls2.oauth2_token_file" = "/var/run/secrets/azure/tokens/azure-identity-token",
  "azure.adls2.oauth2_use_managed_identity" = "false"
  ```

  Path to the federated token file for Workload Identity authentication. Mount the token file at the same path and make it readable on every FE and CN. For Workload Identity, set `azure.adls2.oauth2_use_managed_identity` to `false`. All FEs and CNs must support Workload Identity for ADLS2 storage volumes. When migrating an existing volume, clear `azure.adls2.shared_key`, `azure.adls2.sas_token`, and `azure.adls2.oauth2_client_secret` in the same `ALTER STORAGE VOLUME` statement because ALTER retains properties that you do not specify.

**Note**

Azure Data Lake Storage Gen1 is not supported.

##### Google Storage

* If you use the Service Account that is bound to your Compute Engine to access Google Storage (supported from v3.5.1), set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "gcp.gcs.use_compute_engine_service_account" = "true"
  ```

* If you use the Service Account-based authentication method to access Google Storage (supported from v3.5.1), set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "gcp.gcs.use_compute_engine_service_account" = "false",
  "gcp.gcs.service_account_email" = "<google_service_account_email>",
  "gcp.gcs.service_account_private_key_id" = "<google_service_private_key_id>",
  "gcp.gcs.service_account_private_key" = "<google_service_private_key>"
  ```

* If you use the impersonation-based authentication to access Google Storage (supported from v3.5.1), set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "gcp.gcs.use_compute_engine_service_account" = "false",
  "gcp.gcs.service_account_email" = "<google_service_account_email>",
  "gcp.gcs.service_account_private_key_id" = "<google_service_private_key_id>",
  "gcp.gcs.service_account_private_key" = "<google_service_private_key>",
  "gcp.gcs.impersonation_service_account" = "<assumed_google_service_account_email>"
  ```

* If you use S3 protocol with the IAM user-based authentication to access Google Storage, set the following properties:

  **Tip**

  Google Storage is supported using the [XML API](https://docs.cloud.google.com/storage/docs/interoperability), and the settings use the AWS S3 syntax. In this case, you must set `TYPE` as `S3` and `LOCATIONS` to an S3 protocol-compatible storage location.

  ```SQL theme={null}
  "enabled" = "{ true | false }",

  -- For example: us-east1
  "aws.s3.region" = "<region>",

  -- For example: https://storage.googleapis.com
  "aws.s3.endpoint" = "<endpoint_url>",

  "aws.s3.access_key" = "<access_key>",
  "aws.s3.secret_key" = "<secrete_key>"
  ```

##### HDFS

* If you do not use authentication to access HDFS, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }"
  ```

* If you are using simple authentication (supported from v3.2) to access HDFS, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "hadoop.security.authentication" = "simple",
  "username" = "<hdfs_username>"
  ```

* If you are using Kerberos Ticket Cache authentication (supported since v3.2) to access HDFS, set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }",
  "hadoop.security.authentication" = "kerberos",
  "hadoop.security.kerberos.ticket.cache.path" = "<ticket_cache_path>"
  ```

  > **CAUTION**
  >
  > * This setting only forces the system to use KeyTab to access HDFS via Kerberos. Make sure that each BE or CN node has access to the KeyTab files. Also make sure that the **/etc/krb5.conf** file is set up correctly.
  > * The Ticket cache is generated by an external kinit tool. Make sure you have a crontab or similar periodic task to refresh the tickets.

* If your HDFS cluster is enabled for NameNode HA configuration (supported since v3.2), additionally set the following properties:

  ```SQL theme={null}
  "dfs.nameservices" = "<ha_cluster_name>",
  "dfs.ha.namenodes.<ha_cluster_name>" = "<NameNode1>,<NameNode2> [, ...]",
  "dfs.namenode.rpc-address.<ha_cluster_name>.<NameNode1>" = "<hdfs_host>:<hdfs_port>",
  "dfs.namenode.rpc-address.<ha_cluster_name>.<NameNode2>" = "<hdfs_host>:<hdfs_port>",
  [...]
  "dfs.client.failover.proxy.provider.<ha_cluster_name>" = "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider"
  ```

  For more information, see [HDFS HA Documentation](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html).

  * If you are using WebHDFS (supported since v3.2), set the following properties:

  ```SQL theme={null}
  "enabled" = "{ true | false }"
  ```

  For more information, see [WebHDFS Documentation](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/WebHDFS.html).

* If you are using Hadoop ViewFS (supported since v3.2), set the following properties:

  ```SQL theme={null}
  -- Replace <ViewFS_cluster> with the name of the ViewFS cluster.
  "fs.viewfs.mounttable.<ViewFS_cluster>.link./<viewfs_path_1>" = "hdfs://<hdfs_host_1>:<hdfs_port_1>/<hdfs_path_1>",
  "fs.viewfs.mounttable.<ViewFS_cluster>.link./<viewfs_path_2>" = "hdfs://<hdfs_host_2>:<hdfs_port_2>/<hdfs_path_2>",
  [, ...]
  ```

  For more information, see [ViewFS Documentation](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/ViewFs.html).

#### Features

##### Partitioned Prefix

From v3.2.4, the database supports creating storage volumes with the Partitioned Prefix feature for S3-compatible object storage systems. When this feature is enabled, the database stores the data into multiple, uniformly prefixed partitions (sub-paths) under the bucket.

To enable this feature, set the following properties in addition to the above credential-related parameters:

```SQL theme={null}
"aws.s3.enable_partitioned_prefix" = "{ true | false }",
"aws.s3.num_partitioned_prefix" = "<INT>"
```

**Note**

* The Partitioned Prefix feature is only supported for S3-compatible object storage systems, that is, the `TYPE` of the storage volume must be `S3`.
* `LOCATIONS` of the storage volume must only contain the bucket name, for example, `s3://testbucket`. Specifying a sub-path after the bucket name is not allowed.
* Both properties are immutable once the storage volume is created.
* You cannot enable this feature when create a storage volume by using the FE configuration file **fe.conf**.

## Examples

Example 1: Create a storage volume `my_s3_volume` for the AWS S3 bucket `defaultbucket`, use the IAM user-based credential (Access Key and Secret Key) to access S3, and enable it.

```SQL theme={null}
CREATE STORAGE VOLUME my_s3_volume
TYPE = S3
LOCATIONS = ("s3://defaultbucket/test/")
PROPERTIES
(
    "aws.s3.region" = "us-west-2",
    "aws.s3.endpoint" = "https://s3.us-west-2.amazonaws.com",
    "aws.s3.use_aws_sdk_default_behavior" = "false",
    "aws.s3.use_instance_profile" = "false",
    "aws.s3.access_key" = "xxxxxxxxxx",
    "aws.s3.secret_key" = "yyyyyyyyyy"
);
```

Example 2: Create a storage volume `my_hdfs_volume` for HDFS and enable it.

```SQL theme={null}
CREATE STORAGE VOLUME my_hdfs_volume
TYPE = HDFS
LOCATIONS = ("hdfs://127.0.0.1:9000/sr/test/")
PROPERTIES
(
    "enabled" = "true"
);
```

Example 3: Create a storage volume `hdfsvolumehadoop` for HDFS using simple authentication.

```sql theme={null}
CREATE STORAGE VOLUME hdfsvolumehadoop
TYPE = HDFS
LOCATIONS = ("hdfs://127.0.0.1:9000/sr/test/")
PROPERTIES(
    "hadoop.security.authentication" = "simple",
    "username" = "starrocks"
);
```

Example 4: Use Kerberos Ticket Cache authentication to access HDFS and create storage volume `hdfsvolkerberos`.

```sql theme={null}
CREATE STORAGE VOLUME hdfsvolkerberos
TYPE = HDFS
LOCATIONS = ("hdfs://127.0.0.1:9000/sr/test/")
PROPERTIES(
    "hadoop.security.authentication" = "kerberos",
    "hadoop.security.kerberos.ticket.cache.path" = "/path/to/ticket/cache/path"
);
```

Example 5: Create storage volume `hdfsvolha` for an HDFS cluster with NameNode HA configuration enabled.

```sql theme={null}
CREATE STORAGE VOLUME hdfsvolha
TYPE = HDFS
LOCATIONS = ("hdfs://myhacluster/data/sr")
PROPERTIES(
    "dfs.nameservices" = "myhacluster",
    "dfs.ha.namenodes.myhacluster" = "nn1,nn2,nn3",
    "dfs.namenode.rpc-address.myhacluster.nn1" = "machine1.example.com:8020",
    "dfs.namenode.rpc-address.myhacluster.nn2" = "machine2.example.com:8020",
    "dfs.namenode.rpc-address.myhacluster.nn3" = "machine3.example.com:8020",
    "dfs.namenode.http-address.myhacluster.nn1" = "machine1.example.com:9870",
    "dfs.namenode.http-address.myhacluster.nn2" = "machine2.example.com:9870",
    "dfs.namenode.http-address.myhacluster.nn3" = "machine3.example.com:9870",
    "dfs.client.failover.proxy.provider.myhacluster" = "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider"
);
```

Example 6: Create a storage volume `webhdfsvol` for WebHDFS.

```sql theme={null}
CREATE STORAGE VOLUME webhdfsvol
TYPE = HDFS
LOCATIONS = ("webhdfs://namenode:9870/data/sr");
```

Example 7: Create a storage volume `viewfsvol` using Hadoop ViewFS.

```sql theme={null}
CREATE STORAGE VOLUME viewfsvol
TYPE = HDFS
LOCATIONS = ("viewfs://clusterX/data/sr")
PROPERTIES(
    "fs.viewfs.mounttable.clusterX.link./data" = "hdfs://nn1-clusterx.example.com:8020/data",
    "fs.viewfs.mounttable.clusterX.link./project" = "hdfs://nn2-clusterx.example.com:8020/project"
);
```

Example 8: Create a storage volume `adls2` for Azure Data Lake Storage Gen2 using SAS token.

```SQL theme={null}
CREATE STORAGE VOLUME adls2
TYPE = ADLS2
LOCATIONS = ("adls2://testfilesystem/starrocks")
PROPERTIES (
    "azure.adls2.endpoint" = "https://test.dfs.core.windows.net",
    "azure.adls2.sas_token" = "xxx"
);
```

Example 9: Create a storage volume `gs` for Google Storage using impersonated Service Account.

```SQL theme={null}
CREATE STORAGE VOLUME gs
TYPE = GS
LOCATIONS = ("gs://testbucket/starrocks")
PROPERTIES (
    "gcp.gcs.use_compute_engine_service_account" = "false",
    "gcp.gcs.service_account_email" = "user@hello.iam.gserviceaccount.com",
    "gcp.gcs.service_account_private_key_id" = "61d257bd847xxxxxxxxxxxxxxx4f0b9b6b9ca07af3b7ea",
    "gcp.gcs.service_account_private_key" = "-----BEGIN PRIVATE KEY----xxxx-----END PRIVATE KEY-----\n",
    "gcp.gcs.impersonation_service_account" = "admin@hello.iam.gserviceaccount.com"
);
```

## Relevant SQL statements

* [ALTER STORAGE VOLUME](/documents/4.2/sql-reference/sql-statements/cluster-management/storage_volume/ALTER_STORAGE_VOLUME.md)
* [DROP STORAGE VOLUME](/documents/4.2/sql-reference/sql-statements/cluster-management/storage_volume/DROP_STORAGE_VOLUME.md)
* [SET DEFAULT STORAGE VOLUME](/documents/4.2/sql-reference/sql-statements/cluster-management/storage_volume/SET_DEFAULT_STORAGE_VOLUME.md)
* [DESC STORAGE VOLUME](/documents/4.2/sql-reference/sql-statements/cluster-management/storage_volume/DESC_STORAGE_VOLUME.md)
* [SHOW STORAGE VOLUMES](/documents/4.2/sql-reference/sql-statements/cluster-management/storage_volume/SHOW_STORAGE_VOLUMES.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.