ClickHouse Writer initial setup
Prerequisites
Before you configure ClickHouse Writer, provision a ClickHouse Cloud service or self-hosted ClickHouse cluster, and create a dedicated ClickHouse user with the permissions ClickHouse Writer needs.
Network requirements
ClickHouse Cloud uses port 8443 for JDBC by default; this port is open by default and network settings are managed by ClickHouse Cloud. For a self-hosted deployment, open the following ports as needed:
Port | Purpose |
|---|---|
8123/tcp | HTTP interface |
9000/tcp | Native interface |
8443/tcp | HTTPS interface |
9440/tcp | TLS interface |
If you use Replicated or Distributed table engines with a self-hosted, clustered ClickHouse deployment, your ClickHouse cluster must also have replication configured, including ClickHouse Keeper (or ZooKeeper) and the interserver HTTP port used for data-part transfer between replicas. See ClickHouse's own clustering documentation for cluster-level configuration; ClickHouse Writer does not configure cluster topology.
Create a ClickHouse user for ClickHouse Writer
Striim recommends creating a dedicated ClickHouse user for ClickHouse Writer rather than using the default administrative user. Grant the user the following permissions on the target database:
GRANT CREATE TABLE ON <database>.* TO <user>; GRANT ALTER TABLE ON <database>.* TO <user>; GRANT DROP TABLE ON <database>.* TO <user>; GRANT TRUNCATE ON <database>.* TO <user>; GRANT CREATE DATABASE ON *.* TO <user>; GRANT SHOW TABLES ON *.* TO <user>; GRANT SHOW DATABASES ON *.* TO <user>; GRANT SELECT ON information_schema.* TO <user>; GRANT SELECT ON system.tables TO <user>; GRANT SELECT ON system.columns TO <user>; GRANT SELECT ON system.parts TO <user>; GRANT SELECT, INSERT, UPDATE, DELETE ON <database>.* TO <user>;
Important: ClickHouse Writer does not create the target database. If the mapped database does not exist in ClickHouse, the application halts at startup with an error identifying the missing database. Create the target database yourself before you deploy your application.
Supported database engines
ClickHouse Writer supports the Shared database engine (used by ClickHouse Cloud services) and the Atomic database engine (the default for self-hosted ClickHouse deployments).
Configure TLS or mutual TLS authentication
Connections to ClickHouse Cloud are always encrypted using TLS. For a self-hosted deployment, you can configure TLS separately, and enable it in the Connection Profile using the EnableSSL property.
To use SSL X.509 (mutual TLS) authentication with a self-managed ClickHouse deployment, generate a client certificate and key, and create a matching ClickHouse user:
Generate a key and certificate signing request:
openssl req -newkey rsa:2048 -nodes -subj "/CN=<host>:<user>" \ -keyout <user>_key.key -out <user>.csr
Sign the certificate with your certificate authority:
openssl x509 -req -in <user>.csr -out <user>.crt \ -CA <ca_cert>.crt -CAkey <ca_cert>.key -days 365
Create (or convert) the matching ClickHouse user:
CREATE USER <user> IDENTIFIED WITH ssl_certificate CN '<host>:<user>'; -- or, to convert an existing user: ALTER USER <user> IDENTIFIED WITH ssl_certificate CN '<host>:<user>';
The private key must be in PKCS#8 PEM format. In the Connection Profile, set Authentication Type to SslX509 and provide the Username, Client SSL Certificate, Client SSL Key, and CA Certificate. ClickHouse Writer performs mutual TLS: the client authenticates the server, and the server authenticates the client, using TLS v1.3 where the ClickHouse server supports it.
Private network connectivity (AWS PrivateLink)
AWS PrivateLink lets Striim connect to a ClickHouse Cloud service over private networking instead of a public endpoint. This feature is available only on ClickHouse Cloud's Scale and Enterprise plans. Cross-region PrivateLink is also supported, across a broad set of AWS regions; AWS charges separately for cross-region data transfer. If PrivateLink is already configured for another service in your organization, ClickHouse Cloud can often reuse the same endpoint within a region (this is not guaranteed across different ClickHouse organizations).
Set up the private endpoint
In the ClickHouse Cloud console, open the service's Settings page and note both the Service name and the DNS name.
In the AWS console, go to VPC > Endpoints > Create endpoint, choose "Endpoint services that use NLBs and GWLBs," and paste in the Service name. If AWS reports "Service name couldn't be verified," contact ClickHouse Cloud support to enable your region. For a cross-region connection, enable the cross-region endpoint option and specify the region where the ClickHouse service runs.
Select your VPC and subnets, and assign a security group that allows inbound access on ports 443, 8443, 9440, and 3306.
Enable "Private DNS names" on the VPC endpoint during creation. This has AWS automatically create a Route 53 private hosted zone with a wildcard record that resolves the ClickHouse private endpoint hostname to private IP addresses inside your VPC.
Note the endpoint ID once the VPC endpoint is created.
Back in the ClickHouse Cloud console, open the service's Settings page, click "Set up private endpoint," and add the AWS endpoint ID to the service's allow list.
Configure the connection
ClickHouse Cloud issues a public JDBC URL such as jdbc:clickhouse://<cluster-id>.<region>.aws.clickhouse.cloud:8443. Rather than changing the Connection Profile to point at the PrivateLink-specific hostname, the recommended approach is to leave the Connection URL exactly as ClickHouse Cloud provided it, and let DNS resolve it privately from inside your VPC:
Create a Route 53 Private Hosted Zone for the aws.clickhouse.cloud domain and associate it with your VPC.
In that hosted zone, add a CNAME record mapping the public hostname (<cluster-id>.<region>.aws.clickhouse.cloud) to the PrivateLink hostname (<cluster-id>.<region>.vpce.aws.clickhouse.cloud).
With this in place, anything inside the VPC that resolves the original public hostname is transparently redirected to the private endpoint, while the same hostname still resolves to ClickHouse's public IP addresses from outside the VPC. Your Connection Profile's Connection URL does not need to change.
Verify the private connection
From an EC2 instance inside the VPC where the private hosted zone is associated:
Run dig +short <cluster-id>.<region>.aws.clickhouse.cloud. A private IP address from your VPC's CIDR range confirms the override is working; a public IP address (typically starting 3.x.x.x or 65.x.x.x) means the private hosted zone is not being applied — check that the VPC is associated with the zone, the zone name matches, and the CNAME record exists.
Optionally, run dig +short <cluster-id>.<region>.vpce.aws.clickhouse.cloud to confirm the CNAME target resolves to the same private IP.
Optionally, run nc -zv <cluster-id>.<region>.aws.clickhouse.cloud 8443 to confirm connectivity to ClickHouse over the private path.
Troubleshoot private connectivity
Service name couldn't be verified: Contact ClickHouse Cloud support to enable PrivateLink for your region.
Connection timed out: Confirm the VPC endpoint's security group allows inbound access on ports 443, 8443, 9440, and 3306, and that outbound rules on the Striim host allow the connection.
Private Hostname: Not found address of host: DNS is not configured correctly; revisit the private hosted zone and CNAME setup.
Connection reset by peer: Confirm the AWS endpoint ID has been added to the ClickHouse Cloud service's allow list.
Create a ClickHouse Connection Profile
A Connection Profile stores the connection URL, authentication type, and credentials that ClickHouse Writer uses to connect to ClickHouse. Create a Connection Profile before you configure a ClickHouse Writer target so that the target can reference it by name.
Connection Profile properties
Property | Type | Required | Default | Description |
|---|---|---|---|---|
ConnectionURL | String | Yes | "" | The JDBC connection URL, in the form jdbc:clickhouse://<host>:<port>. For example: jdbc:clickhouse://<host>.clickhouse.cloud:8443. |
AuthenticationType | String | Yes | Password | Password or SslX509. SslX509 is available only for self-managed ClickHouse deployments. |
Username | String | Yes | "" | The ClickHouse user that ClickHouse Writer connects as. The user must have the permissions described in Prerequisites. |
Password | Password | No | "" | Required when Authentication Type is Password. Stored encrypted. |
EnableSSL | Boolean | No | true | Enables TLS for the connection when Authentication Type is Password. Required for ClickHouse Cloud. Disable only when connecting to a self-deployed ClickHouse cluster that does not run TLS. |
clientSSLCertificatePath | String (file) | No | "" | Required when Authentication Type is SslX509. Path to the client certificate. |
clientSSLKeyPath | String (file) | No | "" | Required when Authentication Type is SslX509. Path to the client private key, in PKCS#8 PEM format. |
CACertificatePath | String (file) | No | "" | Required when Authentication Type is SslX509. Path to the certificate authority that signed the ClickHouse server's certificate. |
Note: The Password field, and other credential fields on this Connection Profile, can be stored in a Striim Vault normally. The one specific restriction is that a Striim Vault of type FILE cannot be used to supply clientSSLCertificatePath, clientSSLKeyPath, or CACertificatePath — configure these three file-path fields directly, or through a non-FILE vault reference, rather than a FILE-type vault entry.
Microsoft Entra ID Service Principal authentication (preview)
ClickHouse Writer includes a preview-only authentication method that connects using an Azure Entra ID application with the OAuth Client Credentials flow, instead of a ClickHouse username and password. Because this method is in preview, confirm its support status and availability with your Striim representative before relying on it in production. It requires Client ID, Client Secret, and Tenant ID properties, and a corresponding ClickHouse ROLE whose name matches an Entra ID app role value assigned to your application's service principal. Setting this up requires configuration in both the Azure portal and ClickHouse, and requires ClickHouse Cloud support to enable JWT and Entra ID authentication on your service.
Rotate credentials and certificates
You can rotate ClickHouse Writer credentials without undeploying a running application. Depending on the authentication type, you can update the Username and Password, or the Client SSL Certificate Path, Client SSL Key Path, and CA Certificate Path, or the Microsoft Entra Service Principal Client ID, Client Secret, and Tenant ID. To rotate credentials, open Connection Profiles, edit the profile, update the relevant fields, and save.