Skip to content

ClickHouse

You can use an external ClickHouse database instance outside the PMM Server container running on other hosts.

Environment variables

PMM predefines certain flags that allow you to use ClickHouse parameters as environment variables:

Warning

The PERCONA_TEST_* environment variables are experimental and subject to change. It is recommended that you use these variables for testing purposes only and not on production.

To use ClickHouse as an external database instance, use the following environment variables:

PERCONA_TEST_PMM_CLICKHOUSE_ADDR -> hostname:port
Name of the host and port of the external ClickHouse database instance.

Optional environment variables

PERCONA_TEST_PMM_CLICKHOUSE_DATABASE -> database name
Database name of the external ClickHouse database instance.
​​PERCONA_TEST_PMM_CLICKHOUSE_POOL_SIZE -> pool size
The maximum number of threads in the current connection thread pool. This value cannot be bigger than max_thread_pool_size.
PERCONA_TEST_PMM_CLICKHOUSE_BLOCK_SIZE -> max block size
The number of rows to load from tables in one block for this connection.

Example

To use ClickHouse as an external database instance, start the PMM docker with the specified variables for external ClickHouse: ​​

-e PERCONA_TEST_PMM_CLICKHOUSE_ADDR=$ADDRESS:$PORT
-e PERCONA_TEST_PMM_CLICKHOUSE_DATABASE=$DB
-e PERCONA_TEST_PMM_CLICKHOUSE_POOL_SIZE=1 
-e PERCONA_TEST_PMM_CLICKHOUSE_BLOCK_SIZE=65000

Troubleshooting

To troubleshoot issues, see the ClickHouse troubleshooting documentation.

Get expert help

If you need assistance, you can find comprehensive and free database knowledge on our community forum or blog posts. For professional support and services, contact our Percona Database Experts.