Load blancing MQTT broker

后端 未结 5 1950
谎友^
谎友^ 2021-02-06 07:23

Is it possible to load balance MQTT broker? Can I use ELB to load balance MQTT? Any pointers in this direction would be helpful. I hit upon http://www.slideshare.net/kellogh/mqt

5条回答
  •  无人及你
    2021-02-06 08:11

    (Adding to @JD Allens response) Load balancing MQTT or TCP in general will mostly not work as intended if you keep state on servers like MQTT(subscriptions). For example if you have two MQTT backend servers behind the LB, half of your MQTT clients will connect to one MQTT broker and the other half to the other. Since these two brokers are not interconnected by any means, client will have no info about of what is going on in the other broker (subscriptions and publishes). You have two options:

    • Just configure the load balancer that will direct all connections to a single broker and only fail over to the other in case of error. Only one broker should be up at a given time (this is not load balancing per se).

    • Use a clustered MQTT broker like HiveMQ, EMQX etc. They will interconnect the backend brokers.

提交回复
热议问题