Hue的安装与部署

hadoop
hue

Hue 简介

Hue是一个开源的Apache Hadoop UI系统,最早是由Cloudera Desktop演化而来,由Cloudera贡献给开源社区,它是基于Python Web框架Django实现的。通过使用Hue我们可以在浏览器端的Web控制台上与Hadoop集群进行交互来分析处理数据,例如操作HDFS上的数据,运行MapReduce Job等等。很早以前就听说过Hue的便利与强大,一直没能亲自尝试使用,下面先通过官网给出的特性,通过翻译原文简单了解一下Hue所支持的功能特性集合:

  • 默认基于轻量级sqlite数据库管理会话数据,用户认证和授权,可以自定义为MySQL、Postgresql,以及Oracle

  • 基于文件浏览器(File Browser)访问HDFS

  • 基于Hive编辑器来开发和运行Hive查询

  • 支持基于Solr进行搜索的应用,并提供可视化的数据视图,以及仪表板(Dashboard)

  • 支持基于Impala的应用进行交互式查询

  • 支持Spark编辑器和仪表板(Dashboard)

  • 支持Pig编辑器,并能够提交脚本任务

  • 支持Oozie编辑器,可以通过仪表板提交和监控Workflow、Coordinator和Bundle

  • 支持HBase浏览器,能够可视化数据、查询数据、修改HBase表

  • 支持Metastore浏览器,可以访问Hive的元数据,以及HCatalog

  • 支持Job浏览器,能够访问MapReduce Job(MR1/MR2-YARN)

  • 支持Job设计器,能够创建MapReduce/Streaming/Java Job

  • 支持Sqoop 2编辑器和仪表板(Dashboard)

  • 支持ZooKeeper浏览器和编辑器

  • 支持MySql、PostGresql、Sqlite和Oracle数据库查询编辑器

Hue的架构:

hue官网:http://gethue.com/

配置文档:http://archive.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6/manual.html#_install_hue

源码:https://github.com/cloudera/hue

这里我们直接用下载Hue:http://archive.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6.tar.gz

Hue 编译

  1. 需要连接互联网

    修改虚拟机网络配置

  2. 安装系统包

    yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi gcc gcc-c++ krb5-devel libtidy libxml2-devel libxslt-devel openldap-devel python-devel sqlite-devel openssl-devel mysql-devel gmp-devel

    在实际安装的时候,sqlite-devel不能从镜像下载,这里我是用了手动下载tar包,安装编译:

    下载地址: http://www.sqlite.org/sqlite-autoconf-3070500.tar.gz

    tar zxf sqlite-autoconf-3070500.tar.gz
    cd sqlite-autoconf-3070500
    ./configure
    make
    sudo make install
  3. 编译Hue

    tar zxf hue-3.7.0-cdh5.3.6.tar.gz /opt/cdh5/
    cd /opt/cdh5/hue-3.7.0-cdh5.3.6/
    make apps
  4. 配置Hue

    secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
    # Webserver listens on this address and port
    http_host=hadoop
    http_port=8888
    # Time zone name
    time_zone=Asia/Shanghai
  5. 启动Hue

    ${HUE_HOME}/build/env/bin/supervisor
  6. 打开hue的浏览器页面:hadoop:8888

