You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -75,7 +75,7 @@ The following sections describe how customers can use the new Azure Monitor Agen
75
75
>
76
76
> For more information about how to create a Log Analytics workspace, see [Create a Log Analytics workspace in the Azure portal](/azure/azure-monitor/logs/quick-create-workspace).
77
77
78
-
### Enable Azure monitor agent using Portal
78
+
### Approach 1: Enable Azure monitor agent using Portal
79
79
80
80
Activate the new integration by going to your cluster's portal page and scrolling down the menu on the left until you reach the Monitoring section.
81
81
@@ -92,6 +92,175 @@ Activate the new integration by going to your cluster's portal page and scrollin
92
92
93
93
1. Select Save once precondition steps are complete.
94
94
95
+
### Approach 2: Enable Azure monitor agent using Azure CLI
96
+
97
+
1. Enable system-assigned MSI
98
+
99
+
1. First get cluster information to check the MSI of cluster
100
+
101
+
102
+
```
103
+
az hdinsight show –-resource-group $resourceGroup –name $cluster
1. If this cluster already system assigned MSI, no need to anything .
128
+
129
+
130
+
1. Creation of DCR
131
+
132
+
For more insormation, see [Create and edit data collection rules (DCRs)](/azure/azure-monitor/essentials/data-collection-rule-create-edit?tabs=CLI#create-a-dcr)
133
+
134
+
```
135
+
# The URL of the DCR template file, change {HDIClusterType} to your cluster type.
az monitor data-collection rule association create --association-name $dcrAssociationName --resource $hdinsightClusterResourceId --data-collection-rule-id $dcrId
229
+
```
230
+
231
+
232
+
1. Enabling Azure Monitor Agent
233
+
234
+
```
235
+
# set variables
236
+
237
+
export resourceGroup=RESOURCEGROUPNAME
238
+
239
+
export cluster=CLUSTERNAME
240
+
241
+
export LAW=LOGANALYTICSWORKSPACENAME
242
+
243
+
244
+
245
+
# Enable the Azure Monitor Agent logs integration on an HDInsight cluster.
246
+
247
+
az hdinsight azure-monitor-agent enable --name $cluster --resource-group $resourceGroup --workspace $LAW
248
+
249
+
250
+
251
+
# Get the status of Azure Monitor Agent logs integration on an HDInsight cluster.
252
+
253
+
az hdinsight azure-monitor-agent show --name $cluster --resource-group $resourceGroup
254
+
```
255
+
256
+
257
+
1. (Optional) disabling Azure Monitor Agent
258
+
259
+
```
260
+
az hdinsight azure-monitor-agent disable --name $cluster --resource-group $resourceGroup
261
+
```
262
+
263
+
95
264
### Enable Azure Monitor Agent logging for Spark cluster
96
265
97
266
Azure HDInsight Spark clusters control AMA integration using a Spark configuration `spark.hdi.ama.enabled`, by default the value is set to false. This configuration controls whether the Spark specific logs will come up in the Log Analytics workspace. If you want to enable AMA in your Spark clusters and retrieve the Spark event logs in their LA workspaces, you need to perform an additional step to enable AMA for spark specific logs.
0 commit comments