使用 Apache Ambari Web UI 管理 HDInsight 群集Manage HDInsight clusters by using the Apache Ambari Web UI

Apache Ambari 提供简单易用的 Web UI 和 REST API 来简化 Apache Hadoop 群集的管理和监视。Apache Ambari simplifies the management and monitoring of an Apache Hadoop cluster by providing an easy to use web UI and REST API. Ambari 包含在 HDInsight 群集上,用于监视群集和进行配置更改。Ambari is included on HDInsight clusters, and is used to monitor the cluster and make configuration changes.

本文档介绍如何结合使用 Ambari Web UI 和 HDInsight 群集。In this document, you learn how to use the Ambari Web UI with an HDInsight cluster.

什么是 Apache Ambari?What is Apache Ambari?

Apache Ambari 通过提供易于使用的 Web UI 简化了 Hadoop 管理。Apache Ambari simplifies Hadoop management by providing an easy-to-use web UI. 可以使用 Ambari 来管理和监视 Hadoop 群集。You can use Ambari to manage and monitor Hadoop clusters. 开发人员可以使用 Ambari REST API在其应用程序中集成这些功能。Developers can integrate these capabilities into their applications by using the Ambari REST APIs.

连接Connectivity

在 HDInsight 群集上从 HTTPS://CLUSTERNAME.azurehdinsight.cn 可获得 Ambari Web UI,其中 CLUSTERNAME 是你的群集名称。The Ambari Web UI is available on your HDInsight cluster at HTTPS://CLUSTERNAME.azurehdinsight.cn, where CLUSTERNAME is the name of your cluster.

Important

连接到 HDInsight 上的 Ambari 需要 HTTPS。Connecting to Ambari on HDInsight requires HTTPS. 当提示进行身份验证时,请使用在创建群集时提供的管理员帐户名称和密码。When prompted for authentication, use the admin account name and password you provided when the cluster was created.

SSH 隧道(代理)SSH tunnel (proxy)

尽管可以直接通过 Internet 访问群集的 Ambari,但 Ambari Web UI 中的某些链接(例如 JobTracker 的链接)并未在 Internet 上公开。While Ambari for your cluster is accessible directly over the Internet, some links from the Ambari Web UI (such as to the JobTracker) are not exposed on the internet. 若要访问这些服务,必须创建一个 SSH 隧道。To access these services, you must create an SSH tunnel. 有关详细信息,请参阅将 SSH 隧道与 HDInsight 配合使用For more information, see Use SSH Tunneling with HDInsight.

Ambari Web UIAmbari Web UI

Warning

并非 Ambari Web UI 的所有功能都受 HDInsight 支持。Not all features of the Ambari Web UI are supported on HDInsight. 有关详细信息,请参阅本文档的不受支持操作部分。For more information, see the Unsupported operations section of this document.

连接到 Ambari Web UI 时,系统会提示用户向该页进行身份验证。When connecting to the Ambari Web UI, you are prompted to authenticate to the page. 请使用在创建群集过程中你使用的群集管理员用户(默认 Admin)和密码。Use the cluster admin user (default Admin) and password you used during cluster creation.

当该页打开时,请注意顶栏。When the page opens, note the bar at the top. 此栏中包含以下信息和控件:This bar contains the following information and controls:

ambari-nav

项目Item 说明Description
Ambari 徽标Ambari logo 打开仪表板,以便可以监视群集。Opens the dashboard, which can be used to monitor the cluster.
群集名称 # 项操作Cluster name # ops 显示进行中的 Ambari 操作数目。Displays the number of ongoing Ambari operations. 选择群集名称或“# 项操作”会显示后台操作列表。 Selecting the cluster name or # ops displays a list of background operations.
# 个警报# alerts 显示与群集相关的警告或严重警报(如果有)。Displays warnings or critical alerts, if any, for the cluster.
仪表板Dashboard 显示仪表板。Displays the dashboard.
服务Services 群集中服务的信息和配置设置。Information and configuration settings for the services in the cluster.
主机Hosts 群集中节点的信息和配置设置。Information and configuration settings for the nodes in the cluster.
警报Alerts 包含信息、警告和严重警报的日志。A log of information, warnings, and critical alerts.
管理员Admin 已安装在群集上的软件堆栈/服务、服务帐户信息和 Kerberos 安全性。Software stack/services that are installed on the cluster, service account information, and Kerberos security.
“管理”按钮Admin button Ambari 管理、用户设置和注销。Ambari management, user settings, and sign out.

