共用方式為


Start-AzureHDInsightJob

啟動 HDInsight 作業。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

Start-AzureHDInsightJob
     -Cluster <String>
     [-Credential <PSCredential>]
     -JobDefinition <AzureHDInsightJobDefinition>
     [-Profile <AzureSMProfile>]
     [<CommonParameters>]
Start-AzureHDInsightJob
     [-Certificate <X509Certificate2>]
     [-HostedService <String>]
     -Cluster <String>
     [-Endpoint <Uri>]
     [-IgnoreSslErrors <Boolean>]
     -JobDefinition <AzureHDInsightJobDefinition>
     [-Subscription <String>]
     [-Profile <AzureSMProfile>]
     [<CommonParameters>]

Description

此版本的 Azure PowerShell HDInsight 已被取代。 這些 Cmdlet 將於 2017 年 1 月 1 日移除。 請使用較新版本的 Azure PowerShell HDInsight。

如需如何使用新的 HDInsight 建立叢集的資訊,請參閱 使用 Azure PowerShell 在 HDInsight 中建立以 Linux 為基礎的叢集(https://azure.microsoft.com/en-us/documentation/articles/hdinsight-hadoop-create-linux-clusters-azure-powershell/)。 如需如何使用 Azure PowerShell 和其他方法提交作業的資訊,請參閱 在 HDInsight 中提交 Hadoop 作業 (https://azure.microsoft.com/en-us/documentation/articles/hdinsight-submit-hadoop-jobs-programmatically/)。 如需 Azure PowerShell HDInsight 的參考資訊,請參閱 Azure HDInsight Cmdlet

Start-AzureHDInsightJob Cmdlet 會在指定的叢集上啟動已定義的 Azure HDInsight 作業。 要啟動的作業可以是 MapReduce 作業、串流作業、Hive 作業或 Pig 作業。

範例

範例 1:啟動 HDInsight 作業

PS C:\>$SubId = (Get-AzureSubscription -Current).SubscriptionId
PS C:\> $ClusterName = "Cluster01"
PS C:\> $WordCountJob = New-AzureHDInsightMapReduceJobDefinition -JarFile "/Example/Apps/Hadoop-examples.jar" -ClassName "Wordcount" -Defines @{ "mapred.map.tasks" = "3" } -Arguments "/Example/Data/Gutenberg/Davinci.txt", "/Example/Output/WordCount"
PS C:\> $WordCountJob | Start-AzureHDInsightJob -Cluster $ClusterName
    | Wait-AzureHDInsightJob -Subscription $SubId -WaitTimeoutInSeconds 3600
    | Get-AzureHDInsightJobOutput -Cluster $ClusterName -Subscription $SubId -StandardError

第一個命令會取得目前的訂用帳戶標識碼,然後將它儲存在$SubId變數中。

第二個命令會將名稱 Cluster01 指派給$ClusterName變數。

第三個命令會使用 New-AzureHDInsightMapReduceJobDefinition Cmdlet 來建立 MapReduce 作業定義,然後將它儲存在$WordCountJob變數中。

最後一個命令會使用管線運算符,將$WordCountJob傳遞至 Start-AzureHDInsightJob Cmdlet 來啟動作業。 作業啟動之後,它會傳遞至 Wait-AzureHDInsightJob Cmdlet,此 Cmdlet 會等候作業完成,再將作業傳遞至 Get-AzureHDInsightJobOutput Cmdlet 以取得作業輸出。

參數

-Certificate

指定 Azure 訂用帳戶的管理憑證。

類型:X509Certificate2
別名:Cert
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Cluster

指定叢集。 這個 Cmdlet 會在此參數指定的叢集上啟動作業。

類型:String
別名:ClusterName
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Credential

指定叢集的直接 HTTP 存取的叢集認證。 您可以指定此參數, 而不是 Subscription 參數,以驗證叢集的存取權。

類型:PSCredential
別名:Cred
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Endpoint

指定要用來連線到 Azure 的端點。 如果您未指定此參數,此 Cmdlet 會使用預設端點。

類型:Uri
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-HostedService

如果您不想使用預設命名空間,請指定 HDInsight 服務的命名空間。

類型:String
別名:CloudServiceName
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-IgnoreSslErrors

指出是否忽略安全套接字層 (SSL) 錯誤。

類型:Boolean
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-JobDefinition

指定如果端點與預設值不同,則連線到 Microsoft Azure 時要使用的端點。

類型:AzureHDInsightJobDefinition
別名:jobDetails
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Subscription

指定訂用帳戶。 這個 Cmdlet 會針對此參數指定的訂用帳戶啟動作業。

類型:String
別名:Sub
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False