Updated on 2024-11-28 GMT+08:00

Commissioning Applications

ClickHouse applications can run in a Linux environment. After the application code is developed, you can upload the JAR package to the prepared Linux environment. The environment must be in the same VPC and security group as the clickhouse cluster to ensure network connectivity.

Prerequisites

JDK has been installed on Linux. The version must be the same as JDK version of the JAR file exported from IntelliJ IDEA. Java environment variables have been set.

Compiling and Running Applications

  1. Export the JAR file.
    1. Log in to IntelliJ IDEA and choose File > Project Structure > Artifacts.
    2. Click the plus sign (+) and choose JAR > From modules with dependencies.

    3. Choose com.xxx.clickhouse.examples.Demo from the Main Class drop-down list and click OK.

    4. Choose Build > Build Artifacts.... After the compilation is successful, view and obtain all JAR files in the clickhouse-examples\out\artifacts\clickhouse_examples_jar directory.

  2. Copy all JAR files in the clickhouse-examples\out\artifacts\clickhouse_examples.jar directory and the conf folder in the clickhouse-examples directory to the same directory of the ECS.
  3. Log in to the client node, go to the directory where the JAR file is uploaded, and change the file permission to 700.

    chmod -R 700 clickhouse-examples.jar

  4. In the client directory where clickhouse_examples.jar is stored, run the following commands to run the JAR file:

    java -cp ./*:conf/clickhouse-example.properties com.xxx.clickhouse.examples.Demo

Viewing Commissioning Results

If no exception or failure information is displayed, the application running is successful.

Figure 1 Run log