我正在尝试订阅 http://test.mosquitto.org/使用以下命令:
mosquitto_sub -h test.mosquitto.org -p 1883 -t "#" -v
这样做时,它首先什么也没说,几分钟后打印出Error: Network is unreachable
。为了确保我也尝试订阅 https://iot.eclipse.org/并且还尝试使用 ip 而不是代理的 DNS 名称。
有人知道我如何订阅经纪人吗?
编辑:我可以 ping test.mosquitto.org
最佳答案
mosquitto_sub -h test.mosquitto.org -p 1883 -t "#" -v
When doing so, it first says nothing and after a few minutes it prints Error: Network is unreachable
似乎 dns 没有解析,要测试 dns 是否解析,首先简单的测试是执行 ping,
ping test.mosquitto.org
如果它可达,它应该打印出以下内容:
ping test.mosquitto.org
PING test.mosquitto.org (37.187.106.16) 56(84) bytes of data.
64 bytes from ks.ral.me (37.187.106.16): icmp_seq=1 ttl=54 time=15.4 ms
64 bytes from ks.ral.me (37.187.106.16): icmp_seq=2 ttl=54 time=15.3 ms
^C
--- test.mosquitto.org ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 15.311/15.393/15.476/0.148 ms
一旦解析了 dns,下面的操作应该没有任何错误:
mosquitto_sub -h test.mosquitto.org -p 1883 -t "#" -v
关于linux - mosquitto 订阅测试代理 : Network is unreachable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48787742/