Connect Azure HDInsight to your on-premises network (2023)

  • Article

Learn how to connect HDInsight to your on-premises network by using Azure Virtual Networks and a VPN gateway. This document provides planning information on:

  • Using HDInsight in an Azure Virtual Network that connects to your on-premises network.
  • Configuring DNS name resolution between the virtual network and your on-premises network.
  • Configuring network security groups to restrict internet access to HDInsight.
  • Ports provided by HDInsight on the virtual network.

Overview

To allow HDInsight and resources in the joined network to communicate by name, you must perform the following actions:

  1. Create Azure Virtual Network.
  2. Create a custom DNS server in the Azure Virtual Network.
  3. Configure the virtual network to use the custom DNS server instead of the default Azure Recursive Resolver.
  4. Configure forwarding between the custom DNS server and your on-premises DNS server.

These configurations enable the following behavior:

  • Requests for fully qualified domain names that have the DNS suffix for the virtual network are forwarded to the custom DNS server. The custom DNS server then forwards these requests to the Azure Recursive Resolver, which returns the IP address.
  • All other requests are forwarded to the on-premises DNS server. Even requests for public internet resources such as microsoft.com are forwarded to the on-premises DNS server for name resolution.

In the following diagram, green lines are requests for resources that end in the DNS suffix of the virtual network. Blue lines are requests for resources in the on-premises network or on the public internet.

Connect Azure HDInsight to your on-premises network (1)

Prerequisites

  • An SSH client. For more information, see Connect to HDInsight (Apache Hadoop) using SSH.
  • If using PowerShell, you'll need the AZ Module.
  • If wanting to use Azure CLI and you haven't yet installed it, see Install the Azure CLI.

Create virtual network configuration

Use the following documents to learn how to create an Azure Virtual Network that is connected to your on-premises network:

  • Using Azure portal
  • Using Azure PowerShell
  • Using Azure CLI

Create custom DNS server

Important

You must create and configure the DNS server before installing HDInsight into the virtual network.

These steps use the Azure portal to create an Azure Virtual Machine. For other ways to create a virtual machine, see Create VM - Azure CLI and Create VM - Azure PowerShell. To create a Linux VM that uses the Bind DNS software, use the following steps:

  1. Sign in to the Azure portal.

  2. From the top menu, select + Create a resource.

    Connect Azure HDInsight to your on-premises network (2)

  3. Select Compute > Virtual machine to go to the Create a virtual machine page.

  4. From the Basics tab, enter the following information:

    FieldValue
    SubscriptionSelect your appropriate subscription.
    Resource groupSelect the resource group that contains the virtual network created earlier.
    Virtual machine nameEnter a friendly name that identifies this virtual machine. This example uses DNSProxy.
    RegionSelect the same region as the virtual network created earlier. Not all VM sizes are available in all regions.
    Availability optionsSelect your desired level of availability. Azure offers a range of options for managing availability and resiliency for your applications. Architect your solution to use replicated VMs in Availability Zones or Availability Sets to protect your apps and data from datacenter outages and maintenance events. This example uses No infrastructure redundancy required.
    ImageLeave at Ubuntu Server 18.04 LTS.
    Authentication typePassword or SSH public key: The authentication method for the SSH account. We recommend using public keys, as they're more secure. This example uses Password. For more information, see the Create and use SSH keys for Linux VMs document.
    User nameEnter the administrator username for the VM. This example uses sshuser.
    Password or SSH public keyThe available field is determined by your choice for Authentication type. Enter the appropriate value.
    Public inbound portsSelect Allow selected ports. Then select SSH (22) from the Select inbound ports drop-down list.

    Connect Azure HDInsight to your on-premises network (3)

    (Video) Connect your on premises network to Azure with VPN Gateway

    Leave other entries at the default values and then select the Networking tab.

  5. From the Networking tab, enter the following information:

    FieldValue
    Virtual networkSelect the virtual network that you created earlier.
    SubnetSelect the default subnet for the virtual network that you created earlier. Do not select the subnet used by the VPN gateway.
    Public IPUse the autopopulated value.

    Connect Azure HDInsight to your on-premises network (4)

    Leave other entries at the default values and then select the Review + create.

  6. From the Review + create tab, select Create to create the virtual machine.

