-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature](cold-hot) support s3 resource #8808
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e99c8bf
[feature](cold-hot) support creating s3 resource and creating olap ta…
a25fade
support alter resource and add check before drop resource
c078f59
support remote_storage_cooldown_time
7245957
fix static imports
6c35ecd
fix reviews
9fbcf14
fix reviews
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 132 additions & 0 deletions
132
docs/en/sql-reference/sql-statements/Data Definition/CREATE RESOURCE.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
--- | ||
{ | ||
"title": "CREATE RESOURCE", | ||
"language": "en" | ||
} | ||
--- | ||
|
||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
# CREATE RESOURCE | ||
|
||
## Description | ||
|
||
This statement is used to create a resource. Only the root or admin user can create resources. Currently supports Spark, ODBC, S3 external resources. | ||
In the future, other external resources may be added to Doris for use, such as Spark/GPU for query, HDFS/S3 for external storage, MapReduce for ETL, etc. | ||
|
||
Syntax: | ||
CREATE [EXTERNAL] RESOURCE "resource_name" | ||
qidaye marked this conversation as resolved.
Show resolved
Hide resolved
|
||
PROPERTIES ("key"="value", ...); | ||
|
||
Explanation: | ||
1. The type of resource needs to be specified in PROPERTIES "type" = "[spark|odbc_catalog|s3]", currently supports spark, odbc_catalog, s3. | ||
2. The PROPERTIES varies according to the resource type, see the example for details. | ||
|
||
## Example | ||
|
||
1. Create a Spark resource named spark0 in yarn cluster mode. | ||
|
||
```` | ||
CREATE EXTERNAL RESOURCE "spark0" | ||
PROPERTIES | ||
( | ||
"type" = "spark", | ||
"spark.master" = "yarn", | ||
"spark.submit.deployMode" = "cluster", | ||
"spark.jars" = "xxx.jar,yyy.jar", | ||
"spark.files" = "/tmp/aaa,/tmp/bbb", | ||
"spark.executor.memory" = "1g", | ||
"spark.yarn.queue" = "queue0", | ||
"spark.hadoop.yarn.resourcemanager.address" = "127.0.0.1:9999", | ||
"spark.hadoop.fs.defaultFS" = "hdfs://127.0.0.1:10000", | ||
"working_dir" = "hdfs://127.0.0.1:10000/tmp/doris", | ||
"broker" = "broker0", | ||
"broker.username" = "user0", | ||
"broker.password" = "password0" | ||
); | ||
```` | ||
|
||
Spark related parameters are as follows: | ||
- spark.master: Required, currently supports yarn, spark://host:port. | ||
- spark.submit.deployMode: The deployment mode of the Spark program, required, supports both cluster and client. | ||
- spark.hadoop.yarn.resourcemanager.address: Required when master is yarn. | ||
- spark.hadoop.fs.defaultFS: Required when master is yarn. | ||
- Other parameters are optional, refer to http://spark.apache.org/docs/latest/configuration.html | ||
|
||
Working_dir and broker need to be specified when Spark is used for ETL. described as follows: | ||
working_dir: The directory used by the ETL. Required when spark is used as an ETL resource. For example: hdfs://host:port/tmp/doris. | ||
broker: broker name. Required when spark is used as an ETL resource. Configuration needs to be done in advance using the `ALTER SYSTEM ADD BROKER` command. | ||
broker.property_key: The authentication information that the broker needs to specify when reading the intermediate file generated by ETL. | ||
|
||
2. Create an ODBC resource | ||
|
||
```` | ||
CREATE EXTERNAL RESOURCE `oracle_odbc` | ||
PROPERTIES ( | ||
"type" = "odbc_catalog", | ||
"host" = "192.168.0.1", | ||
"port" = "8086", | ||
"user" = "test", | ||
"password" = "test", | ||
"database" = "test", | ||
"odbc_type" = "oracle", | ||
"driver" = "Oracle 19 ODBC driver" | ||
); | ||
```` | ||
|
||
The relevant parameters of ODBC are as follows: | ||
- hosts: IP address of the external database | ||
- driver: The driver name of the ODBC appearance, which must be the same as the Driver name in be/conf/odbcinst.ini. | ||
- odbc_type: the type of the external database, currently supports oracle, mysql, postgresql | ||
- user: username of the foreign database | ||
- password: the password information of the corresponding user | ||
|
||
3. Create S3 resource | ||
|
||
```` | ||
CREATE RESOURCE "remote_s3" | ||
PROPERTIES | ||
( | ||
"type" = "s3", | ||
"s3_endpoint" = "http://bj.s3.com", | ||
"s3_region" = "bj", | ||
"s3_root_path" = "/path/to/root", | ||
"s3_access_key" = "bbb", | ||
"s3_secret_key" = "aaaa", | ||
"s3_max_connections" = "50", | ||
"s3_request_timeout_ms" = "3000", | ||
"s3_connection_timeout_ms" = "1000" | ||
); | ||
```` | ||
|
||
S3 related parameters are as follows: | ||
- s3_endpoint: s3 endpoint | ||
- s3_region: s3 region | ||
- s3_root_path: s3 root directory | ||
- s3_access_key: s3 access key | ||
- s3_secret_key: s3 secret key | ||
- s3_max_connections: the maximum number of s3 connections, the default is 50 | ||
- s3_request_timeout_ms: s3 request timeout, in milliseconds, the default is 3000 | ||
- s3_connection_timeout_ms: s3 connection timeout, in milliseconds, the default is 1000 | ||
|
||
|
||
## keyword | ||
|
||
CREATE, RESOURCE |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not need storage cold medium, If user specified storage resource then it implies the cold storage is S3 or HDFS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also a old logic data migration from SSD to HDD, we use both
storage_cold_medium
andremote_storage_resource
to distinguish themThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If BE have ssd,hdd,and s3 resource, how to define the operation from ssd->hdd->s3?