Help Center/ MapReduce Service/ Component Operation Guide (Normal)/ Using ClickHouse/ Configuring Interconnection Between ClickHouse and OBS
Updated on 2022-12-09 GMT+08:00

Configuring Interconnection Between ClickHouse and OBS

Using S3 Table Functions

  1. Log in to the active OMS node.
  2. 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.

Using the S3 Table Engine

  1. Log in to the active OMS node.
  2. Run the following commands to create a table:

    CREATE TABLE test1_s3 ('name' String, 'age' int)

    ENGINE = S3(path, [ak, sk,] format, [compression])

  3. Run the following command to query the table:

    select * from test1_s3;

Modifying Manager Configurations

Log in to FusionInsight Manager and choose Cluster > Services > ClickHouse. Click Configurations then All Configurations. Search for the clickhouse-config-customize parameter and add values. The following table lists the parameter values.

Parameter

Value

s3.endpoint-name.endpoint

The OBS bucket address.

s3.endpoint-name.access_key_id

The AK that is used to access OBS.

s3.endpoint-name.secret_access_key

The SK that is used to access OBS.

Typically, the URL shared by OBS contains HTTPS. If the URL is inaccessible directly, perform the following operations to modify the configuration:

Log in to FusionInsight Manager and choose Cluster > Services > ClickHouse. Click Configurations then All Configurations. Search for the clickhouse-config-customize parameter and add values. The following table lists the parameter values.

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.