EMQX 配置MQTT数据桥接,启动报错:reason => unknown_fields,unknown => "connector,direction,..."

错误报告

环境

  • EMQX 版本:5.0.14
  • 操作系统版本:ubuntu 20.0.4

重现此问题的步骤

  1. 按照MQTT Bridge | EMQX 5.0 文档 文档修改配置文件,然后上传配置文件到相应目录.
  2. 重启服务,查看日志
  3. 报错信息
    2023-01-17T01:29:37.946598+00:00 [error] failed_to_check_schema: emqx_conf_schema
    2023-01-17T01:29:38.031553+00:00 [error] #{kind => validation_error,path => “bridges.mqtt.mqtt_bridge_egress”,reason => unknown_fields,unknown => “connector,direction,…”,unmatched => “clientid_prefix,ingress,…”}
    2023-01-17T01:29:38.032195+00:00 [error] #{kind => validation_error,path => “bridges.mqtt.mqtt_bridge_ingress”,reason => unknown_fields,unknown => “connector,direction,…”,unmatched => “clientid_prefix,egress,…”}
    ERROR: call_hocon_failed: -v -t 2023.01.17.01.29.34 -s emqx_conf_schema -c /opt/emqx/etc/emqx.conf -d /opt/emqx/data/configs generate

添加配置文件内容
bridges {
mqtt {
mqtt_bridge_ingress {
connector {
bridge_mode = false
clean_start = true
keepalive = “60s”
max_inflight = 32
mode = “cluster_shareload”
password = “pwd1”
proto_ver = “v4”
reconnect_interval = “10s”
retry_interval = “1s”
server = “192.168.0.236:1883”
ssl {enable = false}
username = “user1”
}
direction = “ingress”
enable = true
local_topic = “local/topic/ingress”
local_qos = 0
remote_qos = 0
remote_topic = “remote/topic/ingress”
payload = “${payload}”
retain = false
}
mqtt_bridge_egress {
connector {
bridge_mode = false
clean_start = true
keepalive = “60s”
max_inflight = 32
mode = “cluster_shareload”
username = “emqx”
password = “emqx”
proto_ver = “v4”
reconnect_interval = “15s”
retry_interval = “15s”
server = “192.168.0.236:1883”
ssl { enable = false }
}
direction = “egress”
enable = true
local_topic = “local/topic/egress”
remote_qos = 0
remote_topic = “remote/topic/egress”
payload = “${payload}”
retain = false
}
}
}

预期行为

服务启动成功

配置桥接成功

实际行为

服务启动失败

2023-01-17T01:29:37.946598+00:00 [error] failed_to_check_schema: emqx_conf_schema
2023-01-17T01:29:38.031553+00:00 [error] #{kind => validation_error,path => “bridges.mqtt.mqtt_bridge_egress”,reason => unknown_fields,unknown => “connector,direction,…”,unmatched => “clientid_prefix,ingress,…”}
2023-01-17T01:29:38.032195+00:00 [error] #{kind => validation_error,path => “bridges.mqtt.mqtt_bridge_ingress”,reason => unknown_fields,unknown => “connector,direction,…”,unmatched => “clientid_prefix,egress,…”}
ERROR: call_hocon_failed: -v -t 2023.01.17.01.29.34 -s emqx_conf_schema -c /opt/emqx/etc/emqx.conf -d /opt/emqx/data/configs generate

你好,可以参考下这篇帖子:

报错是因为文档的示例配置没有及时更新,最新版本的配置结构已经变更了。

谢谢,已按照最新的配置方式配置成功,麻烦官方尽快更新文档。

1 个赞