使用浏览器、PowerShell 或 Azure 经典 CLI 删除 HDInsight 群集Delete an HDInsight cluster using your browser, PowerShell, or the Azure Classic CLI

HDInsight 群集计费在创建群集之后便会开始,删除群集后才会停止。HDInsight cluster billing starts once a cluster is created and stops when the cluster is deleted. HDInsight 群集按分钟收费,因此不再需要使用群集时,应将其删除。Billing is pro-rated per minute, so you should always delete your cluster when it is no longer in use. 本文档介绍如何使用 Azure 门户、Azure PowerShell 和 Azure CLI 删除群集。In this document, you learn how to delete a cluster using the Azure portal, Azure PowerShell, and the Azure CLI.

重要

删除 HDInsight 群集不会删除与该群集关联的 Azure 存储帐户。Deleting an HDInsight cluster does not delete the Azure Storage accounts associated with the cluster. 可重新使用以后存储在这些服务中的数据。You can reuse data stored in those services in the future.

Azure 门户Azure portal

  1. 登录到 Azure 门户Sign in to the Azure portal.

  2. 在左侧菜单中,导航到“所有服务” > “分析” > “HDInsight 群集”,然后选择群集。From the left menu, navigate to All services > Analytics > HDInsight clusters and select your cluster.

  3. 在默认视图中,选择“删除”图标。From the default view, select the Delete icon. 按提示删除群集。Follow the prompt to delete your cluster.

    删除图标

Azure PowerShell Az 模块Azure PowerShell Az module

在下面的代码中,将 CLUSTERNAME 替换为 HDInsight 群集的名称。Replace CLUSTERNAME with the name of your HDInsight cluster in the code below. 在 PowerShell 提示符处输入以下命令,以便删除群集:From a PowerShell prompt, enter the following command to delete the cluster:

Remove-AzHDInsightCluster -ClusterName CLUSTERNAME

Azure CLIAzure CLI

在下面的代码中,将 CLUSTERNAME 替换为 HDInsight 群集的名称,将 RESOURCEGROUP 替换为资源组的名称。Replace CLUSTERNAME with the name of your HDInsight cluster, and RESOURCEGROUP with the name of your resource group in the code below. 在命令提示符处输入以下命令,以便删除群集:From a command prompt, enter the following to delete the cluster:

az hdinsight delete --name CLUSTERNAME --resource-group RESOURCEGROUP