跳到主要内容

CREATE-STORAGE-VAULT

CREATE-STORAGE-VAULT

描述

该命令用于创建存储库。本文档的主题描述了创建 Doris 自管理存储库的语法。

CREATE STORAGE VAULT [IF NOT EXISTS] vault
[properties]

properties

参数是否必需描述
type必需只允许两种类型的存储库:S3 和 HDFS。
S3 Vault
参数是否必需描述
s3.endpoint必需用于对象存储的端点。
注意,请不要提供带有 http:// 或 https:// 开头的链接。对于 Azure Blob 存储,endpoint是固定的blob.core.windows.net。
s3.region必需您的存储桶的区域。(如果您使用 GCP 或 AZURE,则不需要)。
s3.root.path必需存储数据的路径。
s3.bucket必需您的对象存储账户的存储桶。(如果您使用 Azure,则为 StorageAccount)。
s3.access_key必需您的对象存储账户的访问密钥。(如果您使用 Azure,则为 AccountName)。
s3.secret_key必需您的对象存储账户的秘密密钥。(如果您使用 Azure,则为 AccountKey)。
provider必需提供对象存储服务的云供应商。支持的值有COSOSSS3OBSBOSAZUREGCP
use_path_style可选使用 path-style URL(私有化部署环境)或者virtual-hosted-style URL(公有云环境建议), 默认值 true (path-style)
HDFS vault
参数是否必需描述
fs.defaultFS必需Hadoop 配置属性,指定要使用的默认文件系统。
path_prefix可选存储数据的路径前缀。如果没有指定则会使用 user 账户下的默认路径。
hadoop.username可选Hadoop 配置属性,指定访问文件系统的用户。如果没有指定则会使用启动 hadoop 进程的 user。
hadoop.security.authentication可选用于 hadoop 的认证方式。如果希望使用 kerberos 则可以填写kerberos
hadoop.kerberos.principal可选您的 kerberos 主体的路径。
hadoop.kerberos.keytab可选您的 kerberos keytab 的路径。

