在 Azure HDInsight 上安装自定义 Apache Hadoop 应用程序Install custom Apache Hadoop applications on Azure HDInsight

本文介绍如何在 Azure HDInsight 上安装尚未发布到 Azure 门户的 Apache Hadoop 应用程序。In this article, you will learn how to install an Apache Hadoop application on Azure HDInsight, which has not been published to the Azure portal. 本文中要安装的应用程序是 HueThe application you will install in this article is Hue.

HDInsight 应用程序是用户可以在 HDInsight 群集上安装的应用程序。An HDInsight application is an application that users can install on an HDInsight cluster. 这些应用程序可能是 Microsoft、独立软件供应商 (ISV) 或自己开发的。These applications can be developed by Microsoft, independent software vendors (ISV) or by yourself.

先决条件Prerequisites

如果想要在现有的 HDInsight 群集上安装 HDInsight 应用程序,必须有一个 HDInsight 群集。If you want to install HDInsight applications on an existing HDInsight cluster, you must have an HDInsight cluster. 若要创建群集,请参阅 创建群集To create one, see Create clusters. 也可以在创建 HDInsight 群集时安装 HDInsight 应用程序。You can also install HDInsight applications when you create an HDInsight cluster.

Install HDInsight applicationsInstall HDInsight applications

可以在创建群集时安装 HDInsight 应用程序,也可以将它安装到现有的 HDInsight 群集。HDInsight applications can be installed when you create a cluster or to an existing HDInsight cluster. 若要了解如何定义 Azure 资源管理器模板,请参阅 MSDN:安装 HDInsight 应用程序For defining Azure Resource Manager templates, see MSDN: Install an HDInsight application.

部署此应用程序 (Hue) 时所需的文件:The files needed for deploying this application (Hue):

将 Hue 安装到现有的 HDInsight 群集To install Hue to an existing HDInsight cluster

  1. 选择以下映像以登录到 Azure,然后在 Azure 门户中打开 Resource Manager 模板。Select the following image to sign in to Azure and open the Resource Manager template in the Azure portal.

    Deploy to Azure button for new cluster

    资源管理器模板位于 https://github.com/hdinsight/Iaas-Applications/tree/master/HueThe Resource Manager template is located at https://github.com/hdinsight/Iaas-Applications/tree/master/Hue. 若要了解如何编写此资源管理器模板,请参阅 MSDN:安装 HDInsight 应用程序To learn how to write this Resource Manager template, see MSDN: Install an HDInsight application.

  2. 从下拉列表中选择包含你的群集的现有资源组Select the existing Resource group that contains your cluster from the drop-down list. 必须使用与群集相同的资源组。It's required to use the same resource group as the cluster.

  3. 输入要安装应用程序的群集的名称。Enter the name of the cluster where you want to install the application. 此群集必须是现有的群集。This cluster must be an existing cluster.

  4. 选择与“我同意上述条款和条件”相对应的复选框。 Select the checkbox for I agree to the terms and conditions stated above.

  5. 选择“购买”。 Select Purchase.

可以从固定到门户仪表板的磁贴和门户通知查看安装状态(单击门户顶部的铃铛图标)。You can see the installation status from the tile pinned to the portal dashboard and the portal notification (click the bell icon on the top of the portal). 安装此应用程序大约需要 10 分钟。It takes about 10 minutes to install the application.

在创建群集的同时安装 HueTo install Hue while creating a cluster

  1. 选择以下映像以登录到 Azure,然后在 Azure 门户中打开 Resource Manager 模板。Select the following image to sign in to Azure and open the Resource Manager template in the Azure portal.

    Deploy to Azure

    资源管理器模板位于 https://hditutorialdata.blob.core.windows.net/hdinsightapps/create-linux-based-hadoop-cluster-in-hdinsight.jsonThe Resource Manager template is located at https://hditutorialdata.blob.core.windows.net/hdinsightapps/create-linux-based-hadoop-cluster-in-hdinsight.json. 若要了解如何编写此资源管理器模板,请参阅 MSDN:安装 HDInsight 应用程序To learn how to write this Resource Manager template, see MSDN: Install an HDInsight application.

  2. 根据说明来创建群集并安装 Hue。Follow the instruction to create cluster and install Hue. 有关创建 HDInsight 群集的详细信息,请参阅 在 HDInsight 中创建基于 Linux 的 Hadoop 群集For more information on creating HDInsight clusters, see Create Linux-based Hadoop clusters in HDInsight.

