My current setup is running HA in a docker on an Intel NUC i7. My MQTT server is ran on the same machine in a separate docker container. Lately I have noticed a few users that have their MQTT server running on a separate device, raspberrypi in particular.
I was curious if anyone can help me understand why someone might do this if the server HA runs on has plenty of resources? The best guess I have is if you have your network separated into different VLANs, you would give your IoT/NoT access to a raspberrypi that only runs MQTT vs giving them access to your main server that runs HA and other tasks.
I don’t know why you’d do it unless you were really hard on the “server” with mqtt - ie causing cpu usage. MQTT is pretty lightweight, and personally I want it, and do have it on the same system as my other home automation packages. Only as it’s primarily used by the HA software, so but having them together it does remove the potential for a network outage to stop your HA from working…as least a fair portion will still go.
As a matter of fact I have two brokers on the same NUC as my HA - one I installed initially directly on the OS before I moved to Docker and then one in a Docker container that I used for testing and set it up in bridge mode so what ever was seen on one broker it was also reflected in the other.
I’ve seen no issues at all running like that for two years.
Some people have it on a separate machine to not have a single point of failure, meaning the system will continue to work partially when the HA server goes down.
I think some people will also run it separate so they can place the RPi in a different location in their house with a ZWave or Zigbee dongle to get better reception to their devices. If you HA server is down in your basement shielded by all your HVAC gear, you might not get the best reception for those wireless protocols.
And why should you then separate the MQTT broker? You can place the RPi in an ideal position and still have the MQTT broker on the same RPi. I don’t see this as a reason to separate the MQTT broker and the Home Assistant server.
hmm thats the old story - if you use a redundant hardware (200%) is the failing posibility now 50% or 200% ? If you didnt add a failover its 200%. And since two Systems are 100% more than a single system its also 200% ;-p
Just ask yourself:
I do run my mqtt on the same Hardware like my HA.
But as a normal service HA runs in a docker environment.
Do i need mqtt when HA is broken?
Do i often reboot my Hardware where HA and other stuff is running?
Do i often restart HA because of a change in something HA related things?
Do i use retain or not and my switches do stupid things when mqtt is unaviable?
Do i need a single backup with HA & MQTT or do i already have a backup for my running system and HA?