监视Monitoring

警报Alerts

以下列表包含 Ambari 使用的常见警报状态:The following list contains the common alert statuses used by Ambari:

  • 正常OK
  • 警告Warning
  • 严重CRITICAL
  • 未知UNKNOWN

警报(“正常”状态除外)会导致页面顶部以“# 个警报”条目显示警报数目。 Alerts other than OK cause the # alerts entry at the top of the page to display the number of alerts. 选择此条目会显示警报及其状态。Selecting this entry displays the alerts and their status.

警报已组织成若干个默认组,可以从“警报”页面进行查看。 Alerts are organized into several default groups, which can be viewed from the Alerts page.

警报页

可通过使用“操作”菜单并选择“管理警报组”来管理这些组。 You can manage the groups by using the Actions menu and selecting Manage Alert Groups.

管理警报组对话框

还可管理警报方式,并通过在“操作”菜单中选择“管理警报通知”来创建警报通知。 You can also manage alerting methods, and create alert notifications from the Actions menu by selecting Manage Alert Notifications. 所有当前通知都会显示。Any current notifications are displayed. 还可以从此处创建通知。You can also create notifications from here. 出现特定的警报/严重性组合时,可通过电子邮件SNMP 发送通知。Notifications can be sent via EMAIL or SNMP when specific alert/severity combinations occur. 例如,可在“YARN 默认设置”组中的任何警报设为“严重”时发送电子邮件消息。 For example, you can send an email message when any of the alerts in the YARN Default group is set to Critical.

创建警报对话框

最后,在“操作”菜单中选择“管理警报设置”可设置发送通知前出现警报的次数。 Finally, selecting Manage Alert Settings from the Actions menu allows you to set the number of times an alert must occur before a notification is sent. 可以使用此设置来防止针对暂时性错误发出通知。This setting can be used to prevent notifications for transient errors.

群集Cluster

仪表板的“度量值”选项卡包含一系列 Widget,可让你一目了然地轻松监视群集状态。 The Metrics tab of the dashboard contains a series of widgets that make it easy to monitor the status of your cluster at a glance. “CPU 使用率”等多个 Widget 可在单击后提供更多信息。 Several widgets, such as CPU Usage, provide additional information when clicked.

包含度量值的仪表板

“热图”选项卡以绿色到红色的彩色热图显示度量值。 The Heatmaps tab displays metrics as colored heatmaps, going from green to red.

包含热图的仪表板

若要了解群集内节点的详细信息,请选择“主机”。 For more information on the nodes within the cluster, select Hosts. 然后选择你感兴趣的具体节点。Then select the specific node you are interested in.

主机详细信息

服务Services

仪表板上的“服务”边栏可让你快速了解群集上运行的服务的状态。 The Services sidebar on the dashboard provides quick insight into the status of the services running on the cluster. 各种图标用来指示状态或应当采取的操作。Various icons are used to indicate status or actions that should be taken. 例如,如果某项服务需要再循环,则会显示一个黄色的再循环符号。For example, a yellow recycle symbol is displayed if a service needs to be recycled.

服务边栏

Note

对于不同的 HDInsight 群集类型和版本,所显示的服务会有所不同。The services displayed differ between HDInsight cluster types and versions. 此处显示的服务可能不同于针对群集所显示的服务。The services displayed here may be different than the services displayed for your cluster.

选择一个服务会显示有关该服务的更多详细信息。Selecting a service displays more detailed information on the service.

检索摘要信息

