Skip to content

Instantly share code, notes, and snippets.

@azazeal
Last active November 21, 2020 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azazeal/1284a2dbff83225f61dc49e5e62fe54d to your computer and use it in GitHub Desktop.
Save azazeal/1284a2dbff83225f61dc49e5e62fe54d to your computer and use it in GitHub Desktop.
Quick 3-node CockroachDB cluster via Docker Compose
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