Skip to content

Multiple Hosts

chmonitor can monitor multiple ClickHouse clusters from a single deployment. The host selector in the dashboard header lets you switch between them. The URL reflects the active host as ?host=N.


Set CLICKHOUSE_HOST to a comma-separated list of host URLs. Position N across all four connection variables maps to host index N:

VariableExample
CLICKHOUSE_HOSThttp://ch-1:8123,http://ch-2:8123
CLICKHOUSE_USERuser1,user2
CLICKHOUSE_PASSWORDpass1,pass2
CLICKHOUSE_NAMEProduction,Staging

CLICKHOUSE_HOST defines the host count. CLICKHOUSE_NAME is optional — if omitted, hosts are labeled by their index (Host 0, Host 1, …). For credentials, you can provide a single shared value (applied to all hosts) or one value per host position.

The URL parameter ?host=0 targets the first host, ?host=1 the second, and so on. The dashboard defaults to ?host=0 on first load.


If all hosts share the same user and password, set a single value:

Terminal window
CLICKHOUSE_HOST=http://ch-1:8123,http://ch-2:8123
CLICKHOUSE_NAME=ch-1,ch-2
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=

Set a value per position:

Terminal window
CLICKHOUSE_HOST=http://ch-1:8123,http://ch-2:8123
CLICKHOUSE_NAME=Production,Staging
CLICKHOUSE_USER=prod_user,staging_user
CLICKHOUSE_PASSWORD=prod_pass,staging_pass

Replace vX.Y.Z with the release tag you want to run.

Same credentials:

Terminal window
docker run -d \
-e CLICKHOUSE_HOST='http://ch-1:8123,http://ch-2:8123' \
-e CLICKHOUSE_NAME='ch-1,ch-2' \
-e CLICKHOUSE_USER='default' \
-e CLICKHOUSE_PASSWORD='' \
-p 3000:3000 \
--name chmonitor \
ghcr.io/duyet/chmonitor:vX.Y.Z

Different credentials:

Terminal window
docker run -d \
-e CLICKHOUSE_HOST='http://ch-1:8123,http://ch-2:8123' \
-e CLICKHOUSE_NAME='ch-1,ch-2' \
-e CLICKHOUSE_USER='user1,user2' \
-e CLICKHOUSE_PASSWORD='password1,password2' \
-p 3000:3000 \
--name chmonitor \
ghcr.io/duyet/chmonitor:vX.Y.Z

## values.yaml — same credentials
env:
- name: CLICKHOUSE_HOST
value: "http://ch-1:8123,http://ch-2:8123"
- name: CLICKHOUSE_NAME
value: "ch-1,ch-2"
- name: CLICKHOUSE_USER
value: "default"
- name: CLICKHOUSE_PASSWORD
value: ""
## values.yaml — different credentials
env:
- name: CLICKHOUSE_HOST
value: "http://ch-1:8123,http://ch-2:8123"
- name: CLICKHOUSE_NAME
value: "Production,Staging"
- name: CLICKHOUSE_USER
value: "prod_user,staging_user"
- name: CLICKHOUSE_PASSWORD
value: "prod_pass,staging_pass"

Install or upgrade:

Terminal window
helm repo add chmonitor https://charts.chmonitor.dev
helm upgrade --install chmonitor chmonitor/chmonitor -f values.yaml

  • Adding or removing a host requires a restart (env change).
  • Health alerts run over all configured hosts when HEALTH_ALERT_ENABLED=true.
  • The agent API accepts a hostId parameter to target a specific host.

See Custom Name for display labels, and Environment Variables for the full connection reference.