> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> Confluent Cloud で完全マネージド型の ClickHouse Connector Sink を使用するためのガイド

# Confluent Cloud と ClickHouse の統合

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

<div class="vimeo-container">
  <Frame>
    <iframe
      src="//www.youtube.com/embed/SQAiPVbd3gg"
      frameborder="0"
      allow="autoplay;
fullscreen;
picture-in-picture"
      allowfullscreen
    />
  </Frame>
</div>

<div id="prerequisites">
  ## 前提条件
</div>

以下について理解していることを前提としています。

* [ClickHouse Connector Sink](/docs/ja/integrations/connectors/data-ingestion/kafka/kafka-clickhouse-connect-sink)
* Confluent Cloud

<div id="the-official-kafka-connector-from-clickhouse-with-confluent-cloud">
  ## ClickHouse の公式 Kafka コネクタを Confluent Cloud で使う
</div>

<div id="create-a-topic">
  #### トピックの作成
</div>

Confluent Cloud でトピックを作成するのは比較的簡単です。詳しい手順は[こちら](https://docs.confluent.io/cloud/current/client-apps/topics/manage.html)を参照してください。

<div id="important-notes">
  #### 重要な注意点
</div>

* Kafkaトピック名は、ClickHouseのテーブル名と同じである必要があります。これを調整するには、トランスフォーマー (たとえば [`ExtractTopic`](https://docs.confluent.io/platform/current/connect/transforms/extracttopic.html)) を使用します。
* パーティション数が多ければ、必ずしもパフォーマンスが向上するわけではありません。詳細やパフォーマンス改善のヒントについては、近日公開予定のガイドをご覧ください。

<div id="gather-your-connection-details">
  #### 接続情報を確認する
</div>

HTTP(S) で ClickHouse に接続するには、次の情報が必要です。

| Parameter(s)              | Description                                               |
| ------------------------- | --------------------------------------------------------- |
| `HOST` and `PORT`         | 通常、TLS を使用する場合のポートは 8443、TLS を使用しない場合は 8123 です。           |
| `DATABASE NAME`           | デフォルトでは `default` という名前のデータベースがあります。接続先のデータベース名を使用してください。 |
| `USERNAME` and `PASSWORD` | デフォルトのユーザー名は `default` です。用途に応じたユーザー名を使用してください。           |

ClickHouse Cloud サービスの詳細は、ClickHouse Cloud コンソールで確認できます。
サービスを選択し、**Connect** をクリックします。

<div className="ch-image-md">
  <Frame>
    <img src="https://mintcdn.com/private-7c7dfe99/CFFsa2agBPbviR4r/images/_snippets/cloud-connect-button.webp?fit=max&auto=format&n=CFFsa2agBPbviR4r&q=85&s=ec0a298a33ca841e947fa5e8bae47362" alt="ClickHouse Cloud サービスの接続ボタン" width="998" height="932" data-path="images/_snippets/cloud-connect-button.webp" />
  </Frame>
</div>

**HTTPS** を選択します。接続情報は `curl` コマンドの例として表示されます。

<div className="ch-image-md">
  <Frame>
    <img src="https://mintcdn.com/private-7c7dfe99/CFFsa2agBPbviR4r/images/_snippets/connection-details-https.webp?fit=max&auto=format&n=CFFsa2agBPbviR4r&q=85&s=cb0fbd98aa2b5b7ca484c9f53395ee07" alt="ClickHouse Cloud HTTPS 接続情報" width="1320" height="1184" data-path="images/_snippets/connection-details-https.webp" />
  </Frame>
</div>

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

<div id="install-connector">
  #### コネクタのインストール
</div>

[公式ドキュメント](https://docs.confluent.io/cloud/current/connectors/cc-clickhouse-sink-connector/cc-clickhouse-sink.html)に従って、Confluent Cloud に完全マネージド型の ClickHouse Sink Connector をインストールします。

<div id="configure-the-connector">
  #### コネクタを設定する
</div>

ClickHouse Sink Connector の設定時に、次の情報を指定する必要があります。

* ClickHouse サーバーのホスト名
* ClickHouse サーバーのポート (デフォルトは 8443)
* ClickHouse サーバーのユーザー名とパスワード
* データの書き込み先となる ClickHouse 内のデータベース名
* ClickHouse へのデータの書き込みに使用する Kafka のトピック名

Confluent Cloud UI では、ポーリング間隔、バッチサイズ、その他のパラメータを調整してパフォーマンスを最適化できる高度な設定オプションがサポートされています。

<Note>
  Confluent Cloud では、[fetch 設定](/docs/ja/integrations/connectors/data-ingestion/kafka/kafka-clickhouse-connect-sink#fetch-settings) や [poll 設定](/docs/ja/integrations/connectors/data-ingestion/kafka/kafka-clickhouse-connect-sink#poll-settings) など一部の設定を調整するには、Confluent Cloud でサポートケースを作成する必要があります。
</Note>

<div id="known-limitations">
  #### 既知の制限事項
</div>

* [公式ドキュメントのコネクタの制限事項一覧をご覧ください](https://docs.confluent.io/cloud/current/connectors/cc-clickhouse-sink-connector/cc-clickhouse-sink.html#limitations)
