EMQX static cluster

Moki Lv6

.env

1
2
3
NR=1234
IP1=192.168.1.11
IP2=192.168.1.12

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
services:
mqtt_server:
build: .
environment:
- "EMQX_NAME=emqx-$NR"
- "EMQX_HOST=$IP1"
- "EMQX_CLUSTER__DISCOVERY_STRATEGY=static"
- "EMQX_CLUSTER__STATIC__SEEDS=[emqx-$NR@$IP1, emqx-$NR@$IP2]"
ports:
- 1883:1883
- 8883:8883
- 5369:5369 # Clustering EMQX
- 4370:4370 # Clustering Erlang

Dockerfile

1
2
3
FROM emqx:5.1.6

ENV EMQX_NODE__COOKIE=secret-1928
On this page
EMQX static cluster