Hue与HDFS,YARN集成

  1. Hue与Hadoop集成时,需要配置启动HDFS中的webHDFS,在hdfs-site.xml增加下面配置:

    <property>
    <name>dfs.webhdfs.enabled</name>
    <value>true</value>
    </property>
  2. 此外,还需要配置Hue访问HDFS用户权限,在core-site.xml中配置:

    <property>
    <name>hadoop.http.staticuser.user</name>
    <value>hadoop</value>
    </property> <property>
    <name>hadoop.proxyuser.hue.hosts</name>
    <value>*</value>
    </property>
    <property>
    <name>hadoop.proxyuser.hue.groups</name>
    <value>*</value>
    </property>

    完成上述配置后,需重启HDFS。

  3. 配置Hue

    [[hdfs_clusters]]
    # HA support by using HttpFs [[[default]]]
    fs_defaultfs=hdfs://hadoop:8020 # Directory of the Hadoop configuration
    hadoop_conf_dir=/opt/cdh5/hadoop-2.5.0-cdh5.3.6/etc/hadoop # This is the home of your Hadoop HDFS installation.
    hadoop_hdfs_home=/opt/cdh5/hadoop-2.5.0-cdh5.3.6 # Use this as the HDFS Hadoop launcher script
    hadoop_bin=/opt/cdh5/hadoop-2.5.0-cdh5.3.6/bin # Configuration for YARN (MR2)
    # ------------------------------------------------------------------------
    [[yarn_clusters]] [[[default]]]
    # Enter the host on which you are running the ResourceManager
    resourcemanager_host=hadoop # The port where the ResourceManager IPC listens on
    resourcemanager_port=8032 # Whether to submit jobs to this cluster
    submit_to=True # URL of the ResourceManager API
    resourcemanager_api_url=http://hadoop:8088 # URL of the ProxyServer API
    proxy_api_url=http://hadoop:8088 # URL of the HistoryServer API
    history_server_api_url=http://hadoop:19888

    重启Hue服务。这里我们可以通在远程cmd中运行hive,在Hue中查看任务运行状况

Hue与Hive的集成

  1. hive-site.xml:

    注:metastore应该作为一个服务起来,然后让客户端去连接这个服务,去读mysql数据库里面的数据,可以参考hive官网上的Administrator Documentation中的Setting Up MetaStore

    <property>
    <name>hive.metastore.uris</name>
    <value>thrift://hadoop:9083</value>
    <description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
    </property>

    配置完成以后,需启动服务: nohup {$HIVE_HOME}/bin/hive --service metastore &

    nohup {$HIVE_HOME}/bin/hiveserver2 &

  2. hue.ini

    # Host where HiveServer2 is running.
    # If Kerberos security is enabled, use fully-qualified domain name (FQDN).
    hive_server_host=hadoop # Port where HiveServer2 Thrift server runs on.
    hive_server_port=10000 # Hive configuration directory, where hive-site.xml is located
    hive_conf_dir=/opt/cdh5/hive-0.13.1-cdh5.3.6/conf # Timeout in seconds for thrift calls to Hive service
    server_conn_timeout=120

    注:重新启动hive和hue以后,可能在hue中运行sql时会出现错误,因为权限问题,hue登陆的用户和hdfs上创建表的用户不相同,这个时候需要用hadoop的命令在后台做出更改bin/hdfs dfs -R o+x /xx

Hue与RDBMS的集成

  1. 在hue.ini中配置Hue本身的数据库SQLite

    [[[sqlite]]]
    # Name to show in the UI.
    nice_name=SQLite # For SQLite, name defines the path to the database.
    name=/opt/cdh5/hue-3.7.0-cdh5.3.6/desktop/desktop.db # Database backend to use.
    engine=sqlite
  2. 在hue.ini中配置Mysql数据库

    # Name to show in the UI.
    nice_name="My SQL DB"
    ## nice_name=MySqlDB
    # For MySQL and PostgreSQL, name is the name of the database.
    # For Oracle, Name is instance of the Oracle server. For express edition
    # this is 'xe' by default.
    ## name=db_track # Database backend to use. This can be:
    # 1. mysql
    # 2. postgresql
    # 3. oracle
    engine=mysql # IP or hostname of the database to connect to.
    host=hadoop # Port the database server is listening to. Defaults are:
    # 1. MySQL: 3306
    # 2. PostgreSQL: 5432
    # 3. Oracle Express Edition: 1521
    port=3306 # Username to authenticate with when connecting to the database.
    user=root # Password matching the username to authenticate with when
    # connecting to the database.
    password=123456

    重启hue服务,可以在页面中看到配置的数据库了:

