My Ubuntu 14.04 中的 Mosquitto 安装
Mosquitto installation in My Ubuntu 14.04
我想在我的 Ubuntu 14.04 LTS
中安装 Mosquitto
sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
sudo apt-get install mosquitto-clients
但我在测试安装时出错:
devuser@localhost:~$ mosquitto_sub -t '$SYS/#' -v
Error: Connection refused
从外部 ping 主机没问题:
ping 199.162.221.117
PING 199.162.221.117 (199.162.221.117): 56 data bytes
64 bytes from 199.162.221.117: icmp_seq=0 ttl=55 time=102.234 ms
但不是
ping 199.162.221.117:1883
ping: cannot resolve 199.162.221.117:1883: Unknown host
还有
devuser@localhost:~$ sudo start mosquitto
[sudo] password for devuser:
start: Unknown job: mosquitto
还有
devuser@localhost:~$ sudo /etc/init.d/mosquitto start
sudo: /etc/init.d/mosquitto: command not found
您只安装了 mosquitto 命令行客户端(mosquitto_sub & mosquitto_pub)而不是实际的代理
$ sudo apt-get install mosquitto
这应该会安装实际的代理,然后您就可以使用您列出的最后一条命令启动它
我想在我的 Ubuntu 14.04 LTS
中安装 Mosquittosudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
sudo apt-get install mosquitto-clients
但我在测试安装时出错:
devuser@localhost:~$ mosquitto_sub -t '$SYS/#' -v
Error: Connection refused
从外部 ping 主机没问题:
ping 199.162.221.117
PING 199.162.221.117 (199.162.221.117): 56 data bytes
64 bytes from 199.162.221.117: icmp_seq=0 ttl=55 time=102.234 ms
但不是
ping 199.162.221.117:1883
ping: cannot resolve 199.162.221.117:1883: Unknown host
还有
devuser@localhost:~$ sudo start mosquitto
[sudo] password for devuser:
start: Unknown job: mosquitto
还有
devuser@localhost:~$ sudo /etc/init.d/mosquitto start
sudo: /etc/init.d/mosquitto: command not found
您只安装了 mosquitto 命令行客户端(mosquitto_sub & mosquitto_pub)而不是实际的代理
$ sudo apt-get install mosquitto
这应该会安装实际的代理,然后您就可以使用您列出的最后一条命令启动它