一、 Apache Hue介绍

1、Hue是什么

  • HUE英文全称为Hadoop User Experience,是一个开源的Apache Hadoop UI系统,由Cloudera Desktop演化而来,最后Cloudera公司将其贡献给Apache基金会的Hadoop社区,它是基于Python Web框架Django实现的
  • 通过使用Hue,可以在浏览器端的Web控制台上与Hadoop集群进行交互,来分析处理数据,例如操作HDFS上的数据,运行MapReduce Job,执行Hive的SQL语句,浏览HBase数据库等等

2、Hue能做什么

  • 访问HDFS和文件浏览
  • 通过web调试和开发hive以及数据结果展示
  • 查询solr和结果展示,报表生成
  • 通过web调试和开发impala交互式SQL Query
  • spark调试和开发
  • Pig开发和调试
  • oozie任务的开发,监控,和工作流协调调度
  • Hbase数据查询和修改,数据展示
  • Hive的元数据(metastore)查询
  • MapReduce任务进度查看,日志追踪
  • 创建和提交MapReduce,Streaming,Java job任务
  • Sqoop2的开发和调试
  • Zookeeper的浏览和编辑
  • 数据库(MySQL,PostGres,SQlite,Oracle)的查询和展示

3、Hue的架构

  • Hue是一个友好的界面集成框架,可以集成各种大量的大数据体系软件框架,通过一个界面就可以做到查看以及执行所有的框架
  • Hue提供的这些功能相比Hadoop生态各组件提供的界面更加友好,但是一些需要debug的场景可能还是要使用原生系统才能更加深入的找到错误的原因

二、 Hue的安装

1.上传解压安装包
  • Hue的安装支持多种方式,包括rpm包的方式进行安装、tar.gz包的方式进行安装以及cloudera manager的方式来进行安装等,我们这里使用tar.gz包的方式来进行安装
  • Hue的压缩包的下载地址:
    http://archive.cloudera.com/cdh5/cdh/5/
  • 我们这里使用的是CDH5.14.0这个对应的版本,具体下载地址为
    http://archive.cloudera.com/cdh5/cdh/5/hue-3.9.0-cdh5.14.0.tar.gz
tar -zxf hue-3.9.0-cdh5.14.0.tar.gz
2.联网安装各种必须的依赖包
yum install -y asciidoc cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain gcc gcc-c++ krb5-devel libffi-devel libxml2-devel libxslt-devel make openldap-devel python-devel sqlite-devel gmp-devel
3.Hue初始化配置
cd /export/servers/hue-3.9.0-cdh5.14.0/desktop/conf
vim  hue.ini

根据自己配置修改以下内容

#通用配置
[desktop]
secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
#通过http访问hue界面的主机名
http_host=node01
#是否启用新版hue界面
is_hue_4=true
#时区
time_zone=Asia/Shanghai
server_user=root
server_group=root
default_user=root
default_hdfs_superuser=root
#配置使用mysql作为hue的存储数据库,大概在hue.ini的587行左右
[[database]]
#设置database为mysql
engine=mysql
#mysql所在节点
host=node01
port=3306
#mysql用户名及密码
user=root
password=Hadoop
#mysql数据库名
name=hue
4.创建mysql中Hue使用的DB
create database hue default character set utf8 default collate utf8_general_ci;
5.编译Hue
cd /export/servers/hue-3.9.0-cdh5.14.0
make apps

编译成功之后,会在hue数据库中创建许多初始化表

5.启动Hue、Web UI访问
cd /export/servers/hue-3.9.0-cdh5.14.0
前台启动:
./build/env/bin/supervisor
后台启动:
./build/env/bin/supervisor &WEB页面访问路径
http://node01:8888第一次访问的时候,需要设置超级管理员用户和密码。记住它

三、 Hue与软件的集成

3.1、 Hue集成HDFS

3.1.1、修改core-site.xml配置

