Skip to content

Instantly share code, notes, and snippets.

@pyar6329
Last active March 29, 2019 00:23
Show Gist options
  • Save pyar6329/83a821da0891c29e05d5103818fc41d5 to your computer and use it in GitHub Desktop.
Save pyar6329/83a821da0891c29e05d5103818fc41d5 to your computer and use it in GitHub Desktop.
CockroachDB 4 clusters
version: '3.7'
services:
cockroach1:
image: cockroachdb/cockroach:v2.1.6
container_name: sample-cockroach-1
command: start --insecure
networks:
sample:
aliases:
- sample-cockroach-1
volumes:
- ./docker/var/cockroach/data1:/cockroach/cockroach-data
ports:
- "26257:26257"
- "8080:8080"
cockroach2:
image: cockroachdb/cockroach:v2.1.6
container_name: sample-cockroach-2
depends_on:
- cockroach1
command: start --insecure --join=sample-cockroach-1
healthcheck:
test: ["CMD-SHELL", "curl -sL http://localhost:8080/health || exit 1"]
interval: 60s
timeout: 5s
retries: 3
start_period: 30s
networks:
sample:
aliases:
- sample-cockroach-2
volumes:
- ./docker/var/cockroach/data2:/cockroach/cockroach-data
cockroach3:
image: cockroachdb/cockroach:v2.1.6
container_name: sample-cockroach-3
depends_on:
- cockroach1
command: start --insecure --join=sample-cockroach-1
healthcheck:
test: ["CMD-SHELL", "curl -sL http://localhost:8080/health || exit 1"]
interval: 60s
timeout: 5s
retries: 3
start_period: 30s
networks:
sample:
aliases:
- sample-cockroach-3
volumes:
- ./docker/var/cockroach/data3:/cockroach/cockroach-data
cockroach4:
image: cockroachdb/cockroach:v2.1.6
container_name: sample-cockroach-4
depends_on:
- cockroach1
command: start --insecure --join=sample-cockroach-1
healthcheck:
test: ["CMD-SHELL", "curl -sL http://localhost:8080/health || exit 1"]
interval: 60s
timeout: 5s
retries: 3
start_period: 30s
networks:
sample:
aliases:
- sample-cockroach-4
volumes:
- ./docker/var/cockroach/data4:/cockroach/cockroach-data
networks:
sample:
@pyar6329
Copy link
Author

$ tree -L 4
.
├── docker
│   └── var
│       └── cockroach
│           ├── data1
│           ├── data2
│           ├── data3
│           └── data4
└── docker-compose.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment