|
17 | 17 | version: "3.8"
|
18 | 18 |
|
19 | 19 | services:
|
20 |
| - # MinIO service for S3 storage |
21 |
| - minio: |
22 |
| - container_name: "${MINIO_DOCKER_NAME-minio}" |
23 |
| - hostname: "${MINIO_DOCKER_NAME-minio}" |
24 |
| - image: minio/minio:RELEASE.2023-09-04T19-57-37Z |
25 |
| - ports: |
26 |
| - - "9000:9000" # MinIO API |
27 |
| - - "9001:9001" # MinIO Console |
28 |
| - environment: |
29 |
| - - MINIO_ROOT_USER=minioadmin |
30 |
| - - MINIO_ROOT_PASSWORD=minioadmin |
31 |
| - command: server /data --console-address ":9001" |
32 |
| - volumes: |
33 |
| - - minio_data:/data |
34 |
| - networks: |
35 |
| - automq_net: |
36 |
| - ipv4_address: 10.6.0.2 |
37 |
| - healthcheck: |
38 |
| - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] |
39 |
| - interval: 5s |
40 |
| - timeout: 5s |
41 |
| - retries: 3 |
| 20 | + # MinIO service for S3 storage |
| 21 | + minio: |
| 22 | + container_name: "minio" |
| 23 | + image: minio/minio |
| 24 | + environment: |
| 25 | + - MINIO_ROOT_USER=minioadmin |
| 26 | + - MINIO_ROOT_PASSWORD=minioadmin |
| 27 | + - MINIO_DOMAIN=minio |
| 28 | + ports: |
| 29 | + - "9000:9000" # MinIO API |
| 30 | + - "9001:9001" # MinIO Console |
| 31 | + command: ["server", "/data", "--console-address", ":9001"] |
| 32 | + networks: |
| 33 | + automq_net: |
| 34 | + healthcheck: |
| 35 | + test: ["CMD", "curl", "-f", "http://minio:9000/minio/health/live"] |
| 36 | + interval: 5s |
| 37 | + timeout: 5s |
| 38 | + retries: 3 |
42 | 39 |
|
43 |
| - # Create needed buckets |
44 |
| - mc: |
45 |
| - container_name: "${MC_DOCKER_NAME-mc}" |
46 |
| - hostname: "${MC_DOCKER_NAME-mc}" |
47 |
| - image: minio/mc:RELEASE.2023-09-07T22-48-55Z |
48 |
| - depends_on: |
49 |
| - minio: |
50 |
| - condition: service_healthy |
51 |
| - entrypoint: > |
52 |
| - /bin/sh -c " |
53 |
| - /usr/bin/mc config host add myminio http://minio:9000 minioadmin minioadmin; |
54 |
| - /usr/bin/mc mb myminio/automq-data; |
55 |
| - /usr/bin/mc policy set public myminio/automq-data; |
56 |
| - exit 0; |
57 |
| - " |
58 |
| - networks: |
59 |
| - - automq_net |
| 40 | + # Create needed buckets |
| 41 | + mc: |
| 42 | + container_name: "mc" |
| 43 | + image: minio/mc |
| 44 | + depends_on: |
| 45 | + minio: |
| 46 | + condition: service_healthy |
| 47 | + entrypoint: > |
| 48 | + /bin/sh -c " |
| 49 | + until (/usr/bin/mc config host add minio http://minio:9000 minioadmin minioadmin) do echo '...waiting...' && sleep 1; done; |
| 50 | + /usr/bin/mc rm -r --force minio/automq-data; |
| 51 | + /usr/bin/mc rm -r --force minio/automq-ops; |
| 52 | + /usr/bin/mc mb minio/automq-data; |
| 53 | + /usr/bin/mc mb minio/automq-ops; |
| 54 | + /usr/bin/mc policy set public minio/automq-data; |
| 55 | + /usr/bin/mc policy set public minio/automq-ops; |
| 56 | + tail -f /dev/null |
| 57 | + " |
| 58 | + networks: |
| 59 | + - automq_net |
60 | 60 |
|
61 |
| - # Single node with combined controller and broker roles |
62 |
| - automq: |
63 |
| - container_name: "${AUTOMQ_DOCKER_NAME-automq}" |
64 |
| - hostname: "${AUTOMQ_DOCKER_NAME-automq}" |
65 |
| - stop_grace_period: 2m |
66 |
| - image: automqinc/automq:1.3.0 |
67 |
| - ports: |
68 |
| - - "9092:9092" # Kafka API |
69 |
| - - "9093:9093" # Controller API |
70 |
| - environment: |
71 |
| - - KAFKA_S3_ACCESS_KEY=minioadmin |
72 |
| - - KAFKA_S3_SECRET_KEY=minioadmin |
73 |
| - - KAFKA_HEAP_OPTS=-Xms1g -Xmx1g -XX:MetaspaceSize=96m -XX:MaxDirectMemorySize=1G |
74 |
| - - KAFKA_CFG_AUTOBALANCER_REPORTER_NETWORK_IN_CAPACITY=5120 |
75 |
| - - KAFKA_CFG_AUTOBALANCER_REPORTER_NETWORK_OUT_CAPACITY=5120 |
76 |
| - - KAFKA_CFG_AUTOBALANCER_REPORTER_METRICS_REPORTING_INTERVAL_MS=5000 |
77 |
| - - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093 |
78 |
| - - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 |
79 |
| - - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT |
80 |
| - command: |
81 |
| - - bash |
82 |
| - - -c |
83 |
| - - | |
84 |
| - /opt/automq/scripts/start.sh up --process.roles controller,broker --node.id 0 --controller.quorum.voters 0@automq:9093 --s3.bucket automq-data --s3.endpoint http://10.6.0.2:9000 --s3.region us-east-1 --s3.path-style-access true |
85 |
| - networks: |
86 |
| - automq_net: |
87 |
| - ipv4_address: 10.6.0.3 |
88 |
| - depends_on: |
89 |
| - - minio |
90 |
| - - mc |
91 |
| - |
92 |
| -volumes: |
93 |
| - minio_data: |
94 |
| - driver: local |
| 61 | + # Single node with combined controller and broker roles |
| 62 | + server1: |
| 63 | + container_name: "automq-single-server" |
| 64 | + image: automqinc/automq:latest |
| 65 | + stop_grace_period: 1m |
| 66 | + environment: |
| 67 | + - KAFKA_S3_ACCESS_KEY=minioadmin |
| 68 | + - KAFKA_S3_SECRET_KEY=minioadmin |
| 69 | + - KAFKA_HEAP_OPTS=-Xms1g -Xmx4g -XX:MetaspaceSize=96m -XX:MaxDirectMemorySize=1G |
| 70 | + - KAFKA_CFG_CLUSTER_ID=3D4fXN-yS1-vsQ8aJ_q4Mk |
| 71 | + command: |
| 72 | + - bash |
| 73 | + - -c |
| 74 | + - | |
| 75 | + /opt/automq/kafka/bin/kafka-server-start.sh \ |
| 76 | + /opt/automq/kafka/config/kraft/server.properties \ |
| 77 | + --override cluster.id=3D4fXN-yS1-vsQ8aJ_q4Mg \ |
| 78 | + --override node.id=0 \ |
| 79 | + --override controller.quorum.voters=0@server1:9093 \ |
| 80 | + --override controller.quorum.bootstrap.servers=server1:9093 \ |
| 81 | + --override advertised.listeners=PLAINTEXT://server1:9092 \ |
| 82 | + --override s3.data.buckets='0@s3://automq-data?region=us-east-1&endpoint=http://minio:9000&&pathStyle=true' \ |
| 83 | + --override s3.ops.buckets='1@s3://automq-ops?region=us-east-1&endpoint=http://minio:9000&&pathStyle=true' \ |
| 84 | + --override s3.wal.path='0@s3://automq-data?region=us-east-1&endpoint=http://minio:9000&&pathStyle=true' |
| 85 | + networks: |
| 86 | + automq_net: |
| 87 | + depends_on: |
| 88 | + - minio |
| 89 | + - mc |
95 | 90 |
|
96 | 91 | networks:
|
97 |
| - automq_net: |
98 |
| - name: automq_net |
99 |
| - driver: bridge |
100 |
| - ipam: |
101 |
| - driver: default |
102 |
| - config: |
103 |
| - - subnet: "10.6.0.0/16" |
104 |
| - gateway: "10.6.0.1" |
| 92 | + automq_net: |
| 93 | + name: automq_net |
| 94 | + driver: bridge |
| 95 | + ipam: |
| 96 | + driver: default |
| 97 | + config: |
| 98 | + - subnet: "10.6.0.0/16" |
| 99 | + gateway: "10.6.0.1" |
0 commit comments