Created
September 28, 2020 13:24
-
-
Save edoardocostantinidev/ba8f45c20de9ea2ea96599ff0f508bd0 to your computer and use it in GitHub Desktop.
CockRoachDB docker cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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