Set up a local EMQ X cluster with core/replicant nodes. Requirements: you need docker and docker-compose installed.
Usage: copy ./dev-cluster
script to the emqx repo root,
build the release: make emqx-rel
,
start the cluster: ./dev-cluster up
.
The CLI arguments are similar to docker-compose
.
Size of the cluster and log level can be customized via environment variables:
LOG_LEVEL
EMQ X log levelN_NODES
number of nodes in the cluster (default = 10)N_CORE_NODES
number of core nodes in the cluster (default = 3)LB_STRATEGY
haproxy load-balancing strategy (default =roundrobin
)
For example: LOG_LEVEL=debug N_NODES=10 N_CORE_NODES=5 ./dev-cluster up --build --force-recreate
Haproxy statistics will be available on http://localhost:8898
The haproxy exposes port 1883 for load balancing on the emqx
nodes. Each node also exposes their 1883 port directly on 2882 + 1
(e.g. emqx1 can be accessed on port 2883, emqx2 can be accessed on
port 2884, etc).