Simple 3 node CockroachDB cluster with NGINX acting as load balancer
crdb-0
- CockroachDB nodecrdb-1
- CockroachDB nodecrdb-2
- CockroachDB nodelb
- NGINX acting as load balancer
- run
docker-compose up
- visit the CockroachDB UI @ http://localhost:8080
- have fun!
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;"
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