Skip to content

Commit 836d9d7

Browse files
committed
freshness_c70
1 parent 2454ce2 commit 836d9d7

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

articles/hdinsight/hdinsight-hadoop-oms-log-analytics-tutorial.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.reviewer: jasonh
77
ms.service: hdinsight
88
ms.topic: conceptual
99
ms.custom: seoapr2020
10-
ms.date: 04/24/2020
10+
ms.date: 05/13/2020
1111
---
1212

1313
# Use Azure Monitor logs to monitor HDInsight clusters
@@ -35,12 +35,14 @@ If you don't have an Azure subscription, [create a free account](https://azure.m
3535

3636
For the instructions on how to create an HDInsight cluster, see [Get started with Azure HDInsight](hadoop/apache-hadoop-linux-tutorial-get-started.md).
3737

38-
* Azure PowerShell Az module. See [Introducing the new Azure PowerShell Az module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az). Ensure you have the latest version. If necessary, run `Update-Module -Name Az`.
38+
* If using PowerShell, you'll need the [Az Module](https://docs.microsoft.com/powershell/azure/overview). Ensure you have the latest version. If necessary, run `Update-Module -Name Az`.
39+
40+
* If wanting to use Azure CLI and you haven't yet installed it, see [Install the Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli).
3941

4042
> [!NOTE]
4143
> It is recommended to place both the HDInsight cluster and the Log Analytics workspace in the same region for better performance. Azure Monitor logs is not available in all Azure regions.
4244
43-
## Enable Azure Monitor logs by using the portal
45+
## Enable Azure Monitor using the portal
4446

4547
In this section, you configure an existing HDInsight Hadoop cluster to use an Azure Log Analytics workspace to monitor jobs, debug logs, and so on.
4648

@@ -56,7 +58,7 @@ In this section, you configure an existing HDInsight Hadoop cluster to use an Az
5658

5759
![Enable monitoring for HDInsight clusters](./media/hdinsight-hadoop-oms-log-analytics-tutorial/azure-portal-monitoring.png "Enable monitoring for HDInsight clusters")
5860

59-
## Enable Azure Monitor logs by using Azure PowerShell
61+
## Enable Azure Monitor using Azure PowerShell
6062

6163
You can enable Azure Monitor logs using the Azure PowerShell Az module [Enable-AzHDInsightMonitoring](https://docs.microsoft.com/powershell/module/az.hdinsight/enable-azhdinsightmonitoring) cmdlet.
6264

@@ -96,6 +98,29 @@ To disable, the use the [Disable-AzHDInsightMonitoring](https://docs.microsoft.c
9698
Disable-AzHDInsightMonitoring -Name "<your-cluster>"
9799
```
98100

101+
## Enable Azure Monitor using Azure CLI
102+
103+
You can enable Azure Monitor logs using the Azure CLI `[az hdinsight monitor enable`](https://docs.microsoft.com/cli/azure/hdinsight/monitor?view=azure-cli-latest#az-hdinsight-monitor-enable) command.
104+
105+
```azurecli
106+
# set variables
107+
export resourceGroup=RESOURCEGROUPNAME
108+
export cluster=CLUSTERNAME
109+
export LAW=LOGANALYTICSWORKSPACENAME
110+
111+
# Enable the Azure Monitor logs integration on an HDInsight cluster.
112+
az hdinsight monitor enable --name $cluster --resource-group $resourceGroup --workspace $LAW
113+
114+
# Get the status of Azure Monitor logs integration on an HDInsight cluster.
115+
az hdinsight monitor show --name $cluster --resource-group $resourceGroup
116+
```
117+
118+
To disable, the use the [`az hdinsight monitor disable`](https://docs.microsoft.com/cli/azure/hdinsight/monitor?view=azure-cli-latest#az-hdinsight-monitor-disable) command.
119+
120+
```azurecli
121+
az hdinsight monitor disable --name $cluster --resource-group $resourceGroup
122+
```
123+
99124
## Install HDInsight cluster management solutions
100125

101126
HDInsight provides cluster-specific management solutions that you can add for Azure Monitor logs. [Management solutions](../log-analytics/log-analytics-add-solutions.md) add functionality to Azure Monitor logs, providing additional data and analysis tools. These solutions collect important performance metrics from your HDInsight clusters. And provide the tools to search the metrics. These solutions also provide visualizations and dashboards for most cluster types supported in HDInsight. By using the metrics that you collect with the solution, you can create custom monitoring rules and alerts.

0 commit comments

Comments
 (0)