Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 813 Bytes

README.md

File metadata and controls

29 lines (24 loc) · 813 Bytes

Basic CockroachDB Cluster with NGINX

Simple 3 node CockroachDB cluster with NGINX acting as load balancer

Services

  • crdb-0 - CockroachDB node
  • crdb-1 - CockroachDB node
  • crdb-2 - CockroachDB node
  • lb - NGINX acting as load balancer

Getting started

  1. run docker compose up
  2. visit the CockroachDB UI @ http://localhost:8080
  3. have fun!

Helpful Commands

Execute SQL

Use the following to execute arbitrary SQL on the CockroachDB cluster. The following creates a database called test.

docker compose exec crdb-0 /cockroach/cockroach sql --insecure --execute="CREATE DATABASE test;"

Open Interactive Shells

docker compose exec crdb-0 /bin/bash
docker compose exec crdb-1 /bin/bash
docker compose exec crdb-2 /bin/bash
docker compose exec lb /bin/bash