article steel to:
At present, the author in the development of building Mosquitto server, in this period encountered a lot of practical problems, so go a lot of detours, write here to provide some help for everyone.
1. Start Mosquitto error after installation is complete
The dynamic library could not be found when executing the Mosquitto client program: libmosquitto.so.1
./mosquitto_sub:error while loading shared libraries:libmosquitto.so.1:cannot open Shared object file:no such file or Directory
Workaround:
Execute command
sudo ln-s/usr/local/lib/libmosquitto.so.1/usr/lib/libmosquitto.so.1
And
Ldconfig
Can
2. configuration file error when starting Mosquitto server
Invalid user ' Mosquitto '.
[[email protected] src]#./mosquitto 1437558553'mosquitto'
This is because there are no current users in the configuration file, there are 2 solutions:
1. Modify the configuration file: mosquitto.conf, increase the login user, for example, the currently logged on user is root.
2. Execute the command to increase the current user: AddUser Mosquitto
3. Restart Mosquitto
I found a lot of information on the internet did not mention how to restart the server, and on the official website does not have the corresponding command prompt.
So we use LIUNX to terminate the process command and forcibly exit.
kill First, then restart:
[[Email protected] ~]# PS-A | grep mosquitto21674 ? xx:921674
4, the connection is not responding
The server is open normally, but when you publish information remotely, you will be prompted as follows:
no route to hostThe firewall on the remote server connects the information, so perform the following command problem resolution[email protected] ~]$ sudo iptables-f
Mosquitto build Android Push service Chapter One: various error resolution