Simple 3 node secure CockroachDB cluster with NGINX acting as load balancer
roach-0
- CockroachDB noderoach-1
- CockroachDB noderoach-2
- CockroachDB nodelb
- NGINX acting as load balancerroach-cert
- Holds certificates as volume mounts
If you are using Google Chrome as your browser, you may want to navigate here
chrome://flags/#allow-insecure-localhost
and set this flag toEnabled
.
- because operation order is important, execute
./up.sh
instead ofdocker-compose up
- visit the CockroachDB UI @ https://localhost:8080 and login with username
test
and passwordpassword
- have fun!
The following creates a user called test
with password password
. This can be used to login to the CockroachDB UI.
docker-compose exec roach-0 /cockroach/cockroach sql --certs-dir=/certs --host=roach-0 --execute="CREATE USER test WITH PASSWORD 'password';"
The following creates a database called test
.
docker-compose exec roach-0 /cockroach/cockroach sql --certs-dir=/certs --host=roach-0 --execute="CREATE DATABASE test;"
docker exec -ti roach-0 /bin/bash
docker exec -ti roach-1 /bin/bash
docker exec -ti roach-2 /bin/bash
docker exec -ti lb /bin/sh