Simple 3 node CockroachDB cluster with HAProxy acting as load balancer
crdb-0
- CockroachDB nodecrdb-1
- CockroachDB nodecrdb-2
- CockroachDB nodeworkload-client
- CockroachDB node serving as theworkload
clientlb
- HAProxy acting as load balancer
- run
./up.sh
- visit the CockroachDB UI @ http://localhost:8080
- visit the HAProxy UI @ http://localhost:8081
- have fun!
While .up.sh
will automatically initialize and run the tpcc
workload, you can use the following command to restart the tpcc
sample workload
for 10 minutes. For more details see this.
docker compose exec workload-client /cockroach/cockroach workload run tpcc --tolerate-errors --warehouses=3 --duration=10m "postgresql://root@lb:26257?sslmode=disable"
docker compose exec crdb-0 /bin/bash
docker compose exec crdb-1 /bin/bash
docker compose exec crdb-2 /bin/bash
docker compose exec workload-client /bin/bash
docker compose exec lb /bin/sh
docker compose stop crdb-0
docker compose stop crdb-1
docker compose stop crdb-2