Docker MQTT Newbie Question

JustJack
Posts: 54
Joined: Sat Feb 16, 2013 3:38 pm
Location: Ca

Docker MQTT Newbie Question

Post by JustJack »

So I have decided to dip my toes into the world of mqtt iot devices. I have some very basic questions that I was hoping someone could answer. I have decided that I wanted to go the Docker route because it seems like a sane way to keep from messing my machine up with brew installs. My question is with regards to persisting data across the docker container reboots. Most of the docs I have found say that I would want to save the following data :
  1. /mosquitto/config
    /mosquitto/data
    /mosquitto/log
My question is which of the two methods of creating persistent data are people using?
  1. Volumes
    Bind Mounts
According to the Docker documentation, volumes are the preferred approach, but you can't browse the data from the host's file system. I'm pretty sure that I would/should not be mucking withe the /mosquitto/data directory from outside the container while it is running but it makes it easier to backup if it's bind mounted to a Mac host directory. The other two would be nice to have access to. After a time though, I don't think that I would be modifying the config file much.

Any suggestions on what is the best route? I'm assuming that I could use both, creating a docker volume for the data, and binding the config and log files.
siclark
Posts: 2355
Joined: Tue Jun 13, 2017 5:08 am
Location: UK

Re: Docker MQTT Newbie Question

Post by siclark »

I struggled getting Docker to reliably restart after reboots. I used the MQTT plugin for a while but found it had issues.

Since installing mosquitto with Brew (had been against Brew for same reasons you state) I havent had a single problem with it. Much the easiest and quickest route.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Docker MQTT Newbie Question

Post by FlyingDiver »

Honestly, if you're just getting started with MQTT IoT, Mosquitto is overkill. Just run the MQTT Broker plugin. You don't need all the config and logging data, you'll never look at it. Just run an MQTT client app like MQTTX or MQTT Explorer, and monitor the traffic that way.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
JustJack
Posts: 54
Joined: Sat Feb 16, 2013 3:38 pm
Location: Ca

Re: Docker MQTT Newbie Question

Post by JustJack »

I’m still struggling with getting the Docker/mosquito configuration working, so I’ll give the plugin a try today.


Sent from my iPhone using Tapatalk
JustJack
Posts: 54
Joined: Sat Feb 16, 2013 3:38 pm
Location: Ca

Re: Docker MQTT Newbie Question

Post by JustJack »

Just wanted to thank you for the suggestion to just use your Broker plugin. It was so much easier to setup and get working :D :D :D :D
Post Reply

Return to “MQTT”