Hue大数据可视化分析

本文详细介绍Hue的下载、安装、配置及与Hadoop生态系统的集成过程,包括HDFS、YARN、Hive、Mysql和Hbase的集成步骤。通过实际案例,展示如何在多节点集群中部署Hue,实现数据管理和MapReduce任务执行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目录

一、环境说明

二、Hue下载安装

1. 下载

2. 编译安装

3. 基础配置

三、框架集成

1. HDFS集成

2. YARN集成

3. Hive集成

4. Mysql集成

5. Hbase集成

四、测试


Hue是一个开源的Apache Hadoop UI系统,由Cloudera Desktop演化而来,最后Cloudera公司将其贡献给Apache基金会的Hadoop社区,它是基于Python Web框架Django实现的。可以通过Hue来集成hdfs、yarn、hive、mysql、hbase等框架,实现管理hdfs上的数据、执行MapReduce程序等等。

说明:三台机器的主机名分别为:bigdata.centos01、bigdata.centos02、bigdata.centos03。HDFS和YARN未做HA。

一、环境说明

 centos01centos02centos03
HDFS

NameNode

DataNode

DataNode

DataNode
YARN

ResourceManager

NodeManager

NodeManagerNodeManager
Hbase

Master(active)

RegionServer

Master(backup)

RegionServer

RegionServer
Hive--Hive
Mysql--Mysql
Hue--Hue

二、Hue下载安装

1. 下载

wget http://archive.cloudera.com/cdh5/cdh/5/hue-3.9.0-cdh5.9.3.tar.gz

2. 编译安装

  • 安装依赖
sudo yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain gcc gcc-c++ krb5-devel libffi-devel libxml2-devel libxslt-devel make  mysql mysql-devel openldap-devel python-devel sqlite-devel gmp-devel
  • 编译

编译完成会出现build文件夹

make apps

3. 基础配置

修改desktop/conf/hue.ini文件,该文件是hue的全局配置文件。

[desktop]
    # 随机串,用于会话的存储,越长越好
    secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
    # 主机和用户名的绑定
    http_host=bigdata.centos03
    http_port=8888
    # 时区设置
    time_zone=Asia/Shanghai

4. 服务启动

nohup build/env/bin/supervisor &

三、框架集成

1. HDFS集成

  • hdfs-site.xml(hadoop)
# 新增如下配置,默认就是true,可不配
<property>
  <name>dfs.webhdfs.enabled</name>
  <value>true</value>
</property>
  • core-site.html(hadoop)
# 新增如下配置
<property>
  <name>hadoop.proxyuser.hue.hosts</name>
  <value>*</value>
</property>
<property>
  <name>hadoop.proxyuser.hue.groups</name>
  <value>*</value>
</property>
  • hue.ini
[[hdfs_clusters]]

    [[[default]]]

      fs_defaultfs=hdfs://bigdata.centos01:9000
      
      webhdfs_url=http://bigdata.centos01:50070/webhdfs/v1

      hadoop_conf_dir=/opt/modules/hadoop-2.5.0/etc/hadoop
	  
      hadoop_bin=/opt/modules/hadoop-2.5.0/etc/hadoop

      hadoop_hdfs_home=/opt/modules/hadoop-2.5.0

2. YARN集成

  • hue.ini
[[yarn_clusters]]

    [[[default]]]
      # 运行resourceManager的主机
      resourcemanager_host=bigdata.centos01

      # ResourceManager IPC监听端口
      resourcemanager_port=8032

      # 是否将作业提交到此群集
      submit_to=True

      # ResourceManager API
      resourcemanager_api_url=http://bigdata.centos01:8088

      # ProxyServer API
      proxy_api_url=http://bigdata.centos01:8088

      # HistoryServer API
      history_server_api_url=http://bigdata.centos01:19888

3. Hive集成

  • hue.ini
[beeswax]

  # HiveServer2运行的主机
  hive_server_host=bigdata.centos03

  # HiveServer2 Thrift server运行端口号
  hive_server_port=10000

  # hive配置文件
  hive_conf_dir=/opt/modules/hive-0.13.1-bin/conf
  • 服务启动
# 启动hiveserver2
nohup bin/hiveserver2 &

4. Mysql集成

  • hue.ini
 [[[mysql]]]
      # 用于hue的界面显示
      nice_name="my db"

      # 数据库名
      name=test

      engine=mysql

      host=bigdata.centos03

      port=3306

      user=root

      password=123456

5. Hbase集成

  • hue.ini
[hbase]
  
  hbase_clusters=(Cluster|bigdata.centos01:9090)

  hbase_conf_dir=/opt/modules/hbase-0.98.6-cdh5.3.9/conf
  • 服务启动

hue需要依赖于hbase的thrift服务

bin/hbase-daemon.sh start thrift

四、测试

通过hive执行sql来对集成测试,看能否查询到存储在hbase的数据,能否提交任务给yarn执行MapReduce程序得到结果数据。

  • select * from logs limit 10;

  • select searchname,count(*) num from logs group by searchname order by num desc limit 10;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值