错误报告
使用docker部署emqx后 。腾讯云 作为负载服务,单台emqx。
在腾讯云负载 安装证书、以及 docker 部署的emqx 的 etc/emqx.conf 中配置了 证书。
可是 小程序专用的 域名+wss 连接,wss 仍然无法连接。 mqttx 也连接不上。 谁知道为啥呀。。。。。。??????
差在哪里了,求帮助…
好人一生平安。
使用mqttx 工具 连接 ,域名 wss 48084 端口 点击连接无反应。
还有一点比较迷惑,前边是腾讯云的负载服务,我配置了证书,emqx的后端容器服务,我还需要配置证书吗? 如果需要,是要和负载服务的证书一致吗?
docker启动命令:
docker run -dit
–name emqx
-p 1883:1883 -p 38083:8083 -p 38883:8883 -p 48083:18083 -p 48084:8084
-v /usr/local/emqx/etc:/opt/emqx/etc
emqx
emqx.conf 中 配置
listeners.ssl.default {
bind = “0.0.0.0:8883”
max_connections = 512000
ssl_options {
#keyfile = “etc/certs/server.key”
#certfile = “etc/certs/server.crt”
#cacertfile = “etc/certs/rootCA.crt”
keyfile = “etc/certs/mqtt.我的域名.com.key”
certfile = “etc/certs/mqtt.我的域名.com_bundle.pem”
cacertfile = “etc/certs/mqtt.我的域名.com_bundle.crt”
# 不开启对端验证
verify = verify_none
}
listeners.wss.default {
bind = “0.0.0.0:8084”
max_connections = 512000
websocket.mqtt_path = “/mqtt”
ssl_options {
#keyfile = “etc/certs/server.key”
#certfile = “etc/certs/server.crt”
#cacertfile = “etc/certs/rootCA.crt”
keyfile = "etc/certs/mqtt.我的域名.com.key"
certfile = "etc/certs/mqtt.我的域名.com_bundle.pem"
cacertfile = "etc/certs/mqtt.我的域名.com_bundle.crt"
verify = verify_none
#keyfile = "etc/certs/key.pem"
#certfile = "etc/certs/cert.pem"
#cacertfile = "etc/certs/cacert.pem"
}
}
环境
- EMQX 版本:5.0
docker logs -f emqx
日志中没反应
[root@VM-0-3-centos etc]# docker logs -f emqx
WARNING: Default (insecure) Erlang cookie is in use.
WARNING: Configure node.cookie in /opt/emqx/etc/emqx.conf or override from environment variable EMQX_NODE__COOKIE
WARNING: Use the same config value for all nodes in the cluster.
EMQX_RPC__PORT_DISCOVERY [rpc.port_discovery]: manual
EMQX_LOG__FILE_HANDLERS__DEFAULT__ENABLE [log.file_handlers.default.enable]: false
EMQX_LOG__CONSOLE_HANDLER__ENABLE [log.console_handler.enable]: true
EMQX_NODE__NAME [node.name]: emqx@172.18.0.2
Listener ssl:default on 0.0.0.0:8883 started.
Listener tcp:default on 0.0.0.0:1883 started.
Listener ws:default on 0.0.0.0:8083 started.
Listener wss:default on 0.0.0.0:8084 started.
Listener http:dashboard on :18083 started.
EMQX 5.0.15 is running now!
腾讯云 配置