其他安装方法Other installation methods

除了 Azure 门户,也可以使用 Azure PowerShellAzure CLI 来调用 Resource Manager 模板。In addition to the Azure portal, you can also use Azure PowerShell and Azure CLI to call Resource Manager templates.

验证安装Validate the installation

可以在 Azure 门户中检查应用程序状态,以验证应用程序安装。You can check the application status on the Azure portal to validate the application installation. 此外,还可以验证所有 HTTP 终结点和网页(如果有)是否按预期出现:In addition, you can also validate all HTTP endpoints came up as expected and the webpage if there is one:

对于 Hue,可以使用以下步骤:For Hue, you can use the following steps:

Azure 门户Azure portal

  1. 登录到 Azure 门户Sign in to the Azure portal.
  2. 选择已在其中安装应用程序的群集。Select the cluster where you installed the application.
  3. 在“设置”菜单中,选择“应用程序”。 From the Settings menu, select Applications.
  4. 选择列表中的“hue”以查看 属性。Select hue from the list to view the properties.
  5. 选择“网页”链接以验证网站。Select the Webpage link to validate the website.

Azure CLIAzure CLI

CLUSTERNAMERESOURCEGROUP 替换为相关值,然后输入以下命令:Replace CLUSTERNAME, and RESOURCEGROUP with the relevant values and then enter the commands below:

  • 列出 HDInsight 群集的所有应用程序。To lists all of the applications for the HDInsight cluster.

    az hdinsight application list --cluster-name CLUSTERNAME --resource-group RESOURCEGROUP
    
  • 检索指定应用程序的属性。To retrieve properties of the specified application.

    az hdinsight application show --name hue --cluster-name CLUSTERNAME --resource-group RESOURCEGROUP
    

排查安装问题Troubleshoot the installation

可以通过门户通知查看应用程序安装状态(单击门户顶部的铃铛图标)。You can check the application installation status from the portal notification (Click the bell icon on the top of the portal).

如果应用程序安装失败,可以从三个位置查看错误消息和调试信息:If an application installation failed, you can see the error messages and debug information from three places:

  • HDInsight 应用程序:常规错误信息。HDInsight Applications: general error information.

    从门户打开群集,并在“设置”中选择“应用程序”:Open the cluster from the portal, and select Applications from Settings:

    hdinsight 应用程序安装错误

  • HDInsight 脚本操作:如果 HDInsight 应用程序的错误消息指出脚本操作失败,“脚本操作”窗格会显示有关脚本失败的详细信息。HDInsight script action: If the HDInsight Applications' error message indicates a script action failure, more details about the script failure will be presented in the script actions pane.

    在“设置”边栏选项卡中单击“脚本操作”。Click Script Action from the Settings blade. 脚本操作历史记录中显示了错误消息Script action history shows the error messages

    hdinsight 应用程序脚本操作错误

  • Ambari Web UI:如果安装脚本是失败的原因,请使用 Ambari Web UI 来检查有关安装脚本的完整日志。Ambari Web UI: If the install script was the cause of the failure, use Ambari Web UI to check full logs about the install scripts.

    有关详细信息,请参阅 故障排除For more information, see Troubleshooting.

删除 HDInsight 应用程序Remove HDInsight applications

Azure 门户Azure portal

  1. 登录到 Azure 门户Sign in to the Azure portal.
  2. 选择已在其中安装应用程序的群集。Select the cluster where you installed the application.
  3. 在“设置”菜单中,选择“应用程序”。 From the Settings menu, select Applications.
  4. 右键单击想要删除的应用程序,并选择“删除” 。Right-click the application you want to remove, and then select Delete.
  5. 请选择“是”以确认。 Select Yes to confirm.

Azure CLIAzure CLI

NAMECLUSTERNAMERESOURCEGROUP 替换为相关值,然后输入以下命令:Replace NAME, CLUSTERNAME, and RESOURCEGROUP with the relevant values and then enter the command below:

az hdinsight application delete --name NAME --cluster-name CLUSTERNAME --resource-group RESOURCEGROUP

后续步骤Next steps