Multiple MQTT Brokers Question: Moquette and Mosquitto needed for network and localhost comms?

Hi All,

I’m running Openhabian as my primary OH2 server (2.4, stable right now) and am looking at multiple OH2 instances as slaves (different locations, a testing version, and a failover concept). I’m currently running Mosquitto as a broker on localhost for communication with javascript node. That’s working just fine. I want to set up a second slave OH2 server on a “real” Debian machine primarily as a testing distribution to talk to my master Openhabian server via MQTT. I’m a bit confused on the MQTT setup that’s needed. My first thought was that I could use the same Mosquitto broker as I’m using for Openhabian localhost communications, but I run into problems (probably just because it’s configured as localhost and not an IP on the network, but that’s just a guess). What I’m considering is creating separate MQTT brokers by adding Moquette as a shared comms bus for multiple OH2 installations. Is there some reason I should not set up two different brokers and try to make everything use the same Mosquitto setup I have now? Should I be looking a different brokers for every MQTT communications channel setup, or just configure a single broker? Just looking for some “best practices” advice or any thoughts on an appropriate, expandable network topology.

:+1:

2 Likes

I am with @H102 here
I have a dedicated old pi running Mosquito and that’s enough for all my needs

If you already setup mosquitto, stay with that. Mosquitto is much more stable and IMO performs a lot better than Moquette. The embedded broker should only be used for those that can‘t setup mosquitto.

1 Like

Well, it looks like a unanimous vote. I’ll work with getting Mosquitto set up for OH communications. Thanks, all.

Mosquitto is the de-facto standard mqtt broker. You’ll hardly go wrong.

look here for help from Rich yes!

Nice. I didn’t see this before. I’ll look into it - I was considering looking at JSR223 Python, anyway, to support forecasts in OWM. I guess this may just seal the deal on moving forward faster.

Brian, also that link is to a thread by Rich where he explains how to keep two (or more) instances of OpenHAB synced using mqtt. JSR223 scripting can be used to do so but the same concept would work using DSL rules as well. I think Rich gives examples of both
yeah just checked, the examples are in DSL and he has a library with ready to use JSR223