Last active
November 21, 2020 23:07
-
-
Save azazeal/1284a2dbff83225f61dc49e5e62fe54d to your computer and use it in GitHub Desktop.
Quick 3-node CockroachDB cluster via Docker Compose
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
version: "3.7" | |
services: | |
node01: | |
image: cockroachdb/cockroach:v20.2.1 | |
volumes: | |
- /data/crdb/node01:/cockroach/cockroach-data | |
command: start --insecure --logtostderr --join=node02,node03 | |
ports: | |
- 8080:8080 | |
- 26257:26257 | |
restart: on-failure | |
node02: | |
image: cockroachdb/cockroach:v20.2.1 | |
volumes: | |
- /data/crdb/node02:/cockroach/cockroach-data | |
command: start --insecure --logtostderr --join=node01,node03 | |
restart: on-failure | |
node03: | |
image: cockroachdb/cockroach:v20.2.1 | |
volumes: | |
- /data/crdb/node03:/cockroach/cockroach-data | |
command: start --insecure --logtostderr --join=node01,node02 | |
restart: on-failure | |
# when docker compose gets everything up for the first time: | |
# | |
# docker run -it --rm --network=crdb_default cockroachdb/cockroach:v20.2.1 init --host=node01 --insecure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment