Skip to content

Instantly share code, notes, and snippets.

@edoardocostantinidev
Created September 28, 2020 13:24
Show Gist options
  • Save edoardocostantinidev/ba8f45c20de9ea2ea96599ff0f508bd0 to your computer and use it in GitHub Desktop.
Save edoardocostantinidev/ba8f45c20de9ea2ea96599ff0f508bd0 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment