Skip to content

Instantly share code, notes, and snippets.

View edoardocostantinidev's full-sized avatar
🏠
Working from home

Edoardo Costantini edoardocostantinidev

🏠
Working from home
View GitHub Profile
@edoardocostantinidev
edoardocostantinidev / cockroachdb_docker_cluster.sh
Created September 28, 2020 13:24
CockRoachDB docker cluster
#!/bin/bash
docker network create -d bridge roachnet
docker run -d name=roach1 --hostname=roach1 --net=roachnet -p 26257:26257 -p 9090:8080 -v "${PWD}/cockroach-data/roach1:/cockroach/cockroach-data" cockroachdb/cockroach start --insecure --join=roach1,roach2,roach3
docker run -d --name=roach2 --hostname=roach2 --net=roachnet -v "${PWD}/cockroach-data/roach2:/cockroach/cockroach-data" cockroachdb/cockroach start --insecure --join=roach1,roach2,roach3
docker run -d --name=roach3 --hostname=roach3 --net=roachnet -v "${PWD}/cockroach-data/roach3:/cockroach/cockroach-data" cockroachdb/cockroach start --insecure --join=roach1,roach2,roach3
docker exec -it roach1 ./cockroach init --insecure