Bearbeiten

Freigeben über


Start-AzHDInsightJob

Starts a defined Azure HDInsight job on a specified cluster.

Syntax

Start-AzHDInsightJob
     [-ClusterName] <String>
     [-JobDefinition] <AzureHDInsightJobDefinition>
     [-HttpCredential] <PSCredential>
     [-ResourceGroupName <String>]
     [-DefaultProfile <IAzureContextContainer>]
     [<CommonParameters>]

Description

The Start-AzHDInsightJob cmdlet starts a defined Azure HDInsight job on a specified cluster. This can be a MapReduce job, a Streaming MapReduce job, a Hive job, or a Pig job.

Examples

Example 1: Start a job on the specified cluster

# Cluster info
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential

# Hive job details
$statusFolder = "tempStatusFolder/"
$query = "SHOW TABLES"

New-AzHDInsightHiveJobDefinition -StatusFolder $statusFolder `
            -Query $query `
        | Start-AzHDInsightJob `
            -ClusterName $clusterName `
            -ClusterCredential $clusterCreds

This command starts a job on the cluster named your-hadoop-001.

Parameters

-ClusterName

Specifies the name of the cluster.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HttpCredential

Specifies the cluster login (HTTP) credentials for the cluster.

Type:PSCredential
Aliases:ClusterCredential
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-JobDefinition

Specifies the job to start on the Azure HDInsight cluster.

Type:AzureHDInsightJobDefinition
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Specifies the name of the resource group.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureHDInsightJobDefinition

Outputs

AzureHDInsightJob