Virtuális hálózati szolgáltatásvégpont-szabályzatok konfigurálása az Azure HDInsighthoz
Ez a cikk azt ismerteti, hogyan implementálhat szolgáltatásvégpont-szabályzatokat virtuális hálózatokon az Azure HDInsight használatával.
Háttér
Az Azure HDInsight lehetővé teszi fürtök létrehozását a saját virtuális hálózatában. Ha engedélyeznie kell a kimenő forgalmat a virtuális hálózatról más Azure-szolgáltatásokba, például tárfiókokba, létrehozhat szolgáltatásvégpont-szabályzatokat. A Azure Portal keresztül létrehozott szolgáltatásvégpont-szabályzatok azonban csak egyetlen fiókhoz, előfizetés összes fiókjához vagy egy erőforráscsoport összes fiókjához biztosítanak házirendet.
Felügyelt szolgáltatásként azonban az Azure HDInsight adatokat és naplófájlokat gyűjt az egyes régiókban található egyes fürtökről adott tárfiókokban. Ahhoz, hogy ezek az adatok elérjék a HDInsightot a virtuális hálózatról, olyan szolgáltatásvégpont-szabályzatokat kell létrehoznia, amelyek lehetővé teszik a kimenő forgalmat az Azure HDInsight által kezelt adott adatgyűjtési pontokra.
A HDInsight szolgáltatásvégpont-szabályzatai
Ezek a szolgáltatásvégpont-szabályzatok a következő funkciókat támogatják:
- Naplók és telemetriai adatok gyűjtése a fürtlétrehozás, a feladatok végrehajtása és a platformműveletek, például a skálázás során.
- Virtuális merevlemezek (VHD-k) csatlakoztatása újonnan létrehozott fürtcsomópontokhoz szoftver és kódtárak kiépítéséhez a fürtön.
Ha a szolgáltatásvégpont-szabályzatok nem jönnek létre az adatáramlás engedélyezéséhez, előfordulhat, hogy a fürtlétrehozás meghiúsul, és az Azure HDInsight nem tudja támogatni a fürtöket.
Szolgáltatásvégpont-szabályzatok létrehozása a HDInsighthoz
Új fürtök létrehozása előtt győződjön meg arról, hogy a megfelelő szolgáltatásvégpont-szabályzatok vannak csatolva a virtuális hálózathoz. Ellenkező esetben a fürt létrehozása meghiúsulhat, vagy hibát eredményezhet.
Az alábbi eljárással hozza létre a szükséges szolgáltatásvégpont-szabályzatokat:
Döntse el, hogy melyik régióban hozza létre a HDInsight-fürtöt.
Keresse meg ezt a régiót a szolgáltatásvégpont-szabályzat erőforrásainak listájában, amely a HDInsight felügyeleti tárfiókjainak összes erőforráscsoportját biztosítja.
Válassza ki a régióhoz tartozó erőforráscsoportok listáját. Az alábbiakban egy példa látható a forrásanyagokra
Canada Central
:"Canada Central":[ "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/Default-Storage-WestUS", "/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/resourceGroups/GenevaWarmPathManageRG", "/subscriptions/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a/resourceGroups/GenevaWarmPathManageRG", "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/Default-Storage-CanadaCentral", "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/cancstorage", "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/GenevaWarmPathManageRG", "/subscriptions/eeee4efe-ff5f-aa6a-bb7b-cccccc8c8c8c/resourceGroups/DistroStorageRG/providers/Microsoft.Storage/storageAccounts/hdi31distrorelease", "/subscriptions/eeee4efe-ff5f-aa6a-bb7b-cccccc8c8c8c/resourceGroups/DistroStorageRG/providers/Microsoft.Storage/storageAccounts/bigdatadistro" ],
Szúrja be az erőforráscsoportok listáját az Azure CLI-ben vagy Azure PowerShell írt beállítási szkriptbe.
$subscriptionId = "<subscription id>" $rgName="<resource group name> " $location="<location name>" $vnetName="<vnet name>" $subnetName="<subnet name>" $sepName="<service endpoint policy name>" $sepDefName="<service endpoint policy definition name>" # Set to the right subscription ID az account set --subscription $subscriptionId # setup service endpoint on the virtual network subnet az network vnet subnet update -g $rgName --vnet-name $vnetName -n $subnetName --service-endpoints Microsoft.Storage # Create Service Endpoint Policy az network service-endpoint policy create -g $rgName -n $sepName -l $location # Insert the list of HDInsight owned resources for the region your clusters will be created in. # Be sure to get the most recent list of resource groups from the [list of service endpoint policy resources](https://github.com/Azure-Samples/hdinsight-enterprise-security/blob/main/hdinsight-service-endpoint-policy-resources.json) [String[]]$resources = @("/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/Default-Storage-WestUS",` "/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/resourceGroups/GenevaWarmPathManageRG",` "/subscriptions/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a/resourceGroups/GenevaWarmPathManageRG",` "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/Default-Storage-CanadaCentral",` "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/cancstorage",` "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/GenevaWarmPathManageRG", "/subscriptions/eeee4efe-ff5f-aa6a-bb7b-cccccc8c8c8c/resourceGroups/DistroStorageRG/providers/Microsoft.Storage/storageAccounts/hdi31distrorelease", "/subscriptions/eeee4efe-ff5f-aa6a-bb7b-cccccc8c8c8c/resourceGroups/DistroStorageRG/providers/Microsoft.Storage/storageAccounts/bigdatadistro") #Assign service resources to the SEP policy. az network service-endpoint policy-definition create -g $rgName --policy-name $sepName -n $sepDefName --service "Microsoft.Storage" --service-resources $resources # Associate a subnet to the service endpoint policy just created. If there is a delay in updating it to subnet, you can use the Azure portal to associate the policy with the subnet. az network vnet subnet update -g $rgName --vnet-name $vnetName -n $subnetName --service-endpoint-policy $sepName
Ha a szolgáltatásvégpont-szabályzatot a PowerShell használatával szeretné beállítani, használja az alábbi kódrészletet.
#Script to assign SEP $subscriptionId = "<subscription id>" $rgName = "<resource group name>" $vnetName = "<vnet name>" $subnetName = "<subnet Name" $location = "Canada Central" # Connect to your Azure Account Connect-AzAccount # Select the Subscription that you want to use Select-AzSubscription -SubscriptionId $subscriptionId # Retrieve VNet Config $vnet = Get-AzVirtualNetwork -ResourceGroupName $rgName -Name $vnetName # Retrieve Subnet Config $subnet = Get-AzVirtualNetworkSubnetConfig -Name $subnetName -VirtualNetwork $vnet # Insert the list of HDInsight owned resources for the region your clusters will be created in. # Be sure to get the most recent list of resource groups from the [list of service endpoint policy resources](https://github.com/Azure-Samples/hdinsight-enterprise-security/blob/main/hdinsight-service-endpoint-policy-resources.json) [String[]]$resources = @("/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/Default-Storage-WestUS", "/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/resourceGroups/GenevaWarmPathManageRG", "/subscriptions/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a/resourceGroups/GenevaWarmPathManageRG", "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/Default-Storage-CanadaCentral", "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/cancstorage", "/subscriptions/dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b/resourceGroups/GenevaWarmPathManageRG", "/subscriptions/eeee4efe-ff5f-aa6a-bb7b-cccccc8c8c8c/resourceGroups/DistroStorageRG/providers/Microsoft.Storage/storageAccounts/hdi31distrorelease", "/subscriptions/eeee4efe-ff5f-aa6a-bb7b-cccccc8c8c8c/resourceGroups/DistroStorageRG/providers/Microsoft.Storage/storageAccounts/bigdatadistro") #Declare service endpoint policy definition $sepDef = New-AzServiceEndpointPolicyDefinition -Name "SEPHDICanadaCentral" -Description "Service Endpoint Policy Definition" -Service "Microsoft.Storage" -ServiceResource $resources # Service Endpoint Policy $sep= New-AzServiceEndpointPolicy -ResourceGroupName $rgName -Name "SEPHDICanadaCentral" -Location $location -ServiceEndpointPolicyDefinition $sepDef # Associate a subnet to the service endpoint policy just created. If there is a delay in updating it to subnet, you can use the Azure portal to associate the policy with the subnet. Set-AzVirtualNetworkSubnetConfig -Name $subnetName -VirtualNetwork $vnet -AddressPrefix $subnet.AddressPrefix -ServiceEndpointPolicy $sep
Fontos
Javasoljuk, hogy a szolgáltatásvégpont-szabályzat erőforrásainak legújabb listáját ütemezetten manuálisan vagy automatizálással szerezze be. Ez megakadályozza a CRUD-problémákat, ha további erőforráscsoportokat adnak hozzá vagy távolítanak el a JSON-fájlból.