问题
I have installed mosquitto server and client packages in my ubuntu machine. When I run command "mosquitto" to run the mosquitto server I am getting an error "Error:address already in use". Why am I getting this error? How can I resolve this?
回答1:
I ran into the same problem, and resolved the situation by killing the process that was running mosquitto. First, locate the mosquitto process id:
ps -ef | grep mosquitto
This should reveal to you any mosquitto related process. Say for example the process id was 12345, then you could kill it with this:
sudo kill 12345
After that the Error:address already in use message was gone and mosquitto was able to run properly again.
回答2:
The installation on ubuntu automatically starts the broker for you. Try connecting to check it out:
mosquitto_sub -t '$SYS/#' -v
You will need to install the mosquitto-clients
package if you haven't done so already.
来源:https://stackoverflow.com/questions/30207649/address-already-in-use-error-in-mosquitto