メインコンテンツまでスキップ
メインコンテンツまでスキップ

Integrating Confluent platform with ClickHouse

Prerequisites

私たちは、あなたが以下のことに慣れていると仮定しています:

The official Kafka connector from ClickHouse with Confluent Platform

Installing on Confluent platform

これは、Confluent Platform で ClickHouse Sink Connector を使用するための簡単なガイドです。 詳細については、公式 Confluent ドキュメントを参照してください。

Create a Topic

Confluent Platform にトピックを作成するのは非常に簡単で、詳細な手順は こちら にあります。

Important notes

  • Kafka トピック名は ClickHouse テーブル名と同じでなければなりません。これを調整する方法は、トランスフォーマーを使用することです(例えば ExtractTopic)。
  • パーティションが多いことは常にパフォーマンスが向上することを意味するわけではありません - 詳細およびパフォーマンスのヒントについては、今後のガイドをご覧ください。

Install connector

コネクタは私たちの リポジトリ からダウンロードできます - コメントや問題をこちらに提出することも自由にどうぞ!

「Connector Plugins」 -> 「Add plugin」に移動し、以下の設定を使用します:

'Connector Class' - 'com.clickhouse.kafka.connect.ClickHouseSinkConnector'
'Connector type' - Sink
'Sensitive properties' - 'password'. This will ensure entries of the ClickHouse password are masked during configuration.

例:

Confluent Platform UI showing settings for adding a custom ClickHouse connector

Gather your connection details

To connect to ClickHouse with HTTP(S) you need this information:

  • The HOST and PORT: typically, the port is 8443 when using TLS or 8123 when not using TLS.

  • The DATABASE NAME: out of the box, there is a database named default, use the name of the database that you want to connect to.

  • The USERNAME and PASSWORD: out of the box, the username is default. Use the username appropriate for your use case.

The details for your ClickHouse Cloud service are available in the ClickHouse Cloud console. Select the service that you will connect to and click Connect:

ClickHouse Cloud service connect button

Choose HTTPS, and the details are available in an example curl command.

ClickHouse Cloud HTTPS connection details

If you are using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.


以下は、ClickHouseにHTTP(S)で接続するために必要な情報です:

  • HOSTとPORT: 通常、TLSを使用する場合はポートが8443、使用しない場合は8123です。

  • DATABASE NAME: デフォルトでは、defaultという名前のデータベースがあります。接続したいデータベースの名前を使用します。

  • USERNAMEとPASSWORD: デフォルトでは、ユーザー名はdefaultです。使用ケースに適したユーザー名を使用します。

ClickHouse Cloudサービスの詳細は、ClickHouse Cloudコンソールで確認できます。 接続するサービスを選択し、Connectをクリックしてください:

ClickHouse Cloud service connect button

HTTPSを選択すると、詳細はexample curlコマンドで確認できます。

ClickHouse Cloud HTTPS connection details

セルフマネージドのClickHouseを使用している場合は、接続の詳細がClickHouse管理者によって設定されます。

Configure the connector

Connectors -> Add Connector に移動し、以下の設定を使用します(値は例です):

{
  "database": "<DATABASE_NAME>",
  "errors.retry.timeout": "30",
  "exactlyOnce": "false",
  "schemas.enable": "false",
  "hostname": "<CLICKHOUSE_HOSTNAME>",
  "password": "<SAMPLE_PASSWORD>",
  "port": "8443",
  "ssl": "true",
  "topics": "<TOPIC_NAME>",
  "username": "<SAMPLE_USERNAME>",
  "key.converter": "org.apache.kafka.connect.storage.StringConverter",
  "value.converter": "org.apache.kafka.connect.json.JsonConverter",
  "value.converter.schemas.enable": "false"
}

Specify the connection endpoints

コネクタがアクセスできるエンドポイントの許可リストを指定する必要があります。 ネットワーキングの出口エンドポイントを追加する際は、完全修飾ドメイン名 (FQDN) を使用しなければなりません。 例: u57swl97we.eu-west-1.aws.clickhouse.com:8443

注記

HTTP(S) ポートを指定する必要があります。コネクタはまだネイティブプロトコルをサポートしていません。

Read the documentation.

これで準備は整いました!

Known limitations