by Ponlakshmi | Mar 21, 2023 | MQTT Broker | 0 comments
The most essential criteria that should be looked at when considering an enterprise IoT deployment is scalability. When there is huge traffic with very large amount of data, the scalability becomes a question? To overcome this, MQTT Broker cluster with robust and fault-tolerant high availability configuration is needed. But how does the devices in an IoT environment know which MQTT Broker to connect? Load balancing at the transport layer can address this challenge and ensure this with Azure load balancer will fit & scale your IoT applications. Bevywise MQTT Broker perfectly works with ALB and it is even flexible to be hosted in Azure VMs. This blog will take you to the tour of how to setup your highly scalable IoT implementation on Azure with Bevywise MQTT Broker.
Maintaining uninterrupted MQTT communication requires a high availability MQTT Broker. While the native publish and subscribe model of MQTT protocol lacks built-in high availability, achieving it is straightforward with the right MQTT Broker. That's where our Bevywise MQTT Broker comes in, introducing the Inter-broker communicator (IBC) functionality. This innovation facilitates continuous inter-broker communication, ensuring seamless device communication even if clients connect to different brokers within the architecture.
Consider the above architecture as an example. It illustrates the grouping of 2 or more MQTT Brokers (each with IBC enabled) to create a clustered setup. A load balancer is employed to evenly distribute workloads across the brokers, and a shared database serves as a central storage option for all brokers within the setup.
A load balancer’s goal is to increase productivity, shield your servers and resources from overload, and give users a quick, secure, and dependable experience. If you have two or more servers, you need to think about installing a load balancer. The key characteristics of a load balancer are listed below.
Requirements for enabling high availability using Azure load balancer :
The number of MQTT Brokers can increase based on the count of clients. With the use of IBC server, link and cluster all the MQTT Brokers you possess. If either of the MQTT Broker fails, then the load balancer will decide which broker should take over the responsibility of the failed MQTT Broker and send messages to the connected clients, preventing the failure to happen. This is feasible as all the cluster nodes and brokers will receive all the MQTT messages.
Set up Azure as a load balancer in one of the machines. Azure load balancer health probe will keep track of each virtual machine’s assigned port and only routes traffic to operational virtual machines.
To configure Azure load balancer, take the actions listed below.
Step 1 : Upon logging in into the Azure portal, search for “Load Balancer” and select it from the results. Then click “Add.” In the “Basics tab,” precisely enter the following information, then click “Review + Create.”
Once you finally click “Create,” your load balancer will appear.
Step 2 : Go to Networking > Virtual network under Create a resource. Enter the necessary project and instance information on the Basics page to build a virtual network.
A button labelled “Next: IP address” will then appear at the bottom of the page. Enter the IP address under the IP Addresses tab and choose the term ‘Default’ under the Subnet name.
To make changes, select Edit subnet and save anything you wish to change in the subnet category.
Step 3 : Choose All Resources > All Services. From the list of resources, choose your resource’s name. From the Settings menu, pick Backend pools > ‘Add’.
Enter the necessary information on the Add a backend pool page, then click Add.
Step 4 : Select All Services > All Resources > Choose your resource name from the resource list to create a health probe. Select Health Probes under Settings, then click Add. Then click OK after entering the information on the Add health probe screen.
Step 5 : By selecting All services > All resources >, you may create a load balancer rule. The resource list will appear; choose your resource’s name. Choose Load balancing rules from the Settings menu, then click Add.
Type in the required information and select Ok.
Finally click Create / Finish to create the load balancer.
Step 6 : Locate and copy the public IP address from the load balancer’s Overview screen, then paste it into your browser’s address bar to test the load balancer. Verify the answer.
If you get a valid response, your load balancer has been configured properly and can communicate with the backend virtual machines.
To integrate Azure load balancer with MQTT Broker, follow the below instructions.
Ensure the load balancer's IP is entered in all MQTT Brokers within the clustered setup.
For database configuration details, refer to our comprehensive high availability MQTT cluster blog.
Download MQTT Broker now for FREE to get started with your High Availability MQTT cluster.
Hope this blog has helped you understand how to configure the Azure load balancer to enable high availability. Try customising it yourself. The usage of Nginx load balancing by MQTT Broker to support high availability has already been thoroughly documented.
Please feel free to contact support with any questions or recommendations.
Please take a moment to fill this form>