EMQX5.X版本性能配置调优参数
EMQX 主配置文件为 emqx.conf
,根据安装方式其所在位置有所不同:
安装方式 | 配置文件所在位置 |
---|---|
DEB 或 RPM 包安装 | /etc/emqx/emqx.conf |
Docker 容器 | /opt/emqx/etc/emqx.conf |
解压缩包安装 | ./etc/emqx.conf |
EMQ X 消息服务器默认占用的 TCP 端口包括:
端口 | 说明 |
---|---|
1883 | MQTT 协议端口 |
8883 | MQTT/SSL 端口 |
8083 | MQTT/WebSocket 端口 |
8080 | HTTP API 端口 |
18083 | Dashboard 管理控制台端口 |
## NOTE:
## Configs in this file might be overridden by:
## 1. Environment variables which start with 'EMQX_' prefix
## 2. File $EMQX_NODE__DATA_DIR/configs/cluster-override.conf
## 3. File $EMQX_NODE__DATA_DIR/configs/local-override.conf
##
## The *-override.conf files are overwritten at runtime when changes
## are made from EMQX dashboard UI, management HTTP API, or CLI.
## All configuration details can be found in emqx.conf.examplenode {name = "emqx@127.0.0.1"cookie = "emqxsecretcookie"data_dir = "/var/lib/emqx"
}log {file_handlers.default {level = warningfile = "/var/log/emqx/emqx.log"}
}cluster {name = emqxcldiscovery_strategy = manual
}listeners.tcp.default {bind = "0.0.0.0:1883"max_connections = 1024000
}listeners.ssl.default {bind = "0.0.0.0:8883"max_connections = 512000ssl_options {keyfile = "/etc/emqx/certs/key.pem"certfile = "/etc/emqx/certs/cert.pem"cacertfile = "/etc/emqx/certs/cacert.pem"}
}listeners.ws.default {bind = "0.0.0.0:8083"max_connections = 1024000websocket.mqtt_path = "/mqtt"
}listeners.wss.default {bind = "0.0.0.0:8084"max_connections = 512000websocket.mqtt_path = "/mqtt"ssl_options {keyfile = "/etc/emqx/certs/key.pem"certfile = "/etc/emqx/certs/cert.pem"cacertfile = "/etc/emqx/certs/cacert.pem"}
}# listeners.quic.default {
# enabled = true
# bind = "0.0.0.0:14567"
# max_connections = 1024000
# keyfile = "/etc/emqx/certs/key.pem"
# certfile = "/etc/emqx/certs/cert.pem"
#}dashboard {listeners.http {bind = 18083}default_username = "admin"default_password = "public"
}authorization {deny_action = ignoreno_match = allowcache = { enable = true }sources = [{type = fileenable = true# This file is immutable to EMQX.# Once new rules are created from dashboard UI or HTTP API,# the file 'data/authz/acl.conf' is used instead of this onepath = "/etc/emqx/acl.conf"}]
}