Installation
EMQX Enterprise binary packages are released on below operating systems:
- CentOS 7 (EL7)
- CentOS 8 (EL8)
- Raspbian 10
- Debian 9
- Debian 10
- Ubuntu 16.04
- Ubuntu 18.04
- Ubuntu 20.04
Package Installation (Linux)
Download EMQX RPM package from emqx.com (opens new window) or Github (opens new window)
Install EMQX Broker:
RPM:
$ sudo rpm -ivh emqx-ee-cenots7-v4.0.0.x86_64.rpm
DEB:
# for ubuntu
$ sudo apt install -i ./emqx-ee-ubuntu18.04-v4.0.0_amd64.deb
# for debian
# first ensure libodbc is installed, then
$ sudo dpkg -i emqx-ee-ubuntu18.04-v4.0.0_amd64.deb
Start EMQX Broker
quick start
$ emqx start
emqx 4.0.0 is started successfully!
$ emqx_ctl status
Node 'emqx@127.0.0.1' is started
emqx v4.0.0 is running
systemctl
$ sudo systemctl start emqx
start as service
$ sudo service emqx start
Stop EMQX Broker
$ emqx stop
ok
Uninstall EMQX Broker
DEB:
$ dpkg -r emqx-ee
or
$ dpkg -P emqx-ee
RPM:
$ rpm -e emqx-ee
ZIP (Linux、MacOS)
WARING
ZIP packages are released for quick testing and hot-beam upgrade. Do NOT install zip packages for production unless you know how to manually resolve all the runtime dependencies.
Download the zip package from emqx.com (opens new window) or Github (opens new window).
Unzip the installation file:
$ unzip emqx-ee-ubuntu18.04-v4.0.0.zip
Start EMQX Broker
$ ./bin/emqx start
emqx 4.0.0 is started successfully!
$ ./bin/emqx_ctl status
Node 'emqx@127.0.0.1' is started
emqx v4.0.0 is running
Stop EMQX Broker
$ ./bin/emqx stop
ok
Remove EMQX Broker
Simply delete the EMQX Broker directory
Install EMQX in Docker (Contain a simple docker-compose cluster)
WARING
Because emqx stores data in the ‘data/mnesia/‘ directory, when using the container to start emqx, the hostname or FQDN must be used to form the node name of emqx. Otherwise, the data storage directory will be switched, resulting in data loss.
Run a single container
Get docker image
From Docker Hub (opens new window)
$ docker pull emqx/emqx-ee:v4.0.0
Start docker container
$ docker run -d --name emqx -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8883:8883 -p 8084:8084 -p 18083:18083 emqx/emqx-ee:v4.0.0
create a simple static cluster by docker-compose
Create
docker-compose.yaml
fileversion: '3'
services:
emqx1:
image: emqx/emqx-ee:v4.0.0
environment:
- "EMQX_NAME=emqx"
- "EMQX_HOST=node1.emqx.io"
- "EMQX_CLUSTER__DISCOVERY=static"
- "EMQX_CLUSTER__STATIC__SEEDS=emqx@node1.emqx.io, emqx@node2.emqx.io"
volumes:
- ./tmp/emqx.lic:/opt/emqx/etc/emqx.lic
healthcheck:
test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
interval: 5s
timeout: 25s
retries: 5
networks:
emqx-bridge:
aliases:
- node1.emqx.io
emqx2:
image: emqx/emqx-ee:v4.0.0
environment:
- "EMQX_NAME=emqx"
- "EMQX_HOST=node2.emqx.io"
- "EMQX_CLUSTER__DISCOVERY=static"
- "EMQX_CLUSTER__STATIC__SEEDS=emqx@node1.emqx.io, emqx@node2.emqx.io"
volumes:
- ./tmp/emqx.lic:/opt/emqx/etc/emqx.lic
healthcheck:
test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
interval: 5s
timeout: 25s
retries: 5
networks:
emqx-bridge:
aliases:
- node2.emqx.io
networks:
emqx-bridge:
driver: bridge
Start docker-compose cluster
$ docker-compose -p my_emqx up -d
View cluster
$ docker exec -it my_emqx_emqx1_1 sh -c "emqx_ctl cluster status"
Cluster status: #{running_nodes => ['emqx@node1.emqx.io','emqx@node2.emqx.io'],
stopped_nodes => []}
For more information about EMQX Broker Docker, please visit Docker Hub (opens new window)
Install emqx cluster via Helm (K8S、K3S)
- Add helm repository
$ helm repo add emqx https://repos.emqx.io/charts
$ helm repo update
- Query EMQX Broker
helm search repo emqx
NAME CHART VERSION APP VERSION DESCRIPTION
emqx/emqx v4.0.0 v4.0.0 A Helm chart for EMQX
emqx/emqx-ee v4.0.0 v4.0.0 A Helm chart for EMQX
emqx/kuiper 0.1.1 0.1.1 A lightweight IoT edge analytic software
- Start EMQX Broker cluster
$ helm install my-emqx emqx/emqx-ee
- View EMQX Broker cluster situation
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
my-emqx-0 1/1 Running 0 56s
my-emqx-1 1/1 Running 0 40s
my-emqx-2 1/1 Running 0 21s
$ kubectl exec -it my-emqx-0 -- emqx_ctl cluster status
Cluster status: #{running_nodes =>
['my-emqx@my-emqx-0.my-emqx-headless.default.svc.cluster.local',
'my-emqx@my-emqx-1.my-emqx-headless.default.svc.cluster.local',
'my-emqx@my-emqx-2.my-emqx-headless.default.svc.cluster.local'],
stopped_nodes => []}