Multiple Hosts
Monitor multiple ClickHouse clusters from a single deployment using comma-separated connection variables and the host selector.
chmonitor can monitor multiple ClickHouse clusters from a single deployment. The host selector in the dashboard header lets you switch between them, and the URL reflects the active host as ?host=N.
How it works
Set CLICKHOUSE_HOST to a comma-separated list of host URLs. Position N across all four connection variables maps to host index N.
| Variable | Example |
|---|---|
CLICKHOUSE_HOST | http://ch-1:8123,http://ch-2:8123 |
CLICKHOUSE_USER | user1,user2 |
CLICKHOUSE_PASSWORD | pass1,pass2 |
CLICKHOUSE_NAME | Production,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.
Configure
Choose the credential strategy that matches your clusters.
If all hosts share the same user and password, set a single value:
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:
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_passDocker
Replace vX.Y.Z with the release tag you want to run.
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/chmonitor/chmonitor:vX.Y.Zdocker 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/chmonitor/chmonitor:vX.Y.ZKubernetes / Helm
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
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:
helm repo add chmonitor https://charts.chmonitor.dev
helm upgrade --install chmonitor chmonitor/chmonitor -f values.yamlNotes
- 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
hostIdparameter to target a specific host.