1)如何确定Mosquitto桥连接名称。
下面的代码段来自EMQx文档(http://emqtt.io/docs/v2/bridge.html#mosquitto-conf)
connection emqttd
address 127.0.0.1:2883
topic sensor/# out 2
连接名称-emqttd是基于什么写的?
2)我在主机172.22.25.53和端口2883上从EMQX打开了tcp连接。 当我尝试从同一系统连接时。它绝对正常。但是从另一个系统,我得到这个错误
C:\Program Files\mosquitto>mosquitto.exe -c mosquitto.conf -v
1542182003: mosquitto version 1.5.3 starting
1542182003: Config loaded from mosquitto.conf.
1542182003: Opening ipv6 listen socket on port 1883.
1542182003: Opening ipv4 listen socket on port 1883.
1542182003: Bridge local.AOI146.emq@172.22.25.53 doing local SUBSCRIBE on topic BA/#
1542182003: Connecting bridge emq@172.22.25.53 (172.22.25.53:2883)
1542182003: Bridge AOI146.emq@172.22.25.53 sending CONNECT
1542182003: Error creating bridge: Unknown error.
1542182003: Warning: Unable to connect to bridge emq@172.22.25.53.
我的mosquitto.conf文件是:
connection emqx
address 172.22.25.53:2883
cleansession false
topic AB/# both 2
答案 0 :(得分:0)
连接名称是配置文件中connection
之后的值。如mosquitto.conf man page
例如
connection foo
将导致连接名称为foo
。
172.22.25.53
在保留范围172.16.0.0 – 172.31.255.255中,我想您正在docker容器中运行emq,并且您正尝试使用其Docker内部IP地址访问该容器。您需要在主机上公开该端口,以便能够从远程计算机访问该端口。