ClickHouse¶
The Wodby ClickHouse catalog stack runs a single ClickHouse server. The current service and defaults are documented in
wodby/stack-clickhouse.
Connect an application¶
Link your application's app service to the ClickHouse app service. See Links. The app service receives the host, port and the tokens below in variables named by the linking service. Read them in code. Do not copy the password into your repository.
| Port | Use |
|---|---|
8123 |
HTTP interface |
9000 |
Native protocol, private |
Applications in the same app environment use both ports directly, without TLS.
The tokens are on the ClickHouse app service's Configuration > Tokens tab:
database:defaultusername:wodbypassword: generated by Wodby
The account can create other users, roles and databases with SQL. Create further databases, users and grants with SQL instead of adding environment variables. Server settings are not exposed as settings or config files.
Public address¶
Port 8123 is the main HTTP endpoint, so it gets a public HTTPS address. Port 9000 has no route.
- The address answers
Ok.at its root. Open/playto run queries and/dashboardfor the built-in charts. Sign in with the account above. - The address accepts SQL from anywhere for anyone with the password. Requests without it are refused.
/playand/dashboardsend the password in the request URL, so it can appear in ingress logs.- Do not turn on Wodby Basic Auth for this service. ClickHouse uses the
Authorizationheader for its own login, so/play,/dashboardand HTTP clients stop working behind Basic Auth. To restrict who can reach the address, use App Access or disable the route.
Resources, data and backups¶
ClickHouse runs as a single node and does not scale. The stack requests 0.5 CPU and 1024 MiB and limits it to 2 CPU and 4096 MiB. Change resources under Runtime > Resources.
The stack adds a 20 GiB ClickHouse data volume. The service has no backup or import support.
Check that it works¶
From any service in the app environment, GET http://<app service name>:8123/ping answers Ok. In a
web terminal on the ClickHouse app service, run:
clickhouse-client --user "$CLICKHOUSE_USER" --password "$CLICKHOUSE_PASSWORD" --query "SHOW DATABASES"