Hue是一个轻量级的Web服务器,可让您直接从浏览器使用Hadoop。Hue只是一个“在任何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
这是官文的原话: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-family:Monaco, Menlo, Consolas, 'Courier New', monospace;font-size:1em;">在hdfs-site.xml中输入</samp> 在NameNode和DataNodes中启用WebHDFS:
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
将Hue配置为所有其他用户和组的代理用户,这意味着它可以代表任何其他用户提交请求。添加 <samp class="ph codeph" style="font-family:Monaco, Menlo, Consolas, 'Courier New', monospace;color:rgb(68,68,68);">核心的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
[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]
# Host of the Impala Server (one of the Impalad)
server_host=localhost
Solr Search
[search]
# URL of the Solr Server
solr_url=http://localhost:8983/solr/
Oozie
[liboozie]
# The URL where the Oozie service runs on.
oozie_url=http://localhost:11000/oozie
Pig
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
[libsentry]
# Hostname or IP of server.
hostname=localhost
而就是这样!现在Hue会让你直接从你的浏览器做大数据,而不必接触命令行!然后你可以跟进一些 教程 。