Interconnecting ClickHouse with OBS
Using S3 Table Functions
- Log in to the active OMS node.
- Run the following command to obtain the data stored in OBS:
select * from S3(path, [ak, sk,] format, structure, [compression])
- path: Access domain name/OBS file path. Log in to OBS console and choose Parallel File Systems. On the page that is displayed, click the file system name. On the Files tab page, click the file name. The value of Link is the path.
Figure 1 File path
- ak: Optional. The AK that has the permission to access OBS.
- sk: Optional. The SK that has the permission to access OBS.
- format: The file format.
- structure: The table schema.
- compression: Optional. The compression type.
- path: Access domain name/OBS file path. Log in to OBS console and choose Parallel File Systems. On the page that is displayed, click the file system name. On the Files tab page, click the file name. The value of Link is the path.
Using the S3 Table Engine
- Log in to the active OMS node.
- Run the following commands to create a table:
CREATE TABLE test1_s3 ('name' String, 'age' int)
ENGINE = S3(path, [ak, sk,] format, [compression])
- Run the following command to query the table:
select * from test1_s3;
Modifying Manager Configurations
Parameter |
Value |
---|---|
s3.endpoint-name.endpoint |
OBS bucket address |
s3.endpoint-name.access_key_id |
OBS AK. For details on how to obtain the AK, see How Do I Obtain the Access Key AK/SK? |
s3.endpoint-name.secret_access_key |
OBS SK. For details about how to obtain the OBS SK, see How Do I Obtain the AK/SK? |
Typically, the URL shared by OBS contains HTTPS. If the URL is inaccessible directly, perform the following operations to modify the configuration:
Parameter |
Value |
---|---|
openSSL.client.loadDefaultCAFile |
true |
openSSL.client.cacheSessions |
true |
openSSL.client.disableProtocols |
sslv2,sslv3 |
openSSL.client.preferServerCiphers |
true |
openSSL.client.invalidCertificateHandler.name |
AcceptCertificateHandler |
After the modification, click Save.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.