How to login to Clickhouse Database
search cancel

How to login to Clickhouse Database

book

Article ID: 454537

calendar_today

Updated On:

Products

VMware Tanzu Platform - Hub

Issue/Introduction

This KB discuss how to login to Clickhouse Database for troubleshooting purposes.

Cause

 

Resolution

These are the steps to login to Clickhouse Database which can be used during troubleshooting purposes.


  1. ssh into Tanzu hub's registry vm
    bosh -d hub-####### ssh registry/0
  2. (Optional) Check health first to ensure you have no issues with the cluster
    kubectl cluster-info 

    kubectl get nodes -n tanzusm

    kubectl get pods -n tanzusm 
  3. Get pod name
    kubectl get pods -n tanzusm | grep clickhouse 
  4. Get password:
    kubectl get secret clickhouse-secret -n tanzusm -o jsonpath='{.data.password}' | base64 --decode; echo ""
  5. Login using clickhouse-client specify the pod name from Step 3. It will prompt for password, use the password from Step 4
    kubectl exec -it <chi-clickhouse-metrics-pod-name> -n tanzusm -- clickhouse-client 


Useful query commands:

SHOW DATABASES;
SHOW TABLES from <database-name>;


CRITICAL:
Making direct structural or data modifications to the clickhouse database is strictly discouraged and can cause severe, irreversible system issues.