Skip to content

Commit 74e1f5d

Browse files
authored
Merge pull request #78788 from dagiro/freshness113
freshness113
2 parents 9f068e9 + 79f1e20 commit 74e1f5d

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

articles/hdinsight/hdinsight-extend-hadoop-virtual-network.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: hrasheed
66
ms.service: hdinsight
77
ms.custom: hdinsightactive
88
ms.topic: conceptual
9-
ms.date: 05/28/2019
9+
ms.date: 06/04/2019
1010
---
1111

1212
# Extend Azure HDInsight using an Azure Virtual Network
@@ -218,7 +218,7 @@ As a managed service, HDInsight requires unrestricted access to the HDInsight he
218218
219219
![Diagram of HDInsight entities created in Azure custom VNET](./media/hdinsight-virtual-network-architecture/vnet-diagram.png)
220220
221-
### <a id="hdinsight-ip"></a> HDInsight with network security groups
221+
### HDInsight with network security groups
222222
223223
If you plan on using **network security groups** to control network traffic, perform the following actions before installing HDInsight:
224224
@@ -323,28 +323,29 @@ The following Resource Management template creates a virtual network that restri
323323
324324
* [Deploy a secured Azure Virtual Network and an HDInsight Hadoop cluster](https://azure.microsoft.com/resources/templates/101-hdinsight-secure-vnet/)
325325
326-
> [!IMPORTANT]
327-
> Change the IP addresses used in this example to match the Azure region you are using. You can find this information in the [HDInsight with network security groups and user-defined routes](#hdinsight-ip) section.
328-
329326
### Azure PowerShell
330327
331328
Use the following PowerShell script to create a virtual network that restricts inbound traffic and allows traffic from the IP addresses for the North Europe region.
332329
333330
> [!IMPORTANT]
334-
> Change the IP addresses used in this example to match the Azure region you are using. You can find this information in the [HDInsight with network security groups and user-defined routes](#hdinsight-ip) section.
331+
> Change the IP addresses for `hdirule1` and `hdirule2` in this example to match the Azure region you are using. You can find this information in the [HDInsight with network security groups and user-defined routes](#hdinsight-ip) section.
335332
336333
```powershell
337334
$vnetName = "Replace with your virtual network name"
338335
$resourceGroupName = "Replace with the resource group the virtual network is in"
339336
$subnetName = "Replace with the name of the subnet that you plan to use for HDInsight"
337+
340338
# Get the Virtual Network object
341339
$vnet = Get-AzVirtualNetwork `
342340
-Name $vnetName `
343341
-ResourceGroupName $resourceGroupName
342+
344343
# Get the region the Virtual network is in.
345344
$location = $vnet.Location
345+
346346
# Get the subnet object
347347
$subnet = $vnet.Subnets | Where-Object Name -eq $subnetName
348+
348349
# Create a Network Security Group.
349350
# And add exemptions for the HDInsight health and management services.
350351
$nsg = New-AzNetworkSecurityGroup `
@@ -417,8 +418,10 @@ $nsg = New-AzNetworkSecurityGroup `
417418
-Access Allow `
418419
-Priority 305 `
419420
-Direction Inbound `
421+
420422
# Set the changes to the security group
421423
Set-AzNetworkSecurityGroup -NetworkSecurityGroup $nsg
424+
422425
# Apply the NSG to the subnet
423426
Set-AzVirtualNetworkSubnetConfig `
424427
-VirtualNetwork $vnet `
@@ -428,14 +431,12 @@ Set-AzVirtualNetworkSubnetConfig `
428431
$vnet | Set-AzVirtualNetwork
429432
```
430433

431-
> [!IMPORTANT]
432-
> This example demonstrates how to add rules to allow inbound traffic on the required IP addresses. It does not contain a rule to restrict inbound access from other sources.
433-
>
434-
> The following example demonstrates how to enable SSH access from the Internet:
435-
>
436-
> ```powershell
437-
> Add-AzNetworkSecurityRuleConfig -Name "SSH" -Description "SSH" -Protocol "*" -SourcePortRange "*" -DestinationPortRange "22" -SourceAddressPrefix "*" -DestinationAddressPrefix "VirtualNetwork" -Access Allow -Priority 306 -Direction Inbound
438-
> ```
434+
This example demonstrates how to add rules to allow inbound traffic on the required IP addresses. It does not contain a rule to restrict inbound access from other sources. The following code demonstrates how to enable SSH access from the Internet:
435+
436+
```powershell
437+
Get-AzNetworkSecurityGroup -Name hdisecure -ResourceGroupName RESOURCEGROUP |
438+
Add-AzNetworkSecurityRuleConfig -Name "SSH" -Description "SSH" -Protocol "*" -SourcePortRange "*" -DestinationPortRange "22" -SourceAddressPrefix "*" -DestinationAddressPrefix "VirtualNetwork" -Access Allow -Priority 306 -Direction Inbound
439+
```
439440

440441
### Azure CLI
441442

@@ -452,7 +453,7 @@ Use the following steps to create a virtual network that restricts inbound traff
452453
2. Use the following to add rules to the new network security group that allow inbound communication on port 443 from the Azure HDInsight health and management service. Replace `RESOURCEGROUP` with the name of the resource group that contains the Azure Virtual Network.
453454
454455
> [!IMPORTANT]
455-
> Change the IP addresses used in this example to match the Azure region you are using. You can find this information in the [HDInsight with network security groups and user-defined routes](#hdinsight-ip) section.
456+
> Change the IP addresses for `hdirule1` and `hdirule2` in this example to match the Azure region you are using. You can find this information in the [HDInsight with network security groups and user-defined routes](#hdinsight-ip) section.
456457
457458
```azurecli
458459
az network nsg rule create -g RESOURCEGROUP --nsg-name hdisecure -n hdirule1 --protocol "*" --source-port-range "*" --destination-port-range "443" --source-address-prefix "52.164.210.96" --destination-address-prefix "VirtualNetwork" --access "Allow" --priority 300 --direction "Inbound"
@@ -466,15 +467,13 @@ Use the following steps to create a virtual network that restricts inbound traff
466467
3. To retrieve the unique identifier for this network security group, use the following command:
467468
468469
```azurecli
469-
az network nsg show -g RESOURCEGROUP -n hdisecure --query 'id'
470+
az network nsg show -g RESOURCEGROUP -n hdisecure --query "id"
470471
```
471472
472473
This command returns a value similar to the following text:
473474
474475
"/subscriptions/SUBSCRIPTIONID/resourceGroups/RESOURCEGROUP/providers/Microsoft.Network/networkSecurityGroups/hdisecure"
475476
476-
Use double-quotes around `id` in the command if you don't get the expected results.
477-
478477
4. Use the following command to apply the network security group to a subnet. Replace the `GUID` and `RESOURCEGROUP` values with the ones returned from the previous step. Replace `VNETNAME` and `SUBNETNAME` with the virtual network name and subnet name that you want to create.
479478
480479
```azurecli
@@ -483,14 +482,14 @@ Use the following steps to create a virtual network that restricts inbound traff
483482
484483
Once this command completes, you can install HDInsight into the Virtual Network.
485484
486-
> [!IMPORTANT]
487-
> These steps only open access to the HDInsight health and management service on the Azure cloud. Any other access to the HDInsight cluster from outside the Virtual Network is blocked. To enable access from outside the virtual network, you must add additional Network Security Group rules.
488-
>
489-
> The following example demonstrates how to enable SSH access from the Internet:
490-
>
491-
> ```azurecli
492-
> az network nsg rule create -g RESOURCEGROUP --nsg-name hdisecure -n hdirule5 --protocol "*" --source-port-range "*" --destination-port-range "22" --source-address-prefix "*" --destination-address-prefix "VirtualNetwork" --access "Allow" --priority 306 --direction "Inbound"
493-
> ```
485+
486+
These steps only open access to the HDInsight health and management service on the Azure cloud. Any other access to the HDInsight cluster from outside the Virtual Network is blocked. To enable access from outside the virtual network, you must add additional Network Security Group rules.
487+
488+
The following code demonstrates how to enable SSH access from the Internet:
489+
490+
```azurecli
491+
az network nsg rule create -g RESOURCEGROUP --nsg-name hdisecure -n ssh --protocol "*" --source-port-range "*" --destination-port-range "22" --source-address-prefix "*" --destination-address-prefix "VirtualNetwork" --access "Allow" --priority 306 --direction "Inbound"
492+
```
494493

495494
## <a id="example-dns"></a> Example: DNS configuration
496495

@@ -653,7 +652,7 @@ After completing these steps, you can connect to resources in the virtual networ
653652
## Next steps
654653
655654
* For an end-to-end example of configuring HDInsight to connect to an on-premises network, see [Connect HDInsight to an on-premises network](./connect-on-premises-network.md).
656-
* For configuring Apache Hbase clusters in Azure virtual networks, see [Create Apache HBase clusters on HDInsight in Azure Virtual Network](hbase/apache-hbase-provision-vnet.md).
655+
* For configuring Apache HBase clusters in Azure virtual networks, see [Create Apache HBase clusters on HDInsight in Azure Virtual Network](hbase/apache-hbase-provision-vnet.md).
657656
* For configuring Apache HBase geo-replication, see [Set up Apache HBase cluster replication in Azure virtual networks](hbase/apache-hbase-replication.md).
658657
* For more information on Azure virtual networks, see the [Azure Virtual Network overview](../virtual-network/virtual-networks-overview.md).
659658

0 commit comments

Comments
 (0)