<!—允许通过httpfs方式访问hdfs的主机名 -->
<property><name>hadoop.proxyuser.root.hosts</name><value>*</value>
</property>
<!—允许通过httpfs方式访问hdfs的用户组 -->
<property><name>hadoop.proxyuser.root.groups</name><value>*</value>
</property>

3.1.2、修改hdfs-site.xml配置

<property><name>dfs.webhdfs.enabled</name><value>true</value>
</property>

3.1.3、修改hue.ini

[[hdfs_clusters]][[[default]]]
fs_defaultfs=hdfs://node01:8020
webhdfs_url=http://node01:50070/webhdfs/v1
hadoop_hdfs_home=/export/servers/hadoop-2.6.0-cdh5.14.0
hadoop_bin=/export/servers/hadoop-2.6.0-cdh5.14.0/bin
hadoop_conf_dir=/export/servers/hadoop-2.6.0-cdh5.14.0/etc/hadoop

3.1.4、重启HDFS、Hue

启动HDFS
start-dfs.sh启动hue进程
cd /export/servers/hue-3.9.0-cdh5.14.0
./build/env/bin/supervisor

3.1.5、WEB界面查看

3.2、 Hue集成YARN

3.2.1、修改hue.ini

[[yarn_clusters]][[[default]]]resourcemanager_host=node01resourcemanager_port=8032submit_to=Trueresourcemanager_api_url=http://node01:8088history_server_api_url=http://node01:19888

3.2.2、开启yarn日志聚集服务

MapReduce 是在各个机器上运行的, 在运行过程中产生的日志存在于各个机器上,为了能够统一查看各个机器的运行日志,将日志集中存放在 HDFS 上, 这个过程就是日志聚集

<property>  ##是否启用日志聚集功能。<name>yarn.log-aggregation-enable</name><value>true</value>
</property>
<property>  ##设置日志保留时间,单位是秒。<name>yarn.log-aggregation.retain-seconds</name><value>106800</value>
</property>

3.2.3、重启Yarn、Hue

启动yarn
start-yarn.sh启动hue进程
cd /export/servers/hue-3.9.0-cdh5.14.0
./build/env/bin/supervisor

3.2.4、WEB界面查看

3.3、 Hue集成Hive

如果需要配置hue与hive的集成,我们需要启动hive的metastore服务以及hiveserver2服务(impala需要hive的metastore服务,hue需要hvie的hiveserver2服务)

3.3.1、修改Hue.ini

[beeswax]hive_server_host=node01hive_server_port=10000hive_conf_dir=/export/servers/hive-1.1.0-cdh5.14.0/confserver_conn_timeout=120auth_username=rootauth_password=hadoop[metastore]#允许使用hive创建数据库表等操作enable_new_create_table=true

3.3.2、启动Hive服务、重启hue

在node01机器上启动hive的 metastore 以及 hiveserver2 服务

后台启动 metastore 以及 hiveserver2 服务
cd /export/servers/hive-1.1.0-cdh5.14.0
nohup bin/hive --service metastore &
nohup bin/hive --service hiveserver2 &启动hue进程
cd /export/servers/hue-3.9.0-cdh5.14.0
./build/env/bin/supervisor

3.3.3、WEB界面查看


3.4、Hue集成Mysql

3.4.1、修改hue.ini

需要把mysql的注释给去掉;大概位于1546行[[[mysql]]]nice_name="My SQL DB"engine=mysqlhost=node01port=3306user=rootpassword=hadoop

3.4.2、重启hue

启动hue进程
cd /export/servers/hue-3.9.0-cdh5.14.0/
./build/env/bin/supervisor

3.4.3、WEB界面查看

3.5、Hue集成Oozie

3.5.1、修改hue配置文件hue.ini

