
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Official Website:
[***]
Where to get help and fire issues:
https://github.com/emqx/nanomq/issues or [] or []
Supported architectures
POSIX compatible Architecture
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.
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.
bashdocker pull emqx/nanomq:latest
Run specific version of NanoMQ:
bashdocker 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.
bashdocker pull emqx/nanomq:0.14.1
Slim: Take Ubuntu as base image, moderate size with necessary features like TLS/SSL, SQLite and Rule Engine.
bashdocker 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.
bashdocker pull emqx/nanomq:0.14.1-full
Docker version: Specify config file path from host:
bashdocker 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
| Variable | Type | Value |
|---|---|---|
| NANOMQ_BROKER_URL | String | 'nmq-tcp://host:port', 'tls+nmq-tcp://host:port' |
| NANOMQ_DAEMON | Boolean | Set nanomq as daemon (default: false). |
| NANOMQ_NUM_TASKQ_THREAD | Integer | Number of taskq threads used, num greater than 0 and less than 256. |
| NANOMQ_MAX_TASKQ_THREAD | Integer | Maximum number of taskq threads used, num greater than 0 and less than 256. |
| NANOMQ_PARALLEL | Long | Number of parallel. |
| NANOMQ_PROPERTY_SIZE | Integer | Max size for a MQTT user property. |
| NANOMQ_MSQ_LEN | Integer | Queue length for resending messages. |
| NANOMQ_QOS_DURATION | Integer | The interval of the qos timer. |
| NANOMQ_ALLOW_ANONYMOUS | Boolean | Allow anonymous login (default: true). |
| NANOMQ_WEBSOCKET_ENABLE | Boolean | Enable websocket listener (default: true). |
| NANOMQ_WEBSOCKET_URL | String | 'nmq-ws://host:port/path', 'nmq-wss://host:port/path' |
| NANOMQ_HTTP_SERVER_ENABLE | Boolean | Enable http server (default: false). |
| NANOMQ_HTTP_SERVER_PORT | Integer | Port for http server (default: 8081). |
| NANOMQ_HTTP_SERVER_USERNAME | String | Http server user name for auth. |
| NANOMQ_HTTP_SERVER_PASSWORD | String | Http server password for auth. |
| NANOMQ_TLS_ENABLE | Boolean | Enable TLS connection. |
| NANOMQ_TLS_URL | String | 'tls+nmq-tcp://host:port'. |
| NANOMQ_TLS_CA_CERT_PATH | String | Path to the file containing PEM-encoded CA certificates. |
| NANOMQ_TLS_CERT_PATH | String | Path to a file containing the user certificate. |
| NANOMQ_TLS_KEY_PATH | String | Path to the file containing the user's private PEM-encoded key. |
| NANOMQ_TLS_KEY_PASSWORD | String | String containing the user's password. Only used if the private keyfile is password-protected. |
| NANOMQ_TLS_VERIFY_PEER | Boolean | Verify peer certificate (default: false). |
| NANOMQ_TLS_FAIL_IF_NO_PEER_CERT | Boolean | Server will fail if the client does not have a certificate to send (default: false). |
| NANOMQ_CONF_PATH | String | NanoMQ main config file path (defalt: /etc/nanomq.conf). |
Specify a broker url. On host system:
bashexport 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:
bashdocker 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:
bashexport NANOMQ_CONF_PATH="/usr/local/etc/nanomq.conf"
Creating docker container:
bashdocker 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
In order to achieve the best performance on your platform, recommend to change following settings:
| Name | Type | Description |
|---|---|---|
| system.num_taskq_thread | Integer | Number of taskq threads used. (equal to your CPU cores) |
| system.max_taskq_thread | Integer | Maximum number of taskq threads used. (equal to your CPU cores) |
| system.parallel | Long | Number of parallel. (equal to your CPU cores * 2) |
| mqtt.session.msq_len | Integer | Inflight window/Queue length for resending messages. (Recommend to set as max number: 65535, depending on your memory limitation) |
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 emqx/nanomq 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: