Address already used error in mosquito

I installed mosquitto server and client packages on my ubuntu computer. When I run the mosquitto command to start the mosquitto server, I get the error "Error: address already in use." Why am I getting this error? How can i solve this?

+5
source share
2 answers

Installing on ubuntu automatically launches a broker for you. Try connecting to check:

mosquitto_sub -t '$SYS/#' -v 

You will need to install the mosquitto-clients package if you have not already done so.

+5
source

I ran into the same problem and resolved the situation by killing the process in which the mosquito was executed. First find the mosquitto process id:

 ps -ef | grep mosquitto 

This should show you any process associated with a mosquito. Say for example, the process id was 12345, then you can kill it with this:

 sudo kill 12345 

After that, the message Error: the address already in use disappeared, and Mosquito could again start it correctly.

+5
source

All Articles