[liboozie]# The URL where the Oozie service runs on. This is required in order for# users to submit jobs. Empty value disables the config check.oozie_url=http://node01:11000/oozie# Requires FQDN in oozie_url if enabled## security_enabled=false# Location on HDFS where the workflows/coordinator are deployed when submitted.remote_deployement_dir=/export/service/oozie/oozie_works[oozie]# Location on local FS where the examples are stored.# local_data_dir=/export/servers/oozie-4.1.0-cdh5.14.0/examples/apps# Location on local FS where the data for the examples is stored.# sample_data_dir=/export/servers/oozie-4.1.0-cdh5.14.0/examples/input-data# Location on HDFS where the oozie examples and workflows are stored.# Parameters are $TIME and $USER, e.g. /user/$USER/hue/workspaces/workflow-$TIME# remote_data_dir=/user/root/oozie_works/examples/apps# Maximum of Oozie workflows or coodinators to retrieve in one API call.oozie_jobs_count=100# Use Cron format for defining the frequency of a Coordinator instead of the old frequency number/unit.enable_cron_scheduling=true# Flag to enable the saved Editor queries to be dragged and dropped into a workflow.enable_document_action=true# Flag to enable Oozie backend filtering instead of doing it at the page level in Javascript. Requires Oozie 4.3+.enable_oozie_backend_filtering=true# Flag to enable the Impala action.enable_impala_action=true[filebrowser]# Location on local filesystem where the uploaded archives are temporary stored.archive_upload_tempdir=/tmp# Show Download Button for HDFS file browser.show_download_button=true# Show Upload Button for HDFS file browser.show_upload_button=true# Flag to enable the extraction of a uploaded archive in HDFS.enable_extract_uploaded_archive=true

3.5.2、启动hue、oozie

启动hue进程
cd /export/servers/hue-3.9.0-cdh5.14.0
./build/env/bin/supervisor启动oozie进程
cd /export/servers/oozie-4.1.0-cdh5.14.0
./bin/oozied.sh start

3.5.3、WEB界面查看

3.6、Hue集成Hbase

3.6.1、修改hbase配置

在hbase-site.xml配置文件中的添加如下内容,开启hbase thrift服务
修改完成之后scp给其他机器上hbase安装包
<property><name>hbase.thrift.support.proxyuser</name><value>true</value>
</property>
<property><name>hbase.regionserver.thrift.http</name><value>true</value>
</property>

3.6.2、修改hadoop配置

在core-site.xml中确保 HBase被授权代理,添加下面内容
把修改之后的配置文件scp给其他机器和hbase安装包conf目录下
<property>
<name>hadoop.proxyuser.hbase.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hbase.groups</name>
<value>*</value>
</property>

3.6.3、修改Hue配置

[hbase]# Comma-separated list of HBase Thrift servers for clusters in the format of '(name|host:port)'.# Use full hostname with security.# If using Kerberos we assume GSSAPI SASL, not PLAIN.hbase_clusters=(Cluster|node01:9090)# HBase configuration directory, where hbase-site.xml is located.hbase_conf_dir=/export/servers/hbase-1.2.1/conf# Hard limit of rows or columns per row fetched before truncating.## truncate_limit = 500# 'buffered' is the default of the HBase Thrift Server and supports security.# 'framed' can be used to chunk up responses,# which is useful when used in conjunction with the nonblocking server in Thrift.thrift_transport=buffered

3.6.4、启动hbase(包括thrift服务)、hue

需要启动hdfs和hbase,然后再启动thrift
start-dfs.sh
start-hbase.sh
./hbase-daemon.sh start thrift重新启动hue
cd /export/servers/hue-3.9.0-cdh5.14.0/
./build/env/bin/supervisor

3.6.5、WEB界面查看

3.7、Hue集成Impala

3.7.1、修改hue配置文件hue.ini

[impala]server_host=node01server_port=21050impala_conf_dir=/etc/impala/conf

3.7.2、重启Hue

cd /export/servers/hue-3.9.0-cdh5.14.0/
./build/env/bin/supervisor

3.7.3、WEB界面查看

完结撒花!!!

