Add-AzHDInsightScriptAction
Menambahkan tindakan skrip ke objek konfigurasi kluster.
Sintaks
Add-AzHDInsightScriptAction
[-Config] <AzureHDInsightConfig>
[-NodeType] <ClusterNodeType>
[-Uri] <Uri>
[-Name] <String>
[[-Parameters] <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Deskripsi
Cmdlet Add-AzHDInsightScriptAction menambahkan tindakan skrip ke objek konfigurasi HDInsight yang dibuat oleh cmdlet New-AzHDInsightClusterConfig. Tindakan skrip menyediakan fungsionalitas yang digunakan untuk menginstal perangkat lunak tambahan atau untuk mengubah konfigurasi aplikasi yang berjalan pada kluster Hadoop dengan menggunakan skrip Windows PowerShell atau Bash (untuk kluster Windows atau Linux). Tindakan skrip berjalan pada node kluster saat kluster HDInsight disebarkan, dan dijalankan setelah node di kluster menyelesaikan konfigurasi HDInsight. Tindakan skrip berjalan di bawah hak istimewa akun administrator sistem dan memberikan hak akses penuh ke node kluster. Anda dapat menyediakan setiap kluster dengan daftar tindakan skrip untuk dijalankan dalam urutan tertentu.
Contoh
Contoh 1: Menambahkan tindakan skrip ke objek konfigurasi kluster
# Primary storage account info
$storageAccountResourceGroupName = "Group"
$storageAccountResourceId = "yourstorageaccountresourceid"
$storageAccountName = "yourstorageacct001"
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroupName -Name $storageAccountName)[0].value
$storageContainer = "container001"
# Script action info
$scriptActionName = "<script action name>"
$scriptActionURI = "<script action URI>"
$scriptActionParameters = "<script action parameters>"
# Cluster configuration info
$location = "East US 2"
$clusterResourceGroupName = "Group"
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential
# If the cluster's resource group doesn't exist yet, run:
# New-AzResourceGroup -Name $clusterResourceGroupName -Location $location
# Create the cluster
New-AzHDInsightClusterConfig `
| Add-AzHDInsightScriptAction `
-Name $scriptActionName `
-Uri $scriptActionURI `
-Parameters $scriptActionParameters `
-NodeType Worker `
| Add-AzHDInsightScriptAction `
-Name $scriptActionName `
-Uri $scriptActionURI `
-Parameters $scriptActionParameters `
-NodeType Head `
| New-AzHDInsightCluster `
-ClusterType Hadoop `
-OSType Windows `
-ClusterSizeInNodes 4 `
-ResourceGroupName $clusterResourceGroupName `
-ClusterName $clusterName `
-HttpCredential $clusterCreds `
-Location $location `
-StorageAccountResourceId $storageAccountResourceId `
-StorageAccountKey $storageAccountKey `
-StorageContainer $storageContainer
Perintah ini menambahkan tindakan skrip untuk simpul Head dan Worker dari kluster your-hadoop-001, untuk dijalankan di akhir pembuatan kluster.
Parameter
-Config
Menentukan objek konfigurasi kluster HDInsight yang dimodifikasi cmdlet ini. Objek ini dibuat oleh cmdlet New-AzHDInsightClusterConfig .
Type: | AzureHDInsightConfig |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan azure
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Menentukan nama tindakan skrip.
Type: | String |
Position: | 3 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NodeType
Menentukan jenis node untuk menjalankan tindakan skrip. Nilai yang dapat diterima untuk parameter ini adalah:
- HeadNode
- WorkerNode
- ZookeeperNode
Type: | ClusterNodeType |
Accepted values: | HeadNode, WorkerNode, ZookeeperNode, EdgeNode |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Parameters
Menentukan parameter untuk tindakan skrip.
Type: | String |
Position: | 4 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Uri
Menentukan URI publik untuk tindakan skrip (skrip PowerShell atau Bash).
Type: | Uri |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Input
Output
Link Terkait
Azure PowerShell
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk