Skip to content

Commit 723b9b5

Browse files
committed
chore: provide a more practical quick start for single node setup
1 parent 9c66bc8 commit 723b9b5

File tree

2 files changed

+92
-85
lines changed

2 files changed

+92
-85
lines changed

README.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,24 @@
3939

4040
## ⛄ Get started with AutoMQ
4141

42-
### Deploy Locally on a Single Host
42+
> [!Tip]
43+
> Deploying a production-ready AutoMQ cluster is challenging. This Quick Start is only for evaluating AutoMQ features and is not suitable for production use. For production deployment best practices, please [contact](https://www.automq.com/contact) our community for support.
44+
45+
The `docker/docker-compose.yaml` file provides a simple single-node setup for quick evaluation and development:
46+
```shell
47+
docker compose -f docker/docker-compose.yaml up -d
4348
```
44-
curl https://download.automq.com/community_edition/standalone_deployment/install_run.sh | bash
49+
This setup features a single AutoMQ node serving as both controller and broker, alongside MinIO for S3 storage. All services operate within a Docker bridge network called `automq_net`, allowing you to start a Kafka producer in this network to test AutoMQ:
50+
```shell
51+
docker run --network automq_net automqinc/automq:latest /bin/bash -c \
52+
"/opt/automq/kafka/bin/kafka-producer-perf-test.sh --topic test-topic --num-records=1024000 --throughput 5120 --record-size 1024 \
53+
--producer-props bootstrap.servers=server1:9092 linger.ms=100 batch.size=524288 buffer.memory=134217728 max.request.size=67108864"
4554
```
46-
47-
The easiest way to run AutoMQ. You can experience features like [**Partition Reassignment in Seconds**](https://www.automq.com/docs/automq/getting-started/example-partition-reassignment-in-seconds) and [**Continuous Self-Balancing**](https://www.automq.com/docs/automq/getting-started/example-self-balancing-when-cluster-nodes-change) in your local machine.
55+
After testing, you can destroy the setup with:
56+
```shell
57+
docker compose -f docker/docker-compose.yaml down
58+
```
59+
The `docker/docker-compose-cluster.yaml` file offers a more complex setup with three AutoMQ nodes, ideal for testing AutoMQ's cluster features, and can be run in the same way.
4860

4961
There are more deployment options available:
5062
- [Deploy on Linux with 5 Nodes](https://www.automq.com/docs/automq/getting-started/cluster-deployment-on-linux)

docker/docker-compose.yaml

+76-81
Original file line numberDiff line numberDiff line change
@@ -17,88 +17,83 @@
1717
version: "3.8"
1818

1919
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
4239

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
6060

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
9590

9691
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

Comments
 (0)