Hue的安装与部署的更多相关文章

  1. linux下hue的安装与部署

    一.Hue 简介 Hue是一个开源的Apache Hadoop UI系统,最早是由Cloudera Desktop演化而来,由Cloudera贡献给开源社区,它是基于Python Web框架Djang ...

  2. CentOS6安装各种大数据软件 第十章:Spark集群安装和部署

    相关文章链接 CentOS6安装各种大数据软件 第一章:各个软件版本介绍 CentOS6安装各种大数据软件 第二章:Linux各个软件启动命令 CentOS6安装各种大数据软件 第三章:Linux基础 ...

  3. CentOS7安装CDH 第五章:CDH的安装和部署-CDH5.7.0

    相关文章链接 CentOS7安装CDH 第一章:CentOS7系统安装 CentOS7安装CDH 第二章:CentOS7各个软件安装和启动 CentOS7安装CDH 第三章:CDH中的问题和解决方法 ...

  4. Windows Server 2012 虚拟化实战:SCVMM的安装和部署

    本篇大概介绍一下在Windows Server 2012 R2上安装和部署SCVMM的过程及其注意事项.下图是我们数据中心SCVMM的基本架构,其中 SCVMM Database 是用于存储了所有配置 ...

  5. Linux下Redis的安装和部署

    一.Redis介绍 Redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcache类似,但很大程度补偿了Memcache的不足,它支持存储的value类型相对更多 ...

  6. 他山之石——vs2013 安装与部署及程序打包

    C#打包需要这个:InstallShield 2013 Limited Edition for Visual Studio  .下载地址: InstallShield 2013 Limited Edi ...

  7. 阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署

    阿里云服务器Linux CentOS安装配置(六)resin多端口配置.安装.部署 1.下载resin包 http://125.39.66.162/files/2183000003E08525/cau ...

  8. Kafka的安装和部署及测试

    1.简介 大数据分析处理平台包括数据的接入,数据的存储,数据的处理,以及后面的展示或者应用.今天我们连说一下数据的接入,数据的接入目前比较普遍的是采用kafka将前面的数据通过消息的方式,以数据流的形 ...

  9. Redis的安装与部署

    为了解决公司产品数据增长过快,初始化太耗费时间的问题,决定使用redis作为缓存服务器. Windows下的安装与部署: 可以直接参考这个文章,我也是实验了一遍:http://www.runoob.c ...

随机推荐

  1. MapReduce自定义InputFormat和OutputFormat

    一.自定义InputFormat 需求:将多个小文件合并为SequenceFile(存储了多个小文件) 存储格式:文件路径+文件的内容 c:/a.txt I love Beijing c:/b.txt ...

  2. 如何删除Docker中的镜像相关

    1.正常情况下 1.停止所有的container,这样才能够删除其中的images: docker stop $(docker ps -a -q) 如果想要删除所有container的话再加一个指令: ...

  3. java 多线程 day08 java5多线程新特性

    /** * Created by chengtao on 17/12/3. */public class Thread0801_java5_Atomaic { /* 三个包: http://tool. ...

  4. C语言中的extern

    extern: 这个关键字真的比较恶心,在定义变量的时候,extern居然可以被省略(定义时,默认均省略): 在声明变量的时候,extern必须加在变量前. 所以有时候你搞不清楚是声明还是定义.:变量 ...

  5. a=a+1背后的内存模型和CPU高速缓存

    学过JAVA的人都知道,程序运行过程中的临时数据,都是从外部存储设备调入内存(物理内存)中,再进行读写操作的.而计算机在执行程序时,对程序的每条指令都是在CPU中执行的,而指令的执行,势必涉及到对数据 ...

  6. python 学习笔记(循环,print的几种写法,操作符)

    一.循环( for, while) while循环是指在给定的条件成立时(true),执行循环体,否则退出循环.for循环是指重复执行语句. break 在需要时终止for /while循环 cont ...

  7. socketserver 并发连接

    socketserver.TCPServer Example server side 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...

  8. 《Unity3D》通过对象池模式,管理场景中的元素

    池管理类有啥用? 在游戏场景中,我们有时候会需要复用一些游戏物体,比如常见的子弹.子弹碰撞类,某些情况下,怪物也可以使用池管理,UI部分比如:血条.文字等等 这些元素共同的特性是:存在固定生命周期,使 ...

  9. iOS开发之HelloKitty(移动社交平台项目)

    iOS开发之HelloKitty(移动社交平台项目,2015.3,parishe)

  10. php项目代码 编码格式不对会大范围报错

    php项目代码 编码格式不对会大范围报错