-
Notifications
You must be signed in to change notification settings - Fork 6
docs: Add docker compose setup with 3 node etcd cluster #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
184 changes: 184 additions & 0 deletions
184
examples/docker-compose/docker-compose-etcd-3-node.yaml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,184 @@ | ||
| # Iceberg REST catalog with a 3-member etcd cluster (static bootstrap). | ||
| # | ||
| # First-time / fresh data: | ||
| # docker compose -f docker-compose-etcd-3-node.yaml up | ||
| # | ||
| # Coming from a single-node stack (see docker-compose-etcd-1-instance.yaml): | ||
| # - If you do NOT need to keep etcd data: stop the 1-node stack, remove the old | ||
| # etcd volume if any, then start this file (3 fresh members). | ||
| # - If you MUST keep the existing data: you cannot re-bootstrap a new 3-node | ||
| # static cluster from the same data dir. Add members to the *running* 1-node | ||
| # cluster with `etcdctl member add` and start the new nodes with | ||
| # --initial-cluster-state=existing (see etcd "runtime reconfiguration" docs). | ||
| # | ||
| # Usage: docker compose -f docker-compose-etcd-3-node.yaml up | ||
| services: | ||
| etcd-1: | ||
| image: quay.io/coreos/etcd:v3.5.12 | ||
| restart: unless-stopped | ||
| command: | ||
| - etcd | ||
| - --name=etcd-1 | ||
| - --data-dir=/etcd-data | ||
| - --listen-client-urls=http://0.0.0.0:2379 | ||
| - --advertise-client-urls=http://etcd-1:2379 | ||
| - --listen-peer-urls=http://0.0.0.0:2380 | ||
| - --initial-advertise-peer-urls=http://etcd-1:2380 | ||
| - --initial-cluster=etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380,etcd-3=http://etcd-3:2380 | ||
| - --initial-cluster-token=ice-rest-catalog-etcd | ||
| - --initial-cluster-state=new | ||
| volumes: | ||
| - etcd-1-data:/etcd-data | ||
| healthcheck: | ||
| test: ["CMD", "etcdctl", "--endpoints=http://127.0.0.1:2379", "endpoint", "health"] | ||
| interval: 5s | ||
| timeout: 3s | ||
| retries: 15 | ||
| # Uncomment to run etcdctl from the host against this node: | ||
| # ports: | ||
| # - "12379:2379" | ||
|
|
||
| etcd-2: | ||
| image: quay.io/coreos/etcd:v3.5.12 | ||
| restart: unless-stopped | ||
| command: | ||
| - etcd | ||
| - --name=etcd-2 | ||
| - --data-dir=/etcd-data | ||
| - --listen-client-urls=http://0.0.0.0:2379 | ||
| - --advertise-client-urls=http://etcd-2:2379 | ||
| - --listen-peer-urls=http://0.0.0.0:2380 | ||
| - --initial-advertise-peer-urls=http://etcd-2:2380 | ||
| - --initial-cluster=etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380,etcd-3=http://etcd-3:2380 | ||
| - --initial-cluster-token=ice-rest-catalog-etcd | ||
| - --initial-cluster-state=new | ||
| volumes: | ||
| - etcd-2-data:/etcd-data | ||
| healthcheck: | ||
| test: ["CMD", "etcdctl", "--endpoints=http://127.0.0.1:2379", "endpoint", "health"] | ||
| interval: 5s | ||
| timeout: 3s | ||
| retries: 15 | ||
| # Uncomment to run etcdctl from the host against this node: | ||
| # ports: | ||
| # - "12479:2379" | ||
|
|
||
| etcd-3: | ||
| image: quay.io/coreos/etcd:v3.5.12 | ||
| restart: unless-stopped | ||
| command: | ||
| - etcd | ||
| - --name=etcd-3 | ||
| - --data-dir=/etcd-data | ||
| - --listen-client-urls=http://0.0.0.0:2379 | ||
| - --advertise-client-urls=http://etcd-3:2379 | ||
| - --listen-peer-urls=http://0.0.0.0:2380 | ||
| - --initial-advertise-peer-urls=http://etcd-3:2380 | ||
| - --initial-cluster=etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380,etcd-3=http://etcd-3:2380 | ||
| - --initial-cluster-token=ice-rest-catalog-etcd | ||
| - --initial-cluster-state=new | ||
| volumes: | ||
| - etcd-3-data:/etcd-data | ||
| healthcheck: | ||
| test: ["CMD", "etcdctl", "--endpoints=http://127.0.0.1:2379", "endpoint", "health"] | ||
| interval: 5s | ||
| timeout: 3s | ||
| retries: 15 | ||
| # Uncomment to run etcdctl from the host against this node: | ||
| # ports: | ||
| # - "12579:2379" | ||
|
|
||
| minio: | ||
| image: minio/minio:RELEASE.2025-03-12T18-04-18Z | ||
| restart: unless-stopped | ||
| command: [ 'server', '/data', '--address', ':8999', '--console-address', ':9001' ] | ||
| environment: | ||
| MINIO_ROOT_USER: miniouser | ||
| MINIO_ROOT_PASSWORD: miniopassword | ||
| ports: | ||
| - '8999:8999' # 9000 is taken by clickhouse | ||
| - '9001:9001' # web console | ||
| volumes: | ||
| - minio:/data | ||
| minio-init: | ||
| image: minio/mc:RELEASE.2025-03-12T17-29-24Z | ||
| restart: on-failure # run once and exit | ||
| entrypoint: > | ||
| /bin/sh -c " | ||
| sleep 1; until /usr/bin/mc alias set local http://minio:8999 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD; do echo waiting for minio to start...; sleep 1; done; | ||
| /usr/bin/mc mb --ignore-existing local/bucket1; | ||
| exit 0; | ||
| " | ||
| environment: | ||
| MINIO_ROOT_USER: miniouser | ||
| MINIO_ROOT_PASSWORD: miniopassword | ||
| depends_on: | ||
| - minio | ||
| ice-rest-catalog: | ||
| image: altinity/ice-rest-catalog:${ICE_REST_CATALOG_TAG:-debug-with-ice-latest-master@sha256:9f5308309b98d2e0b76346cd29c22557076bfcb0070eb8f32b69b87932b9e37c} | ||
| pull_policy: ${ICE_REST_CATALOG_PULL_POLICY:-always} | ||
| restart: unless-stopped | ||
| ports: | ||
| - '5001:5000' # iceberg/http | ||
| configs: | ||
| - source: ice-rest-catalog-yaml | ||
| target: /etc/ice/ice-rest-catalog.yaml | ||
| depends_on: | ||
| etcd-1: | ||
| condition: service_healthy | ||
| etcd-2: | ||
| condition: service_healthy | ||
| etcd-3: | ||
| condition: service_healthy | ||
| minio-init: | ||
| condition: service_completed_successfully | ||
| clickhouse: | ||
| image: altinity/clickhouse-server:25.8.9.20496.altinityantalya-alpine | ||
| restart: unless-stopped | ||
| environment: | ||
| CLICKHOUSE_SKIP_USER_SETUP: "1" # insecure | ||
| ports: | ||
| - "8123:8123" # clickhouse/http | ||
| - "9000:9000" # clickhouse/native | ||
| configs: | ||
| - source: clickhouse-init | ||
| target: /docker-entrypoint-initdb.d/init-db.sh | ||
| volumes: | ||
| # for access to clickhouse-logs | ||
| - ./data/docker-compose/clickhouse/var/log/clickhouse-server:/var/log/clickhouse-server | ||
| # - ./config.xml:/etc/clickhouse-server/conf.d/config.xml | ||
| depends_on: | ||
| - ice-rest-catalog | ||
| configs: | ||
| clickhouse-init: | ||
| content: | | ||
| #!/bin/bash | ||
| exec clickhouse client --query $" | ||
| SET allow_experimental_database_iceberg = 1; | ||
|
|
||
| DROP DATABASE IF EXISTS ice; | ||
|
|
||
| CREATE DATABASE ice | ||
| ENGINE = DataLakeCatalog('http://ice-rest-catalog:5000') | ||
| SETTINGS catalog_type = 'rest', | ||
| auth_header = 'Authorization: Bearer foo', | ||
| storage_endpoint = 'http://minio:8999', | ||
| warehouse = 's3://bucket1'; | ||
| " | ||
| ice-rest-catalog-yaml: | ||
| content: | | ||
| uri: etcd:http://etcd-1:2379,http://etcd-2:2379,http://etcd-3:2379 | ||
| warehouse: s3://bucket1 | ||
| s3: | ||
| endpoint: http://minio:8999 | ||
| pathStyleAccess: true | ||
| accessKeyID: miniouser | ||
| secretAccessKey: miniopassword | ||
| region: minio | ||
| bearerTokens: | ||
| - value: foo | ||
| volumes: | ||
| minio: | ||
| etcd-1-data: | ||
| etcd-2-data: | ||
| etcd-3-data: | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add commented ports map like the single node setup:
Port numbers should match the etc-cluster-setup docs (12379, 12479, 12579)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated