Introducing Hyperlight: Virtual machine-based security for functions at scale
The Microsoft Azure Core Upstream team is excited to announce the Hyperlight…
In our effort to bring the benefits of pre-packaged software to enterprise workloads in the cloud, Bitnami has recently started shipping a new generation of apps and infrastructure stacks in the Azure Marketplace that are designed for production use. One such stack is our brand-new Node.js High Availability (HA) Cluster, which you can deploy on Azure with absolutely zero software charges ever (besides what Azure charges for compute).
When you launch the Node.js High Availability Cluster ARM template through the Marketplace, you get a cluster of Node.js servers with a shared file-system and load balancer instead of everything running in the same machine. This hooks into a database of your choice – in the walkthrough that follows we will use the MongoDB flavor of the globally distributed, highly-available database service Azure Cosmos DB. As you’ll see, what was once a painful and error-prone process has been reduced to deploying it all in a few clicks.
Before we get started, let’s take a look at the topology of our system.
For this walkthrough, we’ll use a simple To-do list application based on the MEAN (MongoDB, Express, Angular, Node.js) stack. The sample application is available on GitHub.
This guide makes the following assumptions:
The example Node.js application used in this guide needs a MongoDB database. Since MongoDB is not included with Bitnami’s Node.js High-Availability Cluster, you must deploy this separately. The best way to do this is with the Azure Cosmos DB service, which provides a scalable, high-availability database in the cloud.
As a first step, go ahead and launch a new Azure Cosmos DB instance, as follows:
In the same tab, create a new resource group by entering a name for it, and choose the location for the server to be deployed. Click “Create” once done.
Your new Azure Cosmos DB instance will be deployed and will appear in the list of instances once online.
Once the instance is online, select the newly-created instance and then select the “Settings -> Connection String” menu item. In the “Read-write Keys” tab, note the database host name, port, username and primary password, as you will need these when deploying your Node.js application to the cluster.
The next step is to launch the Bitnami Node.js High-Availability Cluster solution with a Node.js application. The Azure Marketplace lets you do this in just a couple of clicks. Follow these steps:
NOTE: Ensure that your application complies with these requirements before proceeding. You can use a private repository by including the username and password in the repository URL, in the format https://USERNAME:PASSWORD@URL.
NOTE: To generate a new SSH key pair, you can use PuTTYgen (Windows) or the ssh-keygen command (Linux, macOS, and Bash on Windows 10). Find instructions on using PuTTYgen and instructions on using ssh-keygen.
Azure will now begin spinning up the new cluster. A notification will appear indicating the current status.
The process can take up to 40 minutes as the various nodes in the cluster are created and the load balancer is initialized. Once all the necessary elements of the solution been provisioned, you will see a notification and the new instances and related resources will appear in the “Resource groups” section of the Azure Portal.
You will see that the resource group includes multiple virtual machines (the nodes of the cluster) as well as a load balancer. Selecting the load balancer will display its properties, including its public IP address.
Enter the load balancer’s IP address directly into your browser’s address bar. You should now see your application. The image below shows the sample application’s welcome page:
Verify that the application is able to read and write data using the MongoDB database configured earlier. With the example application, enter a new to-do item and it should appear in the list, as shown below:
NOTE: Find out more about the database configuration variables used by the sample MEAN application.
Congrats, your Node.js application is now deployed, configured for use with Cosmos DB, and available for use in high-availability scenarios!
For more information, including details about how to configure SSL and connect to the individual nodes of the cluster using SSH, refer to the documentation for Bitnami’s Node.js High-Availability Cluster.
Let us know in the comments if you completed the walkthrough and have any feedback!
Want to see a video version? We did the walkthrough (below) live on Azure Friday.