Azure HDInsight için sanal ağ hizmet uç noktası ilkelerini yapılandırma
Bu makalede, Azure HDInsight ile sanal ağlarda hizmet uç noktası ilkelerini uygulama hakkında bilgi sağlanır.
Arka Plan
Azure HDInsight, kendi sanal ağınızda kümeler oluşturmanıza olanak tanır. Sanal ağınızdan depolama hesapları gibi diğer Azure hizmetlerine giden trafiğe izin vermeniz gerekiyorsa hizmet uç noktası ilkeleri oluşturabilirsiniz. Ancak, Azure portal aracılığıyla oluşturulan hizmet uç noktası ilkeleri yalnızca tek bir hesap, abonelikteki tüm hesaplar veya bir kaynak grubundaki tüm hesaplar için ilke oluşturmanıza izin verir.
Ancak yönetilen bir hizmet olarak Azure HDInsight, her bölgedeki belirli depolama hesaplarındaki her kümeden veri ve günlük dosyaları toplar. Bu verilerin sanal ağınızdan HDInsight'a ulaşması için Azure HDInsight tarafından yönetilen belirli veri toplama noktalarına giden trafiğe izin veren hizmet uç noktası ilkeleri oluşturmanız gerekir.
HDInsight için hizmet uç noktası ilkeleri
Bu hizmet uç noktası ilkeleri aşağıdaki işlevleri destekler:
- Küme oluşturma, iş yürütme ve ölçeklendirme gibi platform işlemleriyle ilgili günlüklerin ve telemetrinin toplanması.
- Kümenizdeki yazılım ve kitaplıkları sağlamak için yeni oluşturulan küme düğümlerine sanal sabit diskler (VHD) ekleme.
Bu veri akışını etkinleştirmek için hizmet uç noktası ilkeleri oluşturulmazsa küme oluşturma başarısız olabilir ve Azure HDInsight kümeleriniz için destek sağlayamaz.
HDInsight için hizmet uç noktası ilkeleri oluşturma
Yeni kümeler oluşturmadan önce sanal ağınıza doğru hizmet uç noktası ilkelerinin ekli olduğundan emin olun. Aksi takdirde küme oluşturma işlemi başarısız olabilir veya hataya neden olabilir.
Gerekli hizmet uç noktası ilkelerini oluşturmak için aşağıdaki işlemi kullanın:
HDInsight kümenizi oluşturacağınız bölgeye karar verin.
Bu bölgeyi, HDInsight yönetim depolama hesapları için tüm kaynak gruplarını sağlayan hizmet uç noktası ilkesi kaynakları listesinde arayın.
Bölgeniz için kaynak gruplarının listesini seçin. Için kaynaklara
Canada Central
bir örnek aşağıda gösterilmiştir:"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" ],
Kaynak gruplarının listesini Azure CLI veya Azure PowerShell yazılmış kurulum betiğine ekleyin.
$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
Aşağıdaki kod parçacığını kullanarak PowerShell kullanarak hizmet uç noktası ilkenizi ayarlamayı tercih ederseniz.
#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
Önemli
Hizmet uç noktası ilkesi kaynaklarının en son listesini zamanlanmış olarak el ile veya otomasyon aracılığıyla almanız önerilir. Bu, ek kaynak grupları eklendiğinde veya JSON dosyasından kaldırıldığında CRUD sorunlarını engeller.