Start EMQX

Start EMQX broker in the background

  1. $ emqx start
  2. EMQX Broker v4.0.0 is started successfully!

systemctl start

  1. $ sudo systemctl start emqx
  2. EMQX Broker v4.0.0 is started successfully!

service start

  1. $ sudo service emqx start
  2. EMQX Broker v4.0.0 is started successfully!

TIP

If you are using EMQX Enterprise, you need to import a license to use it. For the import steps, see Start EMQX Enterprise below.

EMQX Broker installed via ZIP archive does not support systemctl and service startup.

Check the status of EMQX Broker

EMQX Broker starts normally:

  1. $ emqx_ctl status
  2. Node 'emqx@127.0.0.1' is started
  3. emqx 4.0.0 is running

EMQX Broker failed to start normally:

  1. $ emqx_ctl status
  2. Node 'emqx@127.0.0.1' not responding to pings

You can check the log file from logs and confirm whether it belongs to Common Error.

Request a trial license

EMQX Enterprise requires a license file to start normally. EMQX Broker can skip this step.

  1. Visit the EMQX Enterprise download pageStart EMQX - 图1 (opens new window), click Get FREE Trial LicenseStart EMQX - 图2 (opens new window).

    Start EMQX - 图3

  2. Apply for a trial license file, then download the license file.

    Start EMQX - 图4

  3. Replace the license file (etc/emqx.lic) in the default certificate directory. You can also choose to change the read path of the certificate file, modify license.file in the etc/emqx.conf file, and make sure that the license file is in the updated read path and EMQX Enterprise has read permission. Then, start EMQX Enterprise. EMQX Enterprise is started in the same way as EMQX Broker.

  4. If the running EMQX Enterprise cluster needs to update the license file, you can use the emqx_ctl license reload [path of the license file] command to directly update the license file without restarting any nodes. It should be noted that the certificate loaded by the emqx_ctl license reload command will be applied to the whole EMQX cluster, and it will be saved in EMQX’s data directory under the licenses subdirectory (i.e.: data/licenses/emqx.lic) in each node. Even if the broker is restarted, this new license file will be loaded and applied.