Option 1: Check the Admin UI
In version 20.1 and later, the Cluster ID is printed a the top of the Overview page of the Admin UI:
Option 2: Open a session with cockroach sql
After opening a terminal session on your node, run cockroach sql. The cluster ID will be provided after the server and client versions:
# Welcome to the CockroachDB SQL shell.
# All statements must be terminated by a semicolon.
# To exit, type: \q.
# Server version: CockroachDB CCL v20.1.7 (x86_64-apple-darwin14, built 2020/10/12 15:58:53, go1.13.9) (same version as client)
# Cluster ID: 27e7cf4b-5460-423c-a27c-5a7d18976b3c
# Organization: Cockroach Labs - Production Testing
# Enter \? for a brief introduction.
Option 3: Inspect the cluster logs
Your cluster ID is provided near the top of each cockroachdb log file. You can find it by searching for "node startup completed"