|
1 | 1 | ---
|
2 |
| -title: Manage Apache Hadoop clusters using Azure Classic CLI - Azure HDInsight |
3 |
| -description: Learn how to use the Azure classic CLI to manage Apache Hadoop clusters in Azure HDInsight. |
| 2 | +title: Manage Azure HDInsight clusters using Azure CLI |
| 3 | +description: Learn how to use the Azure CLI to manage Azure HDInsight clusters. Cluster types include Apache Hadoop, Spark, HBase, Storm, Kafka, Interactive Query, and ML Services. |
4 | 4 | ms.reviewer: jasonh
|
5 | 5 | author: tylerfox
|
6 | 6 |
|
7 | 7 | ms.service: hdinsight
|
8 | 8 | ms.custom: hdinsightactive,hdiseo17may2017
|
9 | 9 | ms.topic: conceptual
|
10 |
| -ms.date: 11/06/2018 |
| 10 | +ms.date: 05/13/2019 |
11 | 11 | ms.author: tyfox
|
12 |
| - |
13 | 12 | ---
|
14 |
| -# Manage Apache Hadoop clusters in HDInsight using the Azure Classic CLI |
| 13 | + |
| 14 | +# Manage Azure HDInsight clusters using Azure CLI |
| 15 | + |
15 | 16 | [!INCLUDE [selector](../../includes/hdinsight-portal-management-selector.md)]
|
16 | 17 |
|
17 |
| -Learn how to use the [Azure Classic CLI](../cli-install-nodejs.md) to manage [Apache Hadoop](https://hadoop.apache.org/) clusters in Azure HDInsight. The classic CLI is implemented in Node.js. It can be used on any platform that supports Node.js, including Windows, Mac, and Linux. |
| 18 | +Learn how to use [Azure CLI](https://docs.microsoft.com/cli/azure/?view=azure-cli-latest) to manage Azure HDInsight clusters. The Azure command-line interface (CLI) is Microsoft's cross-platform command-line experience for managing Azure resources. |
18 | 19 |
|
19 |
| -[!INCLUDE [classic-cli-warning](../../includes/requires-classic-cli.md)] |
| 20 | +If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin. |
20 | 21 |
|
21 | 22 | ## Prerequisites
|
22 |
| -Before you begin this article, you must have the following: |
23 |
| - |
24 |
| -* **An Azure subscription**. See [Get Azure free trial](https://azure.microsoft.com/documentation/videos/get-azure-free-trial-for-testing-hadoop-in-hdinsight/). |
25 |
| -* **Azure Classic CLI** - See [Install and configure the Azure Classic CLI](../cli-install-nodejs.md) for installation and configuration information. |
26 |
| -* **Connect to Azure**, using the following command: |
27 |
| - |
28 |
| - ```cli |
29 |
| - azure login |
30 |
| - ``` |
31 |
| - |
32 |
| - For more information on authenticating using a work or school account, see [Connect to an Azure subscription from the Azure Classic CLI](/cli/azure/authenticate-azure-cli). |
33 |
| -* **Switch to the Azure Resource Manager mode**, using the following command: |
34 |
| - |
35 |
| - ```cli |
36 |
| - azure config mode arm |
37 |
| - ``` |
38 |
| -
|
39 |
| -To get help, use the **-h** switch. For example: |
40 |
| -
|
41 |
| -```cli |
42 |
| -azure hdinsight cluster create -h |
| 23 | + |
| 24 | +* Azure CLI. If you haven't installed the Azure CLI, see [Install the Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli) for steps. |
| 25 | + |
| 26 | +* An Apache Hadoop cluster on HDInsight. See [Get Started with HDInsight on Linux](hadoop/apache-hadoop-linux-tutorial-get-started.md). |
| 27 | + |
| 28 | +## Connect to Azure |
| 29 | + |
| 30 | +Sign in to your Azure subscription. If you plan to use Azure Cloud Shell then simply select **Try it** in the upper-right corner of the code block. Else, enter the command below: |
| 31 | + |
| 32 | +```azurecli-interactive |
| 33 | +az login |
| 34 | +
|
| 35 | +# If you have multiple subscriptions, set the one to use |
| 36 | +# az account set --subscription "SUBSCRIPTIONID" |
43 | 37 | ```
|
44 | 38 |
|
45 |
| -## Create clusters with the CLI |
46 |
| -See [Create clusters in HDInsight using the Azure Classic CLI](hdinsight-hadoop-create-linux-clusters-azure-cli.md). |
| 39 | +## List clusters |
47 | 40 |
|
48 |
| -## List and show cluster details |
49 |
| -Use the following commands to list and show cluster details: |
| 41 | +Use [az hdinsight list](https://docs.microsoft.com/cli/azure/hdinsight?view=azure-cli-latest#az-hdinsight-list) to list clusters. Edit the commands below by replacing `RESOURCE_GROUP_NAME` with the name of your resource group, then enter the commands: |
50 | 42 |
|
51 |
| -```cli |
52 |
| -azure hdinsight cluster list |
53 |
| -azure hdinsight cluster show <Cluster Name> |
| 43 | +```azurecli-interactive |
| 44 | +# List all clusters in the current subscription |
| 45 | +az hdinsight list |
| 46 | +
|
| 47 | +# List only cluster name and its resource group |
| 48 | +az hdinsight list --query "[].{Cluster:name, ResourceGroup:resourceGroup}" --output table |
| 49 | +
|
| 50 | +# List all cluster for your resource group |
| 51 | +az hdinsight list --resource-group RESOURCE_GROUP_NAME |
| 52 | +
|
| 53 | +# List all cluster names for your resource group |
| 54 | +az hdinsight list --resource-group RESOURCE_GROUP_NAME --query "[].{clusterName:name}" --output table |
54 | 55 | ```
|
55 | 56 |
|
56 |
| -![Command-line view of cluster list][image-cli-clusterlisting] |
| 57 | +## Show cluster |
57 | 58 |
|
58 |
| -## Delete clusters |
59 |
| -Use the following command to delete a cluster: |
| 59 | +Use [az hdinsight show](https://docs.microsoft.com/cli/azure/hdinsight?view=azure-cli-latest#az-hdinsight-show) to show information for a specified cluster. Edit the command below by replacing `RESOURCE_GROUP_NAME`, and `CLUSTER_NAME` with the relevant information, then enter the command: |
60 | 60 |
|
61 |
| -```cli |
62 |
| -azure hdinsight cluster delete <Cluster Name> |
| 61 | +```azurecli-interactive |
| 62 | +az hdinsight show --resource-group RESOURCE_GROUP_NAME --name CLUSTER_NAME |
63 | 63 | ```
|
64 | 64 |
|
65 |
| -You can also delete a cluster by deleting the resource group that contains the cluster. Please note, this will delete all the resources in the group including the default storage account. |
| 65 | +## Delete clusters |
66 | 66 |
|
67 |
| -```cli |
68 |
| -azure group delete <Resource Group Name> |
| 67 | +Use [az hdinsight delete](https://docs.microsoft.com/cli/azure/hdinsight?view=azure-cli-latest#az-hdinsight-delete) to delete a specified cluster. Edit the command below by replacing `RESOURCE_GROUP_NAME`, and `CLUSTER_NAME` with the relevant information, then enter the command: |
| 68 | + |
| 69 | +```azurecli-interactive |
| 70 | +az hdinsight delete --resource-group RESOURCE_GROUP_NAME --name CLUSTER_NAME |
69 | 71 | ```
|
70 | 72 |
|
71 |
| -## Scale clusters |
72 |
| -To change the Apache Hadoop cluster size: |
| 73 | +You can also delete a cluster by deleting the resource group that contains the cluster. Note, this will delete all the resources in the group including the default storage account. |
73 | 74 |
|
74 |
| -```cli |
75 |
| -azure hdinsight cluster resize [options] <clusterName> <Target Instance Count> |
| 75 | +```azurecli-interactive |
| 76 | +az group delete --name RESOURCE_GROUP_NAME |
76 | 77 | ```
|
77 | 78 |
|
| 79 | +## Scale clusters |
78 | 80 |
|
79 |
| -## Enable/disable HTTP access for a cluster |
| 81 | +Use [az hdinsight resize](https://docs.microsoft.com/cli/azure/hdinsight?view=azure-cli-latest#az-hdinsight-resize) to resize the specified HDInsight cluster to the specified size. Edit the command below by replacing `RESOURCE_GROUP_NAME`, and `CLUSTER_NAME` with the relevant information. Replace `TARGET_INSTANCE_COUNT` with the desired number of worker nodes for your cluster. For more information about scaling clusters, see [Scale HDInsight clusters](./hdinsight-scaling-best-practices.md). Enter the command: |
80 | 82 |
|
81 |
| -```cli |
82 |
| -azure hdinsight cluster enable-http-access [options] <Cluster Name> <userName> <password> |
83 |
| -azure hdinsight cluster disable-http-access [options] <Cluster Name> |
| 83 | +```azurecli-interactive |
| 84 | +az hdinsight delete --resource-group RESOURCE_GROUP_NAME --name CLUSTER_NAME --target-instance-count TARGET_INSTANCE_COUNT |
84 | 85 | ```
|
85 | 86 |
|
86 | 87 | ## Next steps
|
| 88 | + |
87 | 89 | In this article, you have learned how to perform different HDInsight cluster administrative tasks. To learn more, see the following articles:
|
88 | 90 |
|
89 | 91 | * [Manage Apache Hadoop clusters in HDInsight by using the Azure portal](hdinsight-administer-use-portal-linux.md)
|
90 |
| -* [Administer HDInsight by using Azure PowerShell][hdinsight-admin-powershell] |
91 |
| -* [Get started with Azure HDInsight][hdinsight-get-started] |
92 |
| -* [How to use the Azure Classic CLI][azure-command-line-tools] |
93 |
| - |
94 |
| -[azure-command-line-tools]: ../cli-install-nodejs.md |
95 |
| -[azure-create-storageaccount]:../storage/common/storage-create-storage-account.md |
96 |
| -[azure-purchase-options]: https://azure.microsoft.com/pricing/purchase-options/ |
97 |
| -[azure-member-offers]: https://azure.microsoft.com/pricing/member-offers/ |
98 |
| -[azure-free-trial]: https://azure.microsoft.com/pricing/free-trial/ |
99 |
| - |
100 |
| -[hdinsight-admin-powershell]: hdinsight-administer-use-powershell.md |
101 |
| -[hdinsight-get-started]:hadoop/apache-hadoop-linux-tutorial-get-started.md |
102 |
| - |
103 |
| -[image-cli-account-download-import]: ./media/hdinsight-administer-use-command-line/HDI.CLIAccountDownloadImport.png |
104 |
| -[image-cli-clustercreation]: ./media/hdinsight-administer-use-command-line/HDI.CLIClusterCreation.png |
105 |
| -[image-cli-clustercreation-config]: ./media/hdinsight-administer-use-command-line/HDI.CLIClusterCreationConfig.png |
106 |
| -[image-cli-clusterlisting]: ./media/hdinsight-administer-use-command-line/command-line-list-of-clusters.png "List and show clusters" |
| 92 | +* [Administer HDInsight by using Azure PowerShell](hdinsight-administer-use-powershell.md) |
| 93 | +* [Get started with Azure HDInsight](hadoop/apache-hadoop-linux-tutorial-get-started.md) |
| 94 | +* [Get started with Azure CLI](https://docs.microsoft.com/cli/azure/get-started-with-azure-cli?view=azure-cli-latest) |
0 commit comments