Multiple NS with single MQTT - Random available GWs

Hi community,
We’re testing a setup like the one in this diagram:


We started with the gateways in AU915, and all was good. When we connected a GW in region US915 we started noticing in the GUI that gateways appear randomly available or unavailable. From looking and the NS logs and reading in the forum I understand that maybe the issue is that since the 2 NS are consuming from the same MQTT, one is winning. These are some logs from the US915 NS, but showing the ID of one AU915 gateway:

time="2021-10-14T16:29:33.704998113Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=d4adbdfffe9e0345 stats_id=bdf2ae05-0ab9-44f7-97a5-646724ba7b04
time="2021-10-14T16:29:33.70652764Z" level=error msg="gateway: handle gateway stats error" ctx_id=bdf2ae05-0ab9-44f7-97a5-646724ba7b04 error="update gateway state error: object does not exist"

We’re using the docker solution, with mosquitto mqtt. From other posts I see the recommendation of enabling shared topics. Is that the solution for this scenario, and if so how can I enable them in mosquitto.conf?

Thanks in advance,

To share multiple regions with the same MQTT broker, you will want to (as one option) prefix your topics in a region-specific way (and update NS and GB accordingly). You currently have NSes picking up traffic for the wrong region in a race to the finish.

You could also add an MQTT broker per region, and still have a single AS on top of it all.

1 Like

Thank you @bconway for your response. Given the particularities of our environment, I will go with the option of creating an MQTT instance for the each region.

Thanks again,