HiveMQ: MQTT in the Microsoft Cloud on Windows Azure

HiveMQ: MQTT in the Microsoft Cloud on Windows Azure

author HiveMQ Team

Written by HiveMQ Team

Category: HiveMQ Third Party

Published: September 12, 2013


Infrastructure as a Service (IaaS) providers like Microsoft Windows Azure and Amazon Webservices (AWS) are excellent choices for building reliable and scalable infrastructures for your service or platform and are a very good alternative to hosting your own hardware boxes in a computing center on your own. In this post you will learn how to get the HiveMQ MQTT broker up and running in minutes on the Microsoft Windows Azure Cloud - of course with Websockets enabled!

Installation

This will explain how to install HiveMQ on an Azure Linux VM. The steps may vary when using Windows as operating system. If you want use the native Websockets implementation of HiveMQ to enable MQTT over Websockets, please make sure you follow all steps which are marked as optional.

As a prerequisite, you need a valid Windows Azure Account. If you haven’t created one yet, start with that here.

1. Create a new Virtual Machine via the Azure Web Interface. Select the newest Ubuntu LTS as Image.

2. After the Virtual Machine was created, we have to open the standard MQTT port which happens to be 1883. Go to the Endpoint Settings of your VM in the Azure Web Interface and add a new Endpoint. Use TCP as protocol and set the public and private port to 1883.

3. optional: Create another endpoint for Websockets. Use TCP as protocol and set both ports to 8000.

4. Now connect to your server instance via SSH.

5. Execute the following command to install all required dependencies:

1
sudo apt-get install unzip openjdk-8-jdk

This could take a few minutes to install.

6. Download the latest HiveMQ version with the following command:
(Replace YOUR-HIVEMQ-DOWNLOAD-LINK with your personal download link which you get from the HiveMQ Download page)

1
wget --content-disposition <YOUR-HIVEMQ-DOWNLOAD-LINK>

7. Unzip HiveMQ:

1
unzip hivemq-*.zip

8. Start HiveMQ:

1
2
cd hivemq-*
./bin/run.sh

And now we have a HiveMQ MQTT server up and running in the Microsoft Windows Azure Cloud with Websockets support. You can try any MQTT tool you like to test the broker. Or you could just use the Websockets MQTT client. Just make sure you use the correct port, which is 1883 for MQTT and 8000 for Websockets.

Conclusion

We have seen it’s very easy to get a HiveMQ instance up and running in the Azure Cloud. Since HiveMQ is extremely portable, it runs on Linux and Windows Azure Virtual Machines. Of course you can gain a new dimension of scalability if using Azures load balancing with HiveMQs built-in cluster functionality.

Do you use or plan to use an IaaS provider? Have you tried Azure for your services, yet? Let us know in the comments!

author HiveMQ Team

About HiveMQ Team

We love writing about MQTT, IoT protocols and architecture in general. Our experts are here to help, so reach out to us if we can help!

mail icon Contact HiveMQ
newer posts MQTT Web Applications: How to build your own!
No limits for MQTT clients identifiers older posts