Create a ClickHouse (Replication) sink connector
Use a ClickHouse (Replication) sink connector to keep a copy of your source tables in ClickHouse. The connector applies the changes from the Kafka topics you select to existing tables and keeps the current state of each row, while a ClickHouse (logs) sink connector keeps every change as a new row.
Prerequisites
- A CDC Service whose status is Healthy. See Create a CDC Service.
- Topics with change data, written by a PostgreSQL, MySQL, MariaDB, or SQL Server source connector, such as a MariaDB source connector.
- A ClickHouse database that the workspace can reach, and a user with the SELECT and INSERT privileges on the target tables.
- The target tables, created beforehand with the columns of the source rows. The connector does not create tables.
Create the connector
-
Select Data platform → Workspace management, then select your workspace.
-
On the Overview tab, under Services, select the CDC card.
-
Select the Connectors tab, then select Create Connector.

-
On the Connector Information screen, enter a Name, select sink in Type, and select ClickHouse Replicate in Database.

-
Select Next Step. On the Properties screen, enter the connection details, then select Test connection. Next Step becomes available after the test succeeds.


-
On the same screen, choose a Converter class and set the four converter fields, then select the topics to read in Topics.


-
Select Next Step. On the Additional properties screen, set the fields in the Task, Database source, Map table, and Error Tolerance sections.

-
Select Next Step and check the settings on the Review screen.

-
Select Create.
Connector settings
Connector information
| Field | Required | Description |
|---|---|---|
| Name | Yes | The connector name. Use lowercase letters, digits, and hyphens (-) only. Upper-case letters, _, ., and spaces are rejected with "Name has invalid characters". |
| Type | Yes | Select sink. |
| Database | Yes | Select ClickHouse Replicate. |
Properties
In the Database Information section, choose From FPT Database Engine or Manual configuration. Manual configuration is selected by default. With From FPT Database Engine, select your instance in Database Name to fill in Host name and Port. See Connection mode.
| Field | Required | Description |
|---|---|---|
| Database Name | Yes | Shown with From FPT Database Engine only. The ClickHouse instance in FPT Database Engine. Enter the database to write to in Database. |
| Host name | Yes | The host name or IP address of the ClickHouse server. |
| Port | Yes | The port of the ClickHouse server, for example 8123. The field has no default value in Manual configuration. |
| Database | Yes | The database that the connector writes to. |
| Username | Yes | The user that the connector connects as. |
| Password | Yes | The password of that user. |
| Converter class | Yes | The converter class for this connector. The portal offers Clickhouse replica. The four converter fields stay greyed out until you choose a class. See Converter. |
| Converter key, Converter key schema enable, Converter value, Converter value schema enable | Yes | How the connector reads the keys and values of the messages, and whether they carry a schema. With Clickhouse replica, the key and value converters offer only org.apache.kafka.connect.json.JsonConverter, and the schema enable fields offer only true. |
| Topics (under Kafka topic) | Yes | The topics to read. Select them from the list, which shows the topics in the Kafka cluster of your CDC Service. See Topics. |
Additional properties
| Field | Required | Description |
|---|---|---|
| Tasks max | Yes | The maximum number of tasks for the connector. Default 1. See Tasks max. |
| Type (under Database source) | Yes | The type of the source database that the topics come from: PostgreSQL, MySQL, MariaDB, or SQLServer. The field has no default. |
| Topic 1, Table 1 (under Map table) | Yes | The ClickHouse table that receives the records of each topic. Select an existing table from the list. If the list shows "No options", Next Step gives "Table is required": create the table in ClickHouse first, then select it. See Map table. |
| Mode (under Error Tolerance) | Yes | What the connector does with a message that it cannot read or convert. None stops the connector with status Failed. All skips the message and sends it to the topic you enter for failed records. The field has no default. See Error tolerance. |