Scenario: Apache Ambari UI 502 error in Azure HDInsight
This article describes troubleshooting steps and possible resolutions for issues when interacting with Azure HDInsight clusters.
When you try to access the Apache Ambari UI for your HDInsight cluster, you get a message similar to: "502 - Web server received an invalid response while acting as a gateway or proxy server."
In general, the HTTP 502 status code means that Ambari server is not running correctly on the active headnode. There are a few possible root causes.
In most of the cases, to mitigate the problem, you can restart the active headnode. Or choose a larger VM size for your headnode.
You can check ambari-server logs to find out why Ambari server failed to start. One common reason is the database consistency check error. You can find this out in this log file: /var/log/ambari-server/ambari-server-check-database.log
.
If you made any modifications to the cluster node, please undo them. Always use Ambari UI to modify any Hadoop/Spark related configurations.
In rare situations, we've seen ambari-server process has close to 100% CPU utilization constantly. As a mitigation, you can ssh to the active headnode, and kill the Ambari server process and start it again.
ps -ef | grep AmbariServer
top -p <ambari-server-pid>
kill -9 <ambari-server-pid>
service ambari-server start
In some scenarios, your headnode runs out of memory, and the Linux oom-killer starts to pick processes to kill. You can verify this situation by searching the AmbariServer process ID, which should not be found. Then look at your /var/log/syslog
, and look for something like this:
Jul 27 15:29:30 xxx-xxxxxx kernel: [874192.703153] java invoked oom-killer: gfp_mask=0x23201ca, order=0, oom_score_adj=0
Then identify which processes are taking memories and try to further root cause.
Rarely the Ambari server cannot handle the incoming request, you can find more info by looking at the ambari-server logs for any error. One such case is an error like this:
Error Processing URI: /api/v1/clusters/xxxxxx/host_components - (java.lang.OutOfMemoryError) Java heap space
If you didn't see your problem or are unable to solve your issue, visit one of the following channels for more support:
- If you need more help, you can submit a support request from the Azure portal. Select Support from the menu bar or open the Help + support hub.