ClickHouse
Choosing a Configuration Type
To specify the configuration type, you need to select one of the tiles displayed on the page. In this case, select the Clickhouse tile.
Once saved, the configuration type cannot be changed.
Entering Connection Information
Further configuration details are entered in the Enter configuration information section. Fields marked with a red asterisk are mandatory. If any field contains incorrect data, the configuration will not be saved, and an error message will appear next to the field with the issue. Follow these steps to input connection information:
- Enter the configuration name in the
Configuration Nameinput field. Only Latin letters or numbers in CamelCase style are allowed - Then, select a JDBC driver in the
Upload Driverfield. If the required driver is not listed, you can upload your own by clicking theUpload Filebutton below the input field. A modal window will open where you need to select a JDBC driver with a.jarextension. Other file types will not be accepted - The "Driver Class Name" field is filled automatically. If the JDBC driver contains multiple classes, you can specify the required class. Only Latin letters or numbers are allowed in this field
For connecting to ClickHouse, it is recommended to use the official driver com.clickhouse:clickhouse-jdbc in the *-all-dependencies.jar artifact variant. Such JAR files already contain all necessary dependencies and do not require additional library installation.
A suitable version can be found in the central Maven repository (section com.clickhouse / clickhouse-jdbc) or downloaded directly via a link like:
https://repo1.maven.org/maven2/com/clickhouse/clickhouse-jdbc/<version>/clickhouse-jdbc-<version>-all-dependencies.jar
By default, the connection string field is auto-populated based on the JDBC driver class. For ClickHouse, the following classes are supported: cc.blynk.clickhouse.ClickHouseDriver, com.clickhouse.jdbc.ClickHouseDriver. If the driver uses different classes, the connection string will still be auto-filled, but you should verify the Connection String field for accuracy. Otherwise, switch to advanced mode and correct it manually.
- Enter the host in the "Host" field. Examples include
172.168.0.1oryourhost - Enter the port in the "Port" field. Only numbers are allowed
- If needed, you can specify the default database name in the "Default Database" field
- If your connection requires SSL validation, enable the "SSL Validation" field. A warning about saving data in the keystore will appear, as shown in the illustration

You can then enable host name verification and specify the path to the trust store in the Trust Store Path field. Only paths like /my_path/to/trust-store/ are allowed.
SSL parameters are set for the official ClickHouse driver. If you use a different driver, switch to advanced mode and enter the required parameters manually.
-
If your connection requires user and password authentication or just a username, fill in the respective "User" and "Password" fields
-
To test the connection, click the "Test Connection" button. If the ClickHouse connection is successful, the following message will appear:

Otherwise, an error message will be displayed, such as:

The article shows an example error message. The actual error may vary.
The configuration can be saved with connection errors. However, it will not be saved if there are format errors or empty mandatory fields.
Preparing Trust Store and Keystore for SSL Connections
This section describes how to prepare a trust store with certificates for verifying the ClickHouse server and how to pass the trust store password to a secure parameter storage (keystore).
Purpose of the Trust Store
A trust store is a file-based storage of trusted certificates (usually in JKS or PKCS12 format) used by the JVM to verify server authenticity.
The trust store must contain the certificate of the Certification Authority (CA) that signed the ClickHouse server certificates. If a self-signed certificate is used for ClickHouse, that very certificate should be added to the trust store.
Creating and Populating the Trust Store
-
Obtain the CA certificate file or the ClickHouse self-signed certificate in PEM/CRT format, e.g.,
clickhouse-ca.pem -
Copy this file to the node from which the connection to ClickHouse is made (the node where the component using the JDBC connection runs)
-
Create a directory for the
trust storeif it doesn't already exist (e.g., the application configuration directory). -
Create a new
trust storeand import the certificate into it using thekeytoolutility:keytool -importcert -file clickhouse-ca.pem -alias clickhouse-ca -keystore /path/to/clickhouse-truststore.jks -storetype JKS -storepass <truststore_password>On the first run,
keytoolwill prompt you to create a new storage file and request a password. This password must be remembered—it will be used when configuring the keystore. -
Restrict access to the
trust storefile so that only the system user running the application can access it:chown <user>:<group> /path/to/clickhouse-truststore.jks
chmod 600 /path/to/clickhouse-truststore.jks -
In the ClickHouse connection configuration interface, specify the full path to the created file in the
Trust store pathfield
Adding the Trust Store Password to the Keystore
For security, the trust store password is not stored in plain text in the configuration. Instead, it should be saved in a secure parameter storage (keystore).
After enabling the SSL validation option and filling in the Trust store path field, a yellow warning appears at the bottom of the form, displaying the keystore variable name into which the password must be saved. The name has the format:
sme.sa.trust_store.password.<ConfigurationName>
General procedure:
-
Click
Save changesin the connection configuration -
Refresh the page to ensure the warning and keystore variable name are displayed correctly
-
On each node where connections to ClickHouse are made, execute the command to add an entry to the keystore using the specified variable name. For OpenSearch-based platforms, this is done using the
opensearch-keystoreutility (the path and command may vary depending on the distribution):opensearch-keystore add sme.sa.trust_store.password.<ConfigurationName> -
In interactive mode, the utility will request a value. Enter the password used when creating the trust store (
<truststore_password>) -
Repeat the operation on all cluster nodes that require access to ClickHouse via this configuration
- the variable name for the keystore must be taken exactly from the yellow warning in the configuration interface
- if you change the configuration name, the variable name will also change, and the password will need to be added again
- after modifying the keystore, it is recommended to restart the relevant services so the new parameters are picked up
Editing Configuration Features
The configuration is edited following the same rules as it is created. Fields can be modified in any arbitrary order, while maintaining the overall logic: first, select the correct JDBC driver; then, specify the connection parameters (host, port, database); after that, enable SSL if necessary, configure the trust store path, and add the password to the keystore. After saving the changes and successfully verifying the connection, the configuration is ready for use.