Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

address already in use error in mosquitto

Tags:

mqtt

mosquitto

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?

like image 450
andro-girl Avatar asked May 13 '15 06:05

andro-girl


2 Answers

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.

like image 129
tyler.frankenstein Avatar answered Sep 28 '22 06:09

tyler.frankenstein


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.

like image 35
ralight Avatar answered Sep 28 '22 08:09

ralight