Review IP Addresses

Once the virtual machine has been created, you'll receive a Deployment succeeded notification with a Go to resource button. Select Go to resource to go to your new virtual machine. From the default view for your new virtual machine, follow these steps to identify the associated IP Addresses:

  1. From Settings, select Properties.

  2. Note the values for PUBLIC IP ADDRESS/DNS NAME LABEL and PRIVATE IP ADDRESS for later use.

    Connect Azure HDInsight to your on-premises network (5)

Install and configure Bind (DNS software)

  1. Use SSH to connect to the public IP address of the virtual machine. Replace sshuser with the SSH user account you specified when creating the VM. The following example connects to a virtual machine at 40.68.254.142:

    ssh sshuser@40.68.254.142
  2. To install Bind, use the following commands from the SSH session:

    sudo apt-get update -ysudo apt-get install bind9 -y
  3. To configure Bind to forward name resolution requests to your on premises DNS server, use the following text as the contents of the /etc/bind/named.conf.options file:

    acl goodclients { 10.0.0.0/16; # Replace with the IP address range of the virtual network 10.1.0.0/16; # Replace with the IP address range of the on-premises network localhost; localnets;};options { directory "/var/cache/bind"; recursion yes; allow-query { goodclients; }; forwarders { 192.168.0.1; # Replace with the IP address of the on-premises DNS server }; dnssec-validation auto; auth-nxdomain no; # conform to RFC1035 listen-on { any; };};

    Important

    Replace the values in the goodclients section with the IP address range of the virtual network and on-premises network. This section defines the addresses that this DNS server accepts requests from.

    Replace the 192.168.0.1 entry in the forwarders section with the IP address of your on-premises DNS server. This entry routes DNS requests to your on-premises DNS server for resolution.

    To edit this file, use the following command:

    sudo nano /etc/bind/named.conf.options

    To save the file, use Ctrl+X, Y, and then Enter.

    (Video) Extend on-premise deployments to Azure HDInsight in real-time

  4. From the SSH session, use the following command:

    hostname -f

    This command returns a value similar to the following text:

    dnsproxy.icb0d0thtw0ebifqt0g1jycdxd.ex.internal.cloudapp.net

    The icb0d0thtw0ebifqt0g1jycdxd.ex.internal.cloudapp.net text is the DNS suffix for this virtual network. Save this value, as it's used later.

  5. To configure Bind to resolve DNS names for resources within the virtual network, use the following text as the contents of the /etc/bind/named.conf.local file:

    // Replace the following with the DNS suffix for your virtual networkzone "icb0d0thtw0ebifqt0g1jycdxd.ex.internal.cloudapp.net" { type forward; forwarders {168.63.129.16;}; # The Azure recursive resolver};

    Important

    You must replace the icb0d0thtw0ebifqt0g1jycdxd.ex.internal.cloudapp.net with the DNS suffix you retrieved earlier.

    To edit this file, use the following command:

    sudo nano /etc/bind/named.conf.local

    To save the file, use Ctrl+X, Y, and then Enter.

  6. To start Bind, use the following command:

    sudo service bind9 restart
  7. To verify that bind can resolve the names of resources in your on-premises network, use the following commands:

    sudo apt install dnsutilsnslookup dns.mynetwork.net 10.0.0.4

    Important

    Replace dns.mynetwork.net with the fully qualified domain name (FQDN) of a resource in your on-premises network.

    Replace 10.0.0.4 with the internal IP address of your custom DNS server in the virtual network.

    The response appears similar to the following text:

    Server: 10.0.0.4Address: 10.0.0.4#53Non-authoritative answer:Name: dns.mynetwork.netAddress: 192.168.0.4

Configure virtual network to use the custom DNS server

To configure the virtual network to use the custom DNS server instead of the Azure recursive resolver, use the following steps from the Azure portal:

  1. From the left menu, navigate to All services > Networking > Virtual networks.

    (Video) HDInsight cluster installation on Microsoft Azure

  2. Select your virtual network from the list, which will open the default view for your virtual network.

  3. From the default view, under Settings, select DNS servers.

  4. Select Custom, and enter the PRIVATE IP ADDRESS of the custom DNS server.

  5. Select Save.

    Connect Azure HDInsight to your on-premises network (6)

Configure on-premises DNS server

In the previous section, you configured the custom DNS server to forward requests to the on-premises DNS server. Next, you must configure the on-premises DNS server to forward requests to the custom DNS server.

For specific steps on how to configure your DNS server, consult the documentation for your DNS server software. Look for the steps on how to configure a conditional forwarder.

A conditional forward only forwards requests for a specific DNS suffix. In this case, you must configure a forwarder for the DNS suffix of the virtual network. Requests for this suffix should be forwarded to the IP address of the custom DNS server.

The following text is an example of a conditional forwarder configuration for the Bind DNS software:

zone "icb0d0thtw0ebifqt0g1jycdxd.ex.internal.cloudapp.net" { type forward; forwarders {10.0.0.4;}; # The custom DNS server's internal IP address};

For information on using DNS on Windows Server 2016, see the Add-DnsServerConditionalForwarderZone documentation...

Once you've configured the on-premises DNS server, you can use nslookup from the on-premises network to verify that you can resolve names in the virtual network. The following example

nslookup dnsproxy.icb0d0thtw0ebifqt0g1jycdxd.ex.internal.cloudapp.net 196.168.0.4

This example uses the on-premises DNS server at 196.168.0.4 to resolve the name of the custom DNS server. Replace the IP address with the one for the on-premises DNS server. Replace the dnsproxy address with the fully qualified domain name of the custom DNS server.

Optional: Control network traffic

You can use network security groups (NSG) or user-defined routes (UDR) to control network traffic. NSGs allow you to filter inbound and outbound traffic, and allow or deny the traffic. UDRs allow you to control how traffic flows between resources in the virtual network, the internet, and the on-premises network.

Warning

HDInsight requires inbound access from specific IP addresses in the Azure cloud, and unrestricted outbound access. When using NSGs or UDRs to control traffic, you must perform the following steps:

  1. Find the IP addresses for the location that contains your virtual network. For a list of required IPs by location, see Required IP addresses.

  2. For the IP addresses identified in step 1, allow inbound traffic from that IP addresses.

    (Video) Azure HDInsight Cluster Creation in Azure Cloud,#AzureADF, #AzureADFTutorial,#AzureDataFactory

    • If you're using NSG: Allow inbound traffic on port 443 for the IP addresses.
    • If you're using UDR: Set the Next Hop type of the route to Internet for the IP addresses.

For an example of using Azure PowerShell or the Azure CLI to create NSGs, see the Extend HDInsight with Azure Virtual Networks document.

Create the HDInsight cluster

Warning

You must configure the custom DNS server before installing HDInsight in the virtual network.

Use the steps in the Create an HDInsight cluster using the Azure portal document to create an HDInsight cluster.

Warning

  • During cluster creation, you must choose the location that contains your virtual network.
  • In the Advanced settings part of configuration, you must select the virtual network and subnet that you created earlier.

Connecting to HDInsight

Most documentation on HDInsight assumes that you have access to the cluster over the internet. For example, that you can connect to the cluster at https://CLUSTERNAME.azurehdinsight.net. This address uses the public gateway, which isn't available if you have used NSGs or UDRs to restrict access from the internet.

Some documentation also references headnodehost when connecting to the cluster from an SSH session. This address is only available from nodes within a cluster, and isn't usable on clients connected over the virtual network.

To directly connect to HDInsight through the virtual network, use the following steps:

  1. To discover the internal fully qualified domain names of the HDInsight cluster nodes, use one of the following methods:

    $resourceGroupName = "The resource group that contains the virtual network used with HDInsight"$clusterNICs = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | where-object {$_.Name -like "*node*"}$nodes = @()foreach($nic in $clusterNICs) { $node = new-object System.Object $node | add-member -MemberType NoteProperty -name "Type" -value $nic.Name.Split('-')[1] $node | add-member -MemberType NoteProperty -name "InternalIP" -value $nic.IpConfigurations.PrivateIpAddress $node | add-member -MemberType NoteProperty -name "InternalFQDN" -value $nic.DnsSettings.InternalFqdn $nodes += $node}$nodes | sort-object Type
    az network nic list --resource-group <resourcegroupname> --output table --query "[?contains(name,'node')].{NICname:name,InternalIP:ipConfigurations[0].privateIpAddress,InternalFQDN:dnsSettings.internalFqdn}"
  2. To determine the port that a service is available on, see the Ports used by Apache Hadoop services on HDInsight document.

    Important

    Some services hosted on the head nodes are only active on one node at a time. If you try accessing a service on one head node and it fails, switch to the other head node.

    For example, Apache Ambari is only active on one head node at a time. If you try accessing Ambari on one head node and it returns a 404 error, then it is running on the other head node.

Next steps

  • For more information on using HDInsight in a virtual network, see Plan a virtual network deployment for Azure HDInsight clusters.

  • For more information on Azure virtual networks, see the Azure Virtual Network overview.

    (Video) Introduction to Azure HDInsight

  • For more information on network security groups, see Network security groups.

  • For more information on user-defined routes, see User-defined routes and IP forwarding.

FAQs

Connect Azure HDInsight to your on-premises network? ›

VPN connection

A VPN gateway is a type of virtual network gateway that sends encrypted traffic between an Azure virtual network and an on-premises location. The encrypted traffic goes over the public Internet.

How do I connect my on premise server to Azure? ›

Plan your Azure virtual network
  1. Prerequisites.
  2. Solution architecture design assumptions.
  3. Plan the routing infrastructure changes for the Azure virtual network.
  4. Plan for firewall rules for traffic to and from the on-premises VPN device.
  5. Plan for the private IP address space of the Azure virtual network.
Feb 16, 2023

Which of the following is used to connect on premise network with Azure using a private connection? ›

VPN connection

A VPN gateway is a type of virtual network gateway that sends encrypted traffic between an Azure virtual network and an on-premises location. The encrypted traffic goes over the public Internet.

Which two services can you use to establish network connectivity between an on-premises network and Azure resources? ›

Connectivity services: Connect Azure resources and on-premises resources using any or a combination of these networking services in Azure - Virtual Network (VNet), Virtual WAN, ExpressRoute, VPN Gateway, Virtual network NAT Gateway, Azure DNS, Peering service, Azure Virtual Network Manager, Route Server, and Azure ...

How do I create a HDInsight linked service? ›

Create an on-demand HDInsight linked service

Select the + New button again to create another linked service. In the New Linked Service window, select the Compute tab. Select Azure HDInsight, and then select Continue. Enter HDInsightLinkedService .

What are the different ways to connect from Azure to on-premise? ›

Sign in to the Azure portal with the same Azure account that you used to install the gateway. In the Azure portal search box, enter on-premises data gateway, and then select On-premises data gateways. Under On-premises data gateways, select Create.

How does Azure connect to on-premise database? ›

On the on-premises client computer, open SQL Server Management Studio. In the Connect to Server dialog box, enter the fully qualified host name for your managed instance in the Server name box. Select SQL Server Authentication, provide your username and password, and then select Connect.

Videos

1. Connectivity into Azure Cloud using VPN and Express Route
(Jafer Sabir)
2. Configure the site-to-site VPN connection between two Azure virtual networks
(HDInsight UE)
3. An Introduction to HDInsight
(Pragmatic Works)
4. Using Azure HDInsight with Azure Data Lake Store
(Azure HDInsight)
5. AZ-900 Episode 10 | Networking Services | Virtual Network, VPN Gateway, CDN, Load Balancer, App GW
(Adam Marczak - Azure for Everyone)
6. Azure Networking - Back to basics: ExpressRoute resilience
(Adam Stuart)
Top Articles
Latest Posts
Article information

Author: Chrissy Homenick

Last Updated: 22/07/2023

Views: 6146

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Chrissy Homenick

Birthday: 2001-10-22

Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

Phone: +96619177651654

Job: Mining Representative

Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.