Hue是一个轻量级的Web服务器,可让您直接从浏览器使用HadoopHue只是一个“在任何Hadoop发行版之上的视图”,可以安装在任何机器上。

官方文档在官方文档

有多种方式(比如gethue.com的 “下载”部分)安装Hue。下一步就是将Hue配置为指向您的Hadoop集群默认情况下,Hue假定存在一个本地集群(即只有一台机器)。为了与真正的集群进行交互,Hue需要知道哪些主机分配了Hadoop服务。

hue.ini在哪里?(配置文件)

hue主要配置发生在hue.ini文件中。它列出了很多选项,但本质上什么是HDFS,YARN,Oozie,Hive的地址和端口...根据您安装的ini文件的分布位于:

  • CDH 包: /etc/hue/conf/hue.ini
  • tarball 版本: /usr/share/desktop/conf/hue.ini
  • 开发版本: desktop/conf/pseudo-distributed.ini
  • Cloudera Manager: CM 为你生成所有的hue.ini,所以没有麻烦? /var/run/cloudera-scm-agent/process/`ls -alrt /var/run/cloudera-scm-agent/process | grep HUE | tail -1 | awk ‘{print $9}’`/hue.ini
注意: 要覆盖Cloudera Manager中的值,需要从下面逐字逐句输入hue 安全阀 :色相服务→配置→全维修→高级→色调服务高级配置代码段(安全阀)hue_safety_valve.ini

这是官文的原话:Hue Safety Valve: Hue Service → Configuration → Service-Wide → Advanced → Hue Service Advanced Configuration Snippet (Safety Valve) for hue_safety_valve.ini

在任何时候,您都可以在/ desktop / dump_config页面上看到hue.ini的路径以及它的值然后,对于每个Hadoop服务,Hue包含一个需要使用正确的主机名和端口进行更新的部分。以下是ini文件中Hive部分的示例:

[beeswax]
 
  # Host where HiveServer2 is running.
  hive_server_host=localhost
要指向另一台服务器,只需用“hiveserver.ent.com”替换主机值:

[beeswax]
 
  # Host where HiveServer2 is running.
  hive_server_host=hiveserver.ent.com
注意: 任何以#开始的行都被视为注释,因此不被使用。
注意: 错误配置的服务列表在/ about / admin_wizard页面上列出。
注意: 每次更改ini文件后,应重新启动Hue以提取它。
注意:  在某些情况下,如Hadoop for Hue文档配置中所述,必须打开这些服务的API,并将Hue设置为代理用户。

删除应用程序

本文介绍如何配置Hue不显示某些应用程序。Hue的/ desktop / dump_config页面提供所有应用程序的列表。

以下是您需要更新的主要部分,以便在Hue中可以访问每个服务:

HDFS

这是列出或创建文件所必需的用NameNode的实际地址替换localhost(通常是http:// localhost:50070)。

<samp class="ph codeph" style="font&#45;family&#58;Monaco&#44; Menlo&#44; Consolas&#44; &#39;Courier New&#39;&#44; monospace&#59;font&#45;size&#58;1em&#59;">在hdfs-site.xml中输入</samp> 在NameNode和DataNodes中启用WebHDFS:

<property>
  <name>dfs.webhdfs.enabled</name>
  <value>true</value>
</property>
将Hue配置为所有其他用户和组的代理用户,这意味着它可以代表任何其他用户提交请求。添加 <samp class="ph codeph" style="font&#45;family&#58;Monaco&#44; Menlo&#44; Consolas&#44; &#39;Courier New&#39;&#44; monospace&#59;color&#58;rgb&#40;68&#44;68&#44;68&#41;&#59;">核心的site.xml</samp>

<property>
  <name>hadoop.proxyuser.hue.hosts</name>
  <value>*</value>
</property>
<property>
  <name>hadoop.proxyuser.hue.groups</name>
  <value>*</value>
</property>
然后,如果Namenode在不同于Hue的主机上,请不要忘记在hue.ini中更新:

[hadoop]
 
  [[hdfs_clusters]]
 
    [[[default]]]
 
      # Enter the filesystem uri
      fs_defaultfs=hdfs://localhost:8020
 
      # Use WebHdfs/HttpFs as the communication mechanism.
      # Domain should be the NameNode or HttpFs host.
      webhdfs_url=http://localhost:50070/webhdfs/v1

YARN

资源管理器默认通常在http:// localhost:8088上。ProxyServer和Job History服务器也需要指定。然后作业浏览器将让你 列出并杀死正在运行的应用程序 并获取他们的日志
[hadoop]
 
  [[yarn_clusters]]
 
    [[[default]]]
 
      # Enter the host on which you are running the ResourceManager
      resourcemanager_host=localhost     
 
      # Whether to submit jobs to this cluster
      submit_to=True
 
      # URL of the ResourceManager API
      resourcemanager_api_url=http://localhost:8088
 
      # URL of the ProxyServer API
      proxy_api_url=http://localhost:8088
 
      # URL of the HistoryServer API
      history_server_api_url=http://localhost:19888

Hive

这里我们需要一个运行HiveServer2来 发送SQL查询
[beeswax]
 
  # Host where HiveServer2 is running.
  hive_server_host=localhost
注意:
如果HiveServer2在另一台计算机上,并且您使用的是安全性或自定义的HiveServer2配置,则还需要在Hue计算机上复制hive-site.xml:
[beeswax]
 
  # Host where HiveServer2 is running.
  hive_server_host=localhost
 
  # Hive configuration directory, where hive-site.xml is located</span>
  hive_conf_dir=/etc/hive/conf

Impala

我们需要在Impala应用程序中 Interactive SQL 指定一个Impalad地址
[impala]
 
  # Host of the Impala Server (one of the Impalad)
  server_host=localhost

Solr Search

我们只需要指定Solr Cloud(或非云Solr)的地址,然后 交互式仪表盘 功能就释放了!
[search]
 
  # URL of the Solr Server
  solr_url=http://localhost:8983/solr/

Oozie

提交或监控工作流程 之前,应该启动并运行Oozie服务器
[liboozie]
 
  # The URL where the Oozie service runs on.
  oozie_url=http://localhost:11000/oozie

Pig

Pig的编辑要求 Oozie 设置其 sharelib。

HBase

HBase应用程序使用HBase Thrift Server版本1.它可以让您 浏览,查询和编辑HBase表格
[hbase]
 
  # Comma-separated list of HBase Thrift server 1 for clusters in the format of '(name|host:port)'.
 hbase_clusters=(Cluster|localhost:9090)

Sentry

Hue只需要指向运行Sentry服务器的机器。
[libsentry]
 
  # Hostname or IP of server.
  hostname=localhost

而就是这样!现在Hue会让你直接从你的浏览器做大数据,而不必接触命令行!然后你可以跟进一些 教程