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_LEVELEMQ X log levelN_NODESnumber of nodes in the cluster (default = 10)N_CORE_NODESnumber of core nodes in the cluster (default = 3)LB_STRATEGYhaproxy 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).