【Hue】Hue入门解析相关推荐

  1. oozie Hue操作入门

    一.直接在Hue操作 1.创建文件 2. 3. 4. 5. 6. 7. 8. 9. 二.用命令行 从节点目录上传文件到hdfs 节点目录:/home/yuwei/mydoc/test3.sh hdfs ...

  2. Android网络编程入门解析

    网络编程 网络编程对于很多的初学者来说,都是很向往的一种编程技能,但是很多的初学者却因为很长一段时间无法进入网络编程的大门而放弃了对于该部分技术的学习. 在 学习网络编程以前,很多初学者可能觉得网络编 ...

  3. Apache Hue:Hue集成Hbase

    Hue集成Hbase 修改hbase配置 在hbase-site.xml配置文件中的添加如下内容,开启hbase thrift服务. 修改完成之后scp给其他机器上hbase安装包. <prop ...

  4. Apache Hue:Hue集成Impala

    Hue集成Impala 修改Hue.ini [impala]server_host=node-3server_port=21050impala_conf_dir=/etc/impala/conf 重启 ...

  5. Apache Hue: Hue集成Hive

    Hue集成Hive 如果需要配置hue与hive的集成,我们需要启动hive的metastore服务以及hiveserver2服务(impala需要hive的metastore服务,hue需要hvie ...

  6. java爬虫面试题_Java 网络爬虫基础知识入门解析

    前言 说起网络爬虫,大家想起的估计都是 Python ,诚然爬虫已经是 Python 的代名词之一,相比 Java 来说就要逊色不少.有不少人都不知道 Java 可以做网络爬虫,其实 Java 也能做 ...

  7. Apache Hue: Hue集成HDFS

    Hue集成HDFS 注意修改完HDFS相关配置后,需要把配置scp给集群中每台机器,重启hdfs集群. 修改core-site.xml配置 <--允许通过httpfs方式访问hdfs的主机名 - ...

  8. NodeJs初学者经典入门解析

     Node.js 是一个基于谷歌浏览器JavaScript执行环境建立的一个平台,让JavaScript可以脱离客户端浏览器运行,让 JavaScript具有服务器语言的能力.我们可以使用Node ...

  9. HttpComponents入门解析

    1 简介 超文本传输协议(http)是目前互联网上极其普遍的传输协议,它为构建功能丰富,绚丽多彩的网页提供了强大的支持.构建一个网站,通常无需直接操作http协议,目前流行的WEB框架已经透明的将这些 ...

最新文章

  1. 深度学习在图像领域的几大任务
  2. Wireshark初次使用
  3. DirectX10一变换(三)
  4. settype COM_LOCAT_ADDR出现在CRM change document里的原因
  5. 单片机串口发送数据很慢?这种方法帮助你提高!
  6. MSP432 库函数实现 PID 电机调角度、调速
  7. mongoDB配制及学习
  8. .sql文件_优化体系--sql_trace+10046事件(上篇)
  9. 86. php 绘图体系(2)
  10. 【CF-1285E】Delete a Segment(区间处理(并集)----思维)
  11. 第五版fmea表格_FMEA第五版: 新版 DFMEA六步法解析
  12. linux64位wps下载授权码,ubuntu15.04安装wps-office的64位版
  13. 【Python脚本进阶】2.4、conficker蠕虫(上):Metasploit攻击Windows SMB服务
  14. RK3399 上电待机,按power按键开机
  15. css元素可拖动,css3实现可拖动的魔方3d效果
  16. LogLoss的公式演化
  17. 【AD封装】RJ45座子(带3D)
  18. echarts 多种类型的legend一行居中展示
  19. windows找不到文件 pythonw
  20. Android唤醒、解锁屏幕代码实例

热门文章

  1. Mac安装psycopg2解决方法
  2. Office2007与Microsoft Office SharePoint2007的配置和注意事项!
  3. 基于Springboot+Netty实现Web聊天室
  4. 运维人员打字耍不要快_Linux运维人员应该知道的系统故障排查及修复方法
  5. Reactor 3快速上手——响应式Spring的道法术器
  6. 两年狂开两万家店,合伙人落地方案分享
  7. day5 from 金角大王
  8. Day6 - Python基础6 面向对象编程 --转自金角大王
  9. matlab求偏态系数,Matlab数据拟合正太分布与偏态分布
  10. [第六章] 深入理解计算机系统第三版 家庭作业参考答案