示例

  1. 创建 HDFS storage vault。

    CREATE STORAGE VAULT IF NOT EXISTS hdfs_vault_demo
    PROPERTIES (
    "type" = "hdfs", -- required
    "fs.defaultFS" = "hdfs://127.0.0.1:8020", -- required
    "path_prefix" = "big/data", -- optional, 一般按照业务名称填写
    "hadoop.username" = "user" -- optional
    "hadoop.security.authentication" = "kerberos" -- optional
    "hadoop.kerberos.principal" = "hadoop/127.0.0.1@XXX" -- optional
    "hadoop.kerberos.keytab" = "/etc/emr.keytab" -- optional
    );
  2. 创建阿里云 OSS storage vault。

    CREATE STORAGE VAULT IF NOT EXISTS oss_demo_vault
    PROPERTIES (
    "type" = "S3", -- required
    "s3.endpoint" = "oss-cn-beijing.aliyuncs.com", -- required
    "s3.access_key" = "xxxxxx", -- required, Your OSS access key
    "s3.secret_key" = "xxxxxx", -- required, Your OSS secret key
    "s3.region" = "cn-beijing", -- required
    "s3.root.path" = "oss_demo_vault_prefix", -- required
    "s3.bucket" = "xxxxxx", -- required, Your OSS bucket name
    "provider" = "OSS", -- required
    "use_path_style" = "false" -- optional, OSS 建议设置false
    );
  3. 创建腾讯云 COS storage vault。

    CREATE STORAGE VAULT IF NOT EXISTS cos_demo_vault
    PROPERTIES (
    "type" = "S3",
    "s3.endpoint" = "cos.ap-guangzhou.myqcloud.com", -- required
    "s3.access_key" = "xxxxxx", -- required, Your COS access key
    "s3.secret_key" = "xxxxxx", -- required, Your COS secret key
    "s3.region" = "ap-guangzhou", -- required
    "s3.root.path" = "cos_demo_vault_prefix", -- required
    "s3.bucket" = "xxxxxx", -- required, Your COS bucket name
    "provider" = "COS", -- required
    "use_path_style" = "false" -- optional, COS 建议设置false
    );
  4. 创建华为云 OBS storage vault。

    CREATE STORAGE VAULT IF NOT EXISTS obs_demo_vault
    PROPERTIES (
    "type" = "S3", -- required
    "s3.endpoint" = "obs.cn-north-4.myhuaweicloud.com", -- required
    "s3.access_key" = "xxxxxx", -- required, Your OBS access key
    "s3.secret_key" = "xxxxxx", -- required, Your OBS secret key
    "s3.region" = "cn-north-4", -- required
    "s3.root.path" = "obs_demo_vault_prefix", -- required
    "s3.bucket" = "xxxxxx", -- required, Your COS bucket name
    "provider" = "OBS", -- required
    "use_path_style" = "false" -- optional, OBS 建议设置false
    );
  5. 创建百度云 BOS storage vault。

    CREATE STORAGE VAULT IF NOT EXISTS obs_demo_vault
    PROPERTIES (
    "type" = "S3", -- required
    "s3.endpoint" = "s3.bj.bcebos.com", -- required
    "s3.access_key" = "xxxxxx", -- required, Your BOS access key
    "s3.secret_key" = "xxxxxx", -- required, Your BOS secret key
    "s3.region" = "bj", -- required
    "s3.root.path" = "bos_demo_vault_prefix", -- required
    "s3.bucket" = "xxxxxx", -- required, Your BOS bucket name
    "provider" = "BOS", -- required
    "use_path_style" = "false" -- optional, BOS 建议设置false
    );
  6. 创建亚马逊云 S3 storage vault。

    CREATE STORAGE VAULT IF NOT EXISTS s3_demo_vault
    PROPERTIES (
    "type" = "S3", -- required
    "s3.endpoint" = "s3.us-east-1.amazonaws.com", -- required
    "s3.access_key" = "xxxxxx", -- required, Your S3 access key
    "s3.secret_key" = "xxxxxx", -- required, Your OBS secret key
    "s3.region" = "us-east-1", -- required
    "s3.root.path" = "s3_demo_vault_prefix", -- required
    "s3.bucket" = "xxxxxx", -- required, Your s3 bucket name
    "provider" = "S3", -- required
    "use_path_style" = "false" -- optional, S3 建议设置false
    );
  7. 创建 MinIO storage vault。

     CREATE STORAGE VAULT IF NOT EXISTS minio_demo_vault
    PROPERTIES (
    "type" = "S3", -- required
    "s3.endpoint" = "127.0.0.1:9000", -- required
    "s3.access_key" = "xxxxxx", -- required, Your minio access key
    "s3.secret_key" = "xxxxxx", -- required, Your minio secret key
    "s3.region" = "us-east-1", -- required
    "s3.root.path" = "minio_demo_vault_prefix", -- required
    "s3.bucket" = "xxxxxx", -- required, Your minio bucket name
    "provider" = "S3", -- required
    "use_path_style" = "true" -- required, minio 建议设置true
    );
  8. 创建微软 AZURE storage vault。

    CREATE STORAGE VAULT IF NOT EXISTS azure_demo_vault
    PROPERTIES (
    "type" = "S3", -- required
    "s3.endpoint" = "blob.core.windows.net", -- required
    "s3.access_key" = "xxxxxx", -- required, Your Azure AccountName
    "s3.secret_key" = "xxxxxx", -- required, Your Azure AccountKey
    "s3.region" = "us-east-1", -- required
    "s3.root.path" = "azure_demo_vault_prefix", -- required
    "s3.bucket" = "xxxxxx", -- required, Your Azure StorageAccount
    "provider" = "AZURE" -- required
    );
  9. 创建谷歌 GCP storage vault。

    CREATE STORAGE VAULT IF NOT EXISTS gcp_demo_vault
    PROPERTIES (
    "type" = "S3", -- required
    "s3.endpoint" = "storage.googleapis.com", -- required
    "s3.access_key" = "xxxxxx", -- required
    "s3.secret_key" = "xxxxxx", -- required
    "s3.region" = "us-east-1", -- required
    "s3.root.path" = "gcp_demo_vault_prefix", -- required
    "s3.bucket" = "xxxxxx", -- required
    "provider" = "GCP" -- required
    );

关键词

CREATE, STORAGE VAULT