nanomq

NanoMQ Docker Image

NanoMQ是一款轻量级、高性能的MQTT broker,适用于IoT边缘平台,支持MQTT 5.0/3.1.1、桥接、消息持久化、规则引擎等功能,提供多版本Docker镜像满足不同需求。

16 次收藏下载次数: 0状态:社区镜像维护者:emqx仓库类型:镜像最近更新:
下载命令
点击查看

NanoMQ

Quick Reference

Official Website:

[***]

Where to get help and fire issues:

https://github.com/emqx/nanomq/issues or https://slack-invite.emqx.io/ or [***]

Supported architectures

POSIX compatible Architecture

What is NanoMQ

Nano MQTT Broker (NanoMQ) is a lightweight and blazing-fast MQTT Broker for the IoT Edge platform. NanoMQ unifies data in motions and data in use between Edge and Cloud in an efficient manner.

Ihe cost effectiveness, performant, high compatibility and interoperability makes NanoMQ your best option of edge messaging broker and databus.

Features

  • Fully MQTT 5.0 Compliant

    Fully support MQTT 5.0/3.1.1, Compatible with all standard open-source MQTT SDKs.

  • MQTT Bridges

    Bridging message from edge to multiple clouds. In-line connections to Global cloud services.

  • Message Persistence

    Preserve your business-critical data with built-in data persistence, and resume uploading automatically when the connection is restored.

  • Rule Engine

    Unlock the flexibility of data with a SQL-based rule engine. Integrates with eKuiper to bring stream processing to the edge.

  • Integrability

    Reduce the cost of integrating edge computing applications with event-driven WebHooks. Easy to maintain with EdgeOps friendly HTTP APIs.

  • All-round

    Support multiple protocols such as ZeroMQ/nanomsg/NNG/WebSocket. Enabling flexible and diverse routing topology on edge with. Secure your IoT connections with TLS/SSL.

How to use this image

bash
docker pull emqx/nanomq:latest

Run specific version of NanoMQ:

bash
docker run -d -p 1883:1883 -p 8883:8883 --name nanomq emqx/nanomq:latest

There are 3 kinds of NanoMQ docker image:

Default: Take alpine as base image, minimum size but only has basic MQTT broker function.

bash
docker pull emqx/nanomq:0.14.1

Slim: Take Ubuntu as base image, moderate size with necessary features like TLS/SSL, SQLite and Rule Engine.

bash
docker pull emqx/nanomq:0.14.1-slim

Full: A comprehensive docker image with all features on board, such as QUIC bridging, ZeroMQ gateway and Bench toolkit.

bash
docker pull emqx/nanomq:0.14.1-full

NanoMQ configuration file

Docker version: Specify config file path from host:

bash
docker run -d -p 1883:1883 -v {YOU LOCAL PATH}: /etc \
          --name nanomq  emqx/nanomq:0.14.1

Recommend to use Environment variables to config NanoMQ

NanoMQ Environment Variables

VariableTypeValue
NANOMQ_BROKER_URLString'nmq-tcp://host:port', 'tls+nmq-tcp://host:port'
NANOMQ_DAEMONBooleanSet nanomq as daemon (default: false).
NANOMQ_NUM_TASKQ_THREADIntegerNumber of taskq threads used, num greater than 0 and less than 256.
NANOMQ_MAX_TASKQ_THREADIntegerMaximum number of taskq threads used, num greater than 0 and less than 256.
NANOMQ_PARALLELLongNumber of parallel.
NANOMQ_PROPERTY_SIZEIntegerMax size for a MQTT user property.
NANOMQ_MSQ_LENIntegerQueue length for resending messages.
NANOMQ_QOS_DURATIONIntegerThe interval of the qos timer.
NANOMQ_ALLOW_ANONYMOUSBooleanAllow anonymous login (default: true).
NANOMQ_WEBSOCKET_ENABLEBooleanEnable websocket listener (default: true).
NANOMQ_WEBSOCKET_URLString'nmq-ws://host:port/path', 'nmq-wss://host:port/path'
NANOMQ_HTTP_SERVER_ENABLEBooleanEnable http server (default: false).
NANOMQ_HTTP_SERVER_PORTIntegerPort for http server (default: 8081).
NANOMQ_HTTP_SERVER_USERNAMEStringHttp server user name for auth.
NANOMQ_HTTP_SERVER_PASSWORDStringHttp server password for auth.
NANOMQ_TLS_ENABLEBooleanEnable TLS connection.
NANOMQ_TLS_URLString'tls+nmq-tcp://host:port'.
NANOMQ_TLS_CA_CERT_PATHStringPath to the file containing PEM-encoded CA certificates.
NANOMQ_TLS_CERT_PATHStringPath to a file containing the user certificate.
NANOMQ_TLS_KEY_PATHStringPath to the file containing the user's private PEM-encoded key.
NANOMQ_TLS_KEY_PASSWORDStringString containing the user's password. Only used if the private keyfile is password-protected.
NANOMQ_TLS_VERIFY_PEERBooleanVerify peer certificate (default: false).
NANOMQ_TLS_FAIL_IF_NO_PEER_CERTBooleanServer will fail if the client does not have a certificate to send (default: false).
NANOMQ_CONF_PATHStringNanoMQ main config file path (defalt: /etc/nanomq.conf).
  • Specify a broker url. On host system:

    bash
    export NANOMQ_BROKER_URL="nmq-tcp://0.0.0.0:1883"
    export NANOMQ_TLS_ENABLE=true
    export NANOMQ_TLS_URL="tls+nmq-tcp://0.0.0.0:8883"
    

    Creating docker container:

    bash
    docker run -d -p 1883:1883 -p 8883:8883 \
               -e NANOMQ_BROKER_URL="nmq-tcp://0.0.0.0:1883" \
               -e NANOMQ_TLS_ENABLE=true \
               -e NANOMQ_TLS_URL="tls+nmq-tcp://0.0.0.0:8883" \
               --name nanomq emqx/nanomq:0.14.1-full
    
  • Specify a nanomq config file path. On host system:

    bash
    export NANOMQ_CONF_PATH="/usr/local/etc/nanomq.conf"
    

    Creating docker container:

    bash
    docker run -d -p 1883:1883 -e NANOMQ_CONF_PATH="/usr/local/etc/nanomq.conf" \
                [-v {LOCAL PATH}:{CONTAINER PATH}] \
                --name nanomq emqx/nanomq:0.14.0-slim
    

Performance Tunning

In order to achieve the best performance on your platform, recommend to change following settings:

NameTypeDescription
system.num_taskq_threadIntegerNumber of taskq threads used. (equal to your CPU cores)
system.max_taskq_threadIntegerMaximum number of taskq threads used. (equal to your CPU cores)
system.parallelLongNumber of parallel. (equal to your CPU cores * 2)
mqtt.session.msq_lenIntegerInflight window/Queue length for resending messages. (Recommend to set as max number: 65535, depending on your memory limitation)

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 nanomq 镜像标签

docker pull docker.xuanyuan.run/emqx/nanomq:<标签>

DockerHub 原生拉取命令

docker pull emqx/nanomq:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告