某些服务会在页面顶部显示“快速链接”链接。 Some services display a Quick Links link at the top of the page. 这可以用于访问特定于服务的 Web UI,例如:This can be used to access service-specific web UIs, such as:

  • 作业历史记录 - MapReduce 作业历史记录。Job History - MapReduce job history.
  • Resource Manager - YARN ResourceManager UI。Resource Manager - YARN ResourceManager UI.
  • NameNode - Hadoop 分布式文件系统 (HDFS) NameNode UI。NameNode - Hadoop Distributed File System (HDFS) NameNode UI.
  • Oozie Web UI - Oozie UI。Oozie Web UI - Oozie UI.

选择其中任何链接会在浏览器中打开新选项卡,新选项卡显示选择的页面。Selecting any of these links opens a new tab in your browser, which displays the selected page.

Note

选择某项服务的快速链接条目可能会返回“找不到服务”错误。Selecting the Quick Links entry for a service may return a "server not found" error. 如果遇到此错误,则在使用此服务的快速链接条目时必须使用 SSH 隧道。If you encounter this error, you must use an SSH tunnel when using the Quick Links entry for this service. 有关信息,请参阅将 SSH 隧道与 HDInsight 配合使用For information, see Use SSH Tunneling with HDInsight

管理Management

主机Hosts

“主机”页面列出群集中的所有主机。 The Hosts page lists all hosts in the cluster. 若要管理主机,请遵循以下步骤。To manage hosts, follow these steps.

主机页

Note

对于 HDInsight 群集,不应使用添加、停用和重用主机的功能。Adding, decommissioning, and recommissioning a host should not be used with HDInsight clusters.

  1. 选择要管理的主机。Select the host that you wish to manage.

  2. 使用“操作” 菜单选择要执行的操作:Use the Actions menu to select the action that you wish to perform:

    项目Item 说明Description
    启动所有组件Start all components 启动主机上的所有组件。Start all components on the host.
    停止所有组件Stop all components 停止主机上的所有组件。Stop all components on the host.
    重启所有组件Restart all components 停止然后启动主机上的所有组件。Stop and start all components on the host.
    启用维护模式Turn on maintenance mode 隐藏主机的警报。Suppresses alerts for the host. 如果你正在执行生成了警报的操作,则应当启用此模式。This mode should be enabled if you are performing actions that generate alerts. 例如,停止和启动服务。For example, stopping and starting a service.
    关闭维护模式Turn off maintenance mode 使主机恢复正常警报。Returns the host to normal alerting.
    停止Stop 停止主机上的 DataNode 或 NodeManagers。Stops DataNode or NodeManagers on the host.
    开始Start 启动主机上的 DataNode 或 NodeManagers。Starts DataNode or NodeManagers on the host.
    重新启动Restart 停止然后启动主机上的 DataNode 或 NodeManagers。Stops and starts DataNode or NodeManagers on the host.
    解除授权Decommission 从群集中删除主机。Removes a host from the cluster. 请勿在 HDInsight 群集上使用此操作Do not use this action on HDInsight clusters.
    重用Recommission 将以前已解除授权的主机添加到群集中。Adds a previously decommissioned host to the cluster. 请勿在 HDInsight 群集上使用此操作Do not use this action on HDInsight clusters.

服务Services

在“仪表板”或“服务”页中,使用服务列表底部的“操作”按钮来停止和启动所有服务。 From the Dashboard or Services page, use the Actions button at the bottom of the list of services to stop and start all services.

服务操作

Warning

虽然“添加服务”列于该菜单中,但不应使用它来向 HDInsight 群集添加服务。 While Add Service is listed in this menu, it should not be used to add services to the HDInsight cluster. 群集设置期间应使用脚本操作添加新服务。New services should be added using a Script Action during cluster provisioning. 有关使用脚本操作的详细信息,请参阅使用脚本操作自定义 HDInsight 群集For more information on using Script Actions, see Customize HDInsight clusters using Script Actions.

