Skip to content

Commit cbeaedb

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

File tree

3 files changed

+54
-43
lines changed

3 files changed

+54
-43
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ trim_trailing_whitespace = false
1616
[*.yml]
1717
indent_size = 2
1818

19+
[*.yaml]
20+
indent_size = 2
21+
1922
[*.scala]
2023
indent_size = 2
2124

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

+35-39
Original file line numberDiff line numberDiff line change
@@ -19,80 +19,76 @@ version: "3.8"
1919
services:
2020
# MinIO service for S3 storage
2121
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
22+
container_name: "minio"
23+
image: minio/minio
2824
environment:
2925
- MINIO_ROOT_USER=minioadmin
3026
- MINIO_ROOT_PASSWORD=minioadmin
31-
command: server /data --console-address ":9001"
32-
volumes:
33-
- minio_data:/data
27+
- MINIO_DOMAIN=minio
28+
ports:
29+
- "9000:9000" # MinIO API
30+
- "9001:9001" # MinIO Console
31+
command: [ "server", "/data", "--console-address", ":9001" ]
3432
networks:
3533
automq_net:
36-
ipv4_address: 10.6.0.2
3734
healthcheck:
38-
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
35+
test: [ "CMD", "curl", "-f", "http://minio:9000/minio/health/live" ]
3936
interval: 5s
4037
timeout: 5s
4138
retries: 3
4239

4340
# Create needed buckets
4441
mc:
45-
container_name: "${MC_DOCKER_NAME-mc}"
46-
hostname: "${MC_DOCKER_NAME-mc}"
47-
image: minio/mc:RELEASE.2023-09-07T22-48-55Z
42+
container_name: "mc"
43+
image: minio/mc
4844
depends_on:
4945
minio:
5046
condition: service_healthy
5147
entrypoint: >
5248
/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;
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
5757
"
5858
networks:
5959
- automq_net
6060

6161
# 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
62+
server1:
63+
container_name: "automq-single-server"
64+
image: automqinc/automq:latest
65+
stop_grace_period: 1m
7066
environment:
7167
- KAFKA_S3_ACCESS_KEY=minioadmin
7268
- 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
69+
- KAFKA_HEAP_OPTS=-Xms1g -Xmx4g -XX:MetaspaceSize=96m -XX:MaxDirectMemorySize=1G
70+
# Replace CLUSTER_ID with a unique base64 UUID using "bin/kafka-storage.sh random-uuid"
71+
- CLUSTER_ID=3D4fXN-yS1-vsQ8aJ_q4Mg
8072
command:
8173
- bash
8274
- -c
8375
- |
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
76+
/opt/automq/kafka/bin/kafka-server-start.sh \
77+
/opt/automq/kafka/config/kraft/server.properties \
78+
--override cluster.id=$$CLUSTER_ID \
79+
--override node.id=0 \
80+
--override controller.quorum.voters=0@server1:9093 \
81+
--override controller.quorum.bootstrap.servers=server1:9093 \
82+
--override advertised.listeners=PLAINTEXT://server1:9092 \
83+
--override s3.data.buckets='0@s3://automq-data?region=us-east-1&endpoint=http://minio:9000&pathStyle=true' \
84+
--override s3.ops.buckets='1@s3://automq-ops?region=us-east-1&endpoint=http://minio:9000&pathStyle=true' \
85+
--override s3.wal.path='0@s3://automq-data?region=us-east-1&endpoint=http://minio:9000&pathStyle=true'
8586
networks:
8687
automq_net:
87-
ipv4_address: 10.6.0.3
8888
depends_on:
8989
- minio
9090
- mc
9191

92-
volumes:
93-
minio_data:
94-
driver: local
95-
9692
networks:
9793
automq_net:
9894
name: automq_net

0 commit comments

Comments
 (0)