Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Latest commit

 

History

History
29 lines (24 loc) · 797 Bytes

README.md

File metadata and controls

29 lines (24 loc) · 797 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 exec -ti crdb-0 /bin/bash
docker exec -ti crdb-1 /bin/bash
docker exec -ti crdb-2 /bin/bash
docker exec -ti lb /bin/bash