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)

  1. Download EMQX RPM package from emqx.comInstallation - 图1 (opens new window) or GithubInstallation - 图2 (opens new window)

  2. Install EMQX Broker:

    • RPM:

      1. $ sudo rpm -ivh emqx-ee-cenots7-v4.0.0.x86_64.rpm
    • DEB:

      1. # for ubuntu
      2. $ sudo apt install -i ./emqx-ee-ubuntu18.04-v4.0.0_amd64.deb
      3. # for debian
      4. # first ensure libodbc is installed, then
      5. $ sudo dpkg -i emqx-ee-ubuntu18.04-v4.0.0_amd64.deb
  3. Start EMQX Broker

    • quick start

      1. $ emqx start
      2. emqx 4.0.0 is started successfully!
      3. $ emqx_ctl status
      4. Node 'emqx@127.0.0.1' is started
      5. emqx v4.0.0 is running
    • systemctl

      1. $ sudo systemctl start emqx
    • start as service

      1. $ sudo service emqx start
  4. Stop EMQX Broker

    1. $ emqx stop
    2. ok
  5. Uninstall EMQX Broker

    • DEB:

      1. $ dpkg -r emqx-ee

      or

      1. $ dpkg -P emqx-ee
    • RPM:

      1. $ 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.

  1. Download the zip package from emqx.comInstallation - 图3 (opens new window) or GithubInstallation - 图4 (opens new window).

  2. Unzip the installation file:

    1. $ unzip emqx-ee-ubuntu18.04-v4.0.0.zip
  3. Start EMQX Broker

    1. $ ./bin/emqx start
    2. emqx 4.0.0 is started successfully!
    3. $ ./bin/emqx_ctl status
    4. Node 'emqx@127.0.0.1' is started
    5. emqx v4.0.0 is running
  4. Stop EMQX Broker

    1. $ ./bin/emqx stop
    2. ok
  5. 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

  1. Get docker image

  2. Start docker container

    1. $ 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

  1. Create docker-compose.yaml file

    1. version: '3'
    2. services:
    3. emqx1:
    4. image: emqx/emqx-ee:v4.0.0
    5. environment:
    6. - "EMQX_NAME=emqx"
    7. - "EMQX_HOST=node1.emqx.io"
    8. - "EMQX_CLUSTER__DISCOVERY=static"
    9. - "EMQX_CLUSTER__STATIC__SEEDS=emqx@node1.emqx.io, emqx@node2.emqx.io"
    10. volumes:
    11. - ./tmp/emqx.lic:/opt/emqx/etc/emqx.lic
    12. healthcheck:
    13. test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
    14. interval: 5s
    15. timeout: 25s
    16. retries: 5
    17. networks:
    18. emqx-bridge:
    19. aliases:
    20. - node1.emqx.io
    21. emqx2:
    22. image: emqx/emqx-ee:v4.0.0
    23. environment:
    24. - "EMQX_NAME=emqx"
    25. - "EMQX_HOST=node2.emqx.io"
    26. - "EMQX_CLUSTER__DISCOVERY=static"
    27. - "EMQX_CLUSTER__STATIC__SEEDS=emqx@node1.emqx.io, emqx@node2.emqx.io"
    28. volumes:
    29. - ./tmp/emqx.lic:/opt/emqx/etc/emqx.lic
    30. healthcheck:
    31. test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
    32. interval: 5s
    33. timeout: 25s
    34. retries: 5
    35. networks:
    36. emqx-bridge:
    37. aliases:
    38. - node2.emqx.io
    39. networks:
    40. emqx-bridge:
    41. driver: bridge
  2. Start docker-compose cluster

    1. $ docker-compose -p my_emqx up -d
  3. View cluster

    1. $ docker exec -it my_emqx_emqx1_1 sh -c "emqx_ctl cluster status"
    2. Cluster status: #{running_nodes => ['emqx@node1.emqx.io','emqx@node2.emqx.io'],
    3. stopped_nodes => []}

For more information about EMQX Broker Docker, please visit Docker HubInstallation - 图6 (opens new window)

Install emqx cluster via Helm (K8S、K3S)

  1. Add helm repository
  1. $ helm repo add emqx https://repos.emqx.io/charts
  2. $ helm repo update
  1. Query EMQX Broker
  1. helm search repo emqx
  2. NAME CHART VERSION APP VERSION DESCRIPTION
  3. emqx/emqx v4.0.0 v4.0.0 A Helm chart for EMQX
  4. emqx/emqx-ee v4.0.0 v4.0.0 A Helm chart for EMQX
  5. emqx/kuiper 0.1.1 0.1.1 A lightweight IoT edge analytic software
  1. Start EMQX Broker cluster
  1. $ helm install my-emqx emqx/emqx-ee
  1. View EMQX Broker cluster situation
  1. $ kubectl get pods
  2. NAME READY STATUS RESTARTS AGE
  3. my-emqx-0 1/1 Running 0 56s
  4. my-emqx-1 1/1 Running 0 40s
  5. my-emqx-2 1/1 Running 0 21s
  6. $ kubectl exec -it my-emqx-0 -- emqx_ctl cluster status
  7. Cluster status: #{running_nodes =>
  8. ['my-emqx@my-emqx-0.my-emqx-headless.default.svc.cluster.local',
  9. 'my-emqx@my-emqx-1.my-emqx-headless.default.svc.cluster.local',
  10. 'my-emqx@my-emqx-2.my-emqx-headless.default.svc.cluster.local'],
  11. stopped_nodes => []}