0

I have model like this: enter image description here

EMQ X Broker installed at IP 222.x.y.z.

And two Mosquitto client.

I want to publish message from Mosquitto_client_2 then receive Mosquitto_client_1.

I do like this:

Step 1: run command:

mosquitto_sub -h 222.x.y.z -t "TEST_TEST"

on Client_1

enter image description here

Step 2: EMQ X Broker auto create topic "TEST_TEST", like this enter image description here

Step 3: Mosquitto client 2 publish message, run command:

mosquitto_pub -h 222.x.y.z -t TEST_TEST -m "hello world"

But it have problem "Error: Connection refused" like this: enter image description here

I don't know the cause of the error and how to fix this error.

P/s: I also open all port for EMQ X. enter image description here

4

1 回答 1

1

应该先排除网络问题,使用telnet判断端口是否可以访问。

telnet localhost 1883

Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
于 2019-10-30T02:35:02.223 回答