Multiple Hosts

You can configure the UI to have multiple ClickHouse hosts by using these environment variables:

  • CLICKHOUSE_HOST: Separated by commas, for example: http://ch-1:8123,http://ch-2:8123
  • CLICKHOUSE_NAME: (Optional) Name of the ClickHouse instance, must match the number of hosts in CLICKHOUSE_HOST, for example ch-1,ch-2.

All these hosts will share the same CLICKHOUSE_USER and CLICKHOUSE_PASSWORD. If you want to have multiple users/passwords for each host, specify them in the usual way:

  • CLICKHOUSE_USER: user1,user2
  • CLICKHOUSE_PASSWORD: password1,password2

Examples Docker

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

Docker (same user)

    docker run -it \
      -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='' \
      --name chmonitor \
    ghcr.io/duyet/chmonitor:vX.Y.Z
    ```

#### Docker (different user)

```bash
    docker run -it \
      -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' \
      --name chmonitor \
    ghcr.io/duyet/chmonitor:vX.Y.Z
    ```

## Examples Kubernetes

#### Kubernetes (same user)

```bash
    helm repo add duyet https://duyet.github.io/charts
    
    cat <<EOF >> values.yaml
    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: ''
    EOF
    
    helm install -f values.yaml clickhouse-monitoring-release duyet/clickhouse-monitoring
    ```

#### Kubernetes (different user)

```bash
    helm repo add duyet https://duyet.github.io/charts
    
    cat <<EOF >> values.yaml
    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: user1,user2
    - name: CLICKHOUSE_PASSWORD
      value: password1,password2
    EOF
    
    helm install -f values.yaml clickhouse-monitoring-release duyet/clickhouse-monitoring
    ```