虽然“操作”按钮可以重启所有服务,但你要启动、停止或重启的通常是某个特定服务。 While the Actions button can restart all services, often you want to start, stop, or restart a specific service. 使用以下步骤来对单个服务执行操作:Use the following steps to perform actions on an individual service:

  1. 从“仪表板”或“服务”页面中选择一个服务。 From the Dashboard or Services page, select a service.

  2. 在“摘要”选项卡的顶部,使用“服务操作”按钮,然后选择要执行的操作。 From the top of the Summary tab, use the Service Actions button and select the action to take. 这会重启所有节点上的服务。This restarts the service on all nodes.

    服务操作

    Note

    在群集运行时重启某些服务可能会生成警报。Restarting some services while the cluster is running may generate alerts. 若要避免生成警报,可使用“服务操作”按钮来为服务启用维护模式,然后再执行重启。 To avoid alerts, you can use the Service Actions button to enable Maintenance mode for the service before performing the restart.

  3. 选择某个操作后,页面顶部的“# 项操作”条目的数字便会递增,指出正在进行后台操作。 Once an action has been selected, the # op entry at the top of the page increments to show that a background operation is occurring. 如果已配置为显示,则显示后台操作的列表。If configured to display, the list of background operations is displayed.

    Note

    如果你已为服务启用了维护模式,请记得在操作完成后使用“服务操作”按钮来将它禁用。 If you enabled Maintenance mode for the service, remember to disable it by using the Service Actions button once the operation has finished.

若要配置服务,请使用以下步骤:To configure a service, use the following steps:

  1. 从“仪表板” 或“服务” 页面中选择一个服务。From the Dashboard or Services page, select a service.

  2. 选择“配置”选项卡。 这会显示当前配置。Select the Configs tab. The current configuration is displayed. 同时,还会显示以前的配置列表。A list of previous configurations is also displayed.

    配置

  3. 使用显示的字段修改配置,然后选择“保存”。 Use the fields displayed to modify the configuration, and then select Save. 或者,选择以前的某个配置,然后选择“设为当前配置”以回滚到以前的设置。 Or select a previous configuration and then select Make current to roll back to the previous settings.

Ambari 视图Ambari views

Ambari 视图允许开发人员使用 Apache Ambari 视图框架将 UI 元素插入 Ambari Web UI。Ambari Views allow developers to plug UI elements into the Ambari Web UI using the Apache Ambari Views Framework. HDInsight 为 Hadoop 群集类型提供了以下视图:HDInsight provides the following views with Hadoop cluster types:

  • Hive 视图:Hive 视图允许用户直接从 Web 浏览器运行 Hive 查询。Hive View: The Hive View allows you to run Hive queries directly from your web browser. 用户可以保存查询、查看结果、将结果保存到群集存储,或者将结果下载到本地系统。You can save queries, view results, save results to the cluster storage, or download results to your local system. 有关使用 Hive 视图的详细信息,请参阅将 Apache Hive 视图与 HDInsight 配合使用For more information on using Hive Views, see Use Apache Hive Views with HDInsight.

  • Tez 视图:使用 Tez 视图可以更好地理解和优化作业。Tez View: The Tez View allows you to better understand and optimize jobs. 可以查看与 Tez 作业的执行情况以及使用了哪些资源有关的信息。You can view information on how Tez jobs are executed and what resources are used.

不受支持操作Unsupported operations

HDInsight 上不支持以下 Ambari 操作:The following Ambari operations are not supported on HDInsight:

  • 移动指标收集器服务 。Moving the Metrics Collector service. 查看指标收集器服务上的信息时,“服务操作”菜单中的一个可用操作是移动指标收集器 。When viewing information on the Metrics Collector service, one of the actions available from the Service Actions menu is Move Metrics collector. HDInsight 不支持此操作。This is not supported with HDInsight.

后续步骤Next steps

了解如何将 Apache Ambari REST API 与 HDInsight 配合使用。Learn how to use the Apache Ambari REST API with HDInsight.