Skip to content

Commit

Permalink
feat: adds provider name for custom storages (#1274)
Browse files Browse the repository at this point in the history
Co-authored-by: Yiran <cuiyiran3@gmail.com>
  • Loading branch information
killme2008 and nicecui authored Nov 11, 2024
1 parent 7ab9449 commit ca8ca93
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion docs/user-guide/deployments/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,26 +192,30 @@ GreptimeDB supports storing data in local file system, AWS S3 and compatible ser
| File | | | Local file storage options, valid when type="File" |
| | data_home | String | Database storage root directory, "/tmp/greptimedb" by default |
| S3 | | | AWS S3 storage options, valid when type="S3" |
| | name | String | The storage provider name, default is `S3` |
| | bucket | String | The S3 bucket name |
| | root | String | The root path in S3 bucket |
| | endpoint | String | The API endpoint of S3 |
| | region | String | The S3 region |
| | access_key_id | String | The S3 access key id |
| | secret_access_key | String | The S3 secret access key |
| Oss | | | Aliyun OSS storage options, valid when type="Oss" |
| | name | String | The storage provider name, default is `Oss` |
| | bucket | String | The OSS bucket name |
| | root | String | The root path in OSS bucket |
| | endpoint | String | The API endpoint of OSS |
| | access_key_id | String | The OSS access key id |
| | secret_access_key | String | The OSS secret access key |
| Azblob | | | Azure Blob Storage options, valid when type="Azblob" |
| | name | String | The storage provider name, default is `Azblob` |
| | container | String | The container name |
| | root | String | The root path in container |
| | endpoint | String | The API endpoint of Azure Blob Storage |
| | account_name | String | The account name of Azure Blob Storage |
| | account_key | String | The access key |
| | sas_token | String | The shared access signature |
| Gsc | | | Google Cloud Storage options, valid when type="Gsc" |
| | name | String | The storage provider name, default is `Gsc` |
| | root | String | The root path in Gsc bucket |
| | bucket | String | The Gsc bucket name |
| | scope | String | The Gsc service scope |
Expand Down Expand Up @@ -244,20 +248,24 @@ secret_access_key = "<secret access key>"
```toml
# Allows using multiple storages
[[storage.providers]]
name = "S3"
type = "S3"
bucket = "test_greptimedb"
root = "/greptimedb"
access_key_id = "<access key id>"
secret_access_key = "<secret access key>"

[[storage.providers]]
name = "Gcs"
type = "Gcs"
bucket = "test_greptimedb"
root = "/greptimedb"
credential_path = "<gcs credential path>"
```

All configured providers can be used as the `storage` option when creating tables.
All configured providers' names can be used as the `storage` option when creating tables.

For storage from the same provider, if you want to use different S3 buckets as storage engines for different tables, you can set different `name` values and specify the `storage` option when creating the table.

### Object storage cache

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,26 +182,30 @@ GreptimeDB 支持将数据保存在本地文件系统, AWS S3 以及其兼容
| File | | | 本地文件存储选项,当 type="File" 时有效 |
| | data_home | 字符串 | 数据库存储根目录,默认为 "/tmp/greptimedb" |
| S3 | | | AWS S3 存储选项,当 type="S3" 时有效 |
| | name | String | 存储提供商名字,默认为 `S3` |
| | bucket | 字符串 | S3 桶名称 |
| | root | 字符串 | S3 桶中的根路径 |
| | endpoint | 字符串 | S3 的 API 端点 |
| | region | 字符串 | S3 区域 |
| | access_key_id | 字符串 | S3 访问密钥 id |
| | secret_access_key | 字符串 | S3 秘密访问密钥 |
| Oss | | | 阿里云 OSS 存储选项,当 type="Oss" 时有效 |
| | name | String | 存储提供商名字,默认为 `Oss` |
| | bucket | 字符串 | OSS 桶名称 |
| | root | 字符串 | OSS 桶中的根路径 |
| | endpoint | 字符串 | OSS 的 API 端点 |
| | access_key_id | 字符串 | OSS 访问密钥 id |
| | secret_access_key | 字符串 | OSS 秘密访问密钥 |
| Azblob | | | Azure Blob 存储选项,当 type="Azblob" 时有效 |
| | name | String | 存储提供商名字,默认为 `Azblob` |
| | container | 字符串 | 容器名称 |
| | root | 字符串 | 容器中的根路径 |
| | endpoint | 字符串 | Azure Blob 存储的 API 端点 |
| | account_name | 字符串 | Azure Blob 存储的账户名 |
| | account_key | 字符串 | 访问密钥 |
| | sas_token | 字符串 | 共享访问签名 |
| Gsc | | | Google Cloud Storage 存储选项,当 type="Gsc" 时有效 |
| | name | String | 存储提供商名字,默认为 `Gsc` |
| | root | 字符串 | Gsc 桶中的根路径 |
| | bucket | 字符串 | Gsc 桶名称 |
| | scope | 字符串 | Gsc 权限 |
Expand Down Expand Up @@ -234,20 +238,24 @@ secret_access_key = "<secret access key>"
```toml
# Allows using multiple storages
[[storage.providers]]
name = "S3"
type = "S3"
bucket = "test_greptimedb"
root = "/greptimedb"
access_key_id = "<access key id>"
secret_access_key = "<secret access key>"

[[storage.providers]]
name = "Gcs"
type = "Gcs"
bucket = "test_greptimedb"
root = "/greptimedb"
credential_path = "<gcs credential path>"
```

所有配置的这些存储引擎提供商都可以在创建表时用作 `storage` 选项。
所有配置的这些存储引擎提供商的 `name` 都可以在创建表时用作 `storage` 选项。

对于同样提供商的存储,比如你希望使用不同 S3 bucket 来作为不同表的存储引擎,你就可以设置不同的 `name`,并在创建表的时候指定 `storage` 选项。

### 对象存储缓存

Expand Down

0 comments on commit ca8ca93

Please sign in to comment.