【原创】大数据基础之Ambari(5)通过Ambari部署Hue
ambari2.7.3(hdp3.1) 安装 hue4.2
ambari的hdp中原生不支持hue安装,下面介绍如何通过添加service的方式使ambari支持hue安装:

官方:http://gethue.com/
Hue is an open source Workbench for developing and accessing Data Apps.
一 安装SERVICE
第三方service:https://github.com/EsharEditor/ambari-hue-service
1 下载
VERSION=`hdp-select status hadoop-client | sed 's/hadoop-client - \([0-9]\.[0-9]\).*/\1/'`
rm -rf /var/lib/ambari-server/resources/stacks/HDP/$VERSION/services/HUE
sudo git clone https://github.com/EsharEditor/ambari-hue-service.git /var/lib/ambari-server/resources/stacks/HDP/$VERSION/services/HUE
2 修改
第三方service中安装的是hue3.11,改为4.2,需要如下改动:
# cd /var/lib/ambari-server/resources/stacks/HDP/3.1/services/HUE
# sed -i 's/3.11.0/4.2.0/g' metainfo.xml
# sed -i 's/3.11.0/4.2.0/g' README.md
# sed -i 's/3.11.0/4.2.0/g' package/scripts/params.py
# sed -i 's/3.11.0/4.2.0/g' package/scripts/setup_hue.py# vi package/scripts/params.py
--modify line
32 #download_url = 'cat /etc/yum.repos.d/HDP.repo | grep "baseurl" | awk -F \'=\' \'{print $2"hue/hue-4.2.0.tgz"}\''
33 download_url = 'echo "http://gethue.com/downloads/releases/4.2.0/hue-4.2.0.tgz"'187 webhdfs_url = format('http://' + hdfs_httpfs_host + ':50070/webhdfs/v1')
--without yarn
:234,256s/^/#/g
# vi package/scripts/common.py
--add line 59,63,64
58 Execute('tar -zxvf hue.tgz -C {0} && rm -f hue.tgz'.format(params.hue_install_ dir))
59 Execute('mkdir -p {0}'.format(params.hue_dir))
60 # Ensure all Hue files owned by hue 61 Execute('chown -R {0}:{1} {2}'.format(params.hue_user,params.hue_group,params. hue_dir))
62 Execute('ln -s {0} /usr/hdp/current/hue-server'.format(params.hue_dir))
63 Execute('rm -rf {0}/*'.format(params.hue_dir))
64 Execute('cd /usr/local/hue-4.2.0 && make install')--comment line
90 #services_configurations['httpfs-site'] = {}
91 #services_configurations['httpfs-site']['httpfs.proxyuser.hue.groups'] = '*'
92 #services_configurations['httpfs-site']['httpfs.proxyuser.hue.hosts'] = '*'# vi package/scripts/setup_hue.py
--comment line
26 #Logger.info("Creating symlinks /usr/hdp/current/hadoop-client/lib/hue-plugins -4.2.0-SNAPSHOT.jar")
27 #Link("{0}/desktop/libs/hadoop/java-lib/*".format(params.hue_dir),to = "/usr/h dp/current/hadoop-client/lib")# vi package/files/configs.sh
39 PASSWD="admin"
注意这一步
download_url = 'echo "http://gethue.com/downloads/releases/4.2.0/hue-4.2.0.tgz"'
hue-4.2.0.tgz需要手工下载并放到一个服务器可访问的url上(比如本地的nginx),同时修改这里的download_url
二 在ambari中部署
1 添加用户
useradd hue
2 页面部署安装hue
安装后的hue目录位于/usr/local/hue/
3 修改配置
1)修改数据库配置
# vi desktop/conf/hue.ini
[[database]]
# Database engine is typically one of:
# postgresql_psycopg2, mysql, sqlite3 or oracle.
#
# Note that for sqlite3, 'name', below is a path to the filename. For other backends, it is the database name
# Note for Oracle, options={"threaded":true} must be set in order to avoid crashes.
# Note for Oracle, you can use the Oracle Service Name by setting "host=" and "port=" and then "name=<host>:<port>/<service_name>".
# Note for MariaDB use the 'mysql' engine.
## engine=sqlite3
## host=
## port=
## user=
## password=
# conn_max_age option to make database connection persistent value in seconds
# https://docs.djangoproject.com/en/1.9/ref/databases/#persistent-connections
## conn_max_age=0
# Execute this script to produce the database password. This will be used when 'password' is not set.
## password_script=/path/script
## name=desktop/desktop.db
修改engine、host、port、user、password、name
2)初始化数据库
# build/env/bin/hue syncdb
其中会创建初试用户名和密码
# build/env/bin/hue migrate
3)如果要支持数据库查询比如mysql,找到
[[databases]]
# mysql, oracle, or postgresql configuration.
## [[[mysql]]]
# Name to show in the UI.
## nice_name="My SQL DB"
# 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=mysqldb
# 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=localhost
# 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=example
# Password matching the username to authenticate with when
# connecting to the database.
## password=example
按照注释添加即可,可添加多个
4)如果需要增加impala查询,找到
[impala]
# Host of the Impala Server (one of the Impalad)
# server_host=localhost
# Port of the Impala Server
## server_port=21050
注意这里是21050端口,不是impala-shell连接的21000端口
5)可以通过配置blacklist来隐藏一些组件的菜单
[desktop]
app_blacklist=beeswax,impala,security,filebrowser,jobbrowser,rdbms,jobsub,pig,hbase,sqoop,zookeeper,metastore,spark,oozie,indexer
4 启动
直接启动
# build/env/bin/hue runcherrypyserver
后台启动supervisor(supervisor会监控并启动hue server)
# nohup build/env/bin/supervisor start >> logs/hue.out 2>&1 &
日志位于 /usr/local/hue/logs/ 下
三 使用

如果hue使用nginx代理,一定要设置Host,否则会报400错误:
location / {
proxy_pass http://hue_backend;
proxy_set_header Host hue.anything;
}
另外还可以使用nginx来管理hue的静态文件,加速访问;
参考:https://blog.csdn.net/zhouyuanlinli/article/details/83374416
【原创】大数据基础之Ambari(5)通过Ambari部署Hue的更多相关文章
- 大数据基础环境--jdk1.8环境安装部署
1.环境说明 1.1.机器配置说明 本次集群环境为三台linux系统机器,具体信息如下: 主机名称 IP地址 操作系统 hadoop1 10.0.0.20 CentOS Linux release 7 ...
- 【原创】大数据基础之Zookeeper(2)源代码解析
核心枚举 public enum ServerState { LOOKING, FOLLOWING, LEADING, OBSERVING; } zookeeper服务器状态:刚启动LOOKING,f ...
- 【原创】大数据基础之Ambari(1)简介、编译安装、使用
官方:http://ambari.apache.org/ The Apache Ambari project is aimed at making Hadoop management simpler ...
- 【原创】大数据基础之Impala(1)简介、安装、使用
impala2.12 官方:http://impala.apache.org/ 一 简介 Apache Impala is the open source, native analytic datab ...
- 【原创】大数据基础之词频统计Word Count
对文件进行词频统计,是一个大数据领域的hello word级别的应用,来看下实现有多简单: 1 Linux单机处理 egrep -o "\b[[:alpha:]]+\b" test ...
- 【原创】大数据基础之Benchmark(2)TPC-DS
tpc 官方:http://www.tpc.org/ 一 简介 The TPC is a non-profit corporation founded to define transaction pr ...
- 大数据基础知识问答----hadoop篇
handoop相关知识点 1.Hadoop是什么? Hadoop是一个由Apache基金会所开发的分布式系统基础架构.用户可以在不了解分布式底层细节的情况下,开发分布式程序.充分利用集群的威力进行高速 ...
- 大数据基础知识:分布式计算、服务器集群[zz]
大数据中的数据量非常巨大,达到了PB级别.而且这庞大的数据之中,不仅仅包括结构化数据(如数字.符号等数据),还包括非结构化数据(如文本.图像.声音.视频等数据).这使得大数据的存储,管理和处理很难利用 ...
- 大数据基础知识问答----spark篇,大数据生态圈
Spark相关知识点 1.Spark基础知识 1.Spark是什么? UCBerkeley AMPlab所开源的类HadoopMapReduce的通用的并行计算框架 dfsSpark基于mapredu ...
- 学习大数据基础框架hadoop需要什么基础
什么是大数据?进入本世纪以来,尤其是2010年之后,随着互联网特别是移动互联网的发展,数据的增长呈爆炸趋势,已经很难估计全世界的电子设备中存储的数据到底有多少,描述数据系统的数据量的计量单位从MB(1 ...
随机推荐
- 阿里面试题BIO和NIO数量问题附答案和代码
一.问题 BIO 和 NIO 作为 Server 端,当建立了 10 个连接时,分别产生多少个线程? 答案: 因为传统的 IO 也就是 BIO 是同步线程堵塞的,所以每个连接都要分配一个专用线程来处理 ...
- java基础-开发工具IDEA
常用快捷键 查找 查找:Ctrl + F Find In Path: Ctrl + F + Shift (比普通查找多了一个shift) Search EveryWhere : 双击Shift 视图 ...
- jdbc,mybatis,hibernate各自优缺点及区别
先比较下jdbc编程和hibernate编程各自的优缺点. JDBC: 我们平时使用jdbc进行编程,大致需要下面几个步骤: 1,使用jdbc编程需要连接数据库,注册驱动和数据库信息 ...
- Mac之lnmp环境搭建
之前在Windows上开发大部分都是使用的集成环境(xampp,phpstudy,wamp),可以完成日常便捷开发,有些时候却Windows下无法实现的就需要自己搭建虚拟机,在虚拟机中搭建lnmp环境 ...
- k8s简单的来部署一下tomcat,并测试自愈功能
前言: 2018年12月6日 今天终于把k8s运行tomcat打通了,耗了我几天时间一个一个坑踩过来,不容易啊,废话不多说. 先记录一些操作时的错误: <<<<<< ...
- ThreadPoolExecutor 中的 shutdown() 、awaitTermination() 、 shutdownNow() 的用法
shutdown和awaitTermination为接口ExecutorService定义的两个方法,一般情况配合使用来关闭线程池. 方法简介shutdown方法:将线程池状态置为SHUTDOWN.平 ...
- [转载:Q1mi]Bootstrap和基于Bootstrap的登录验证示例
转载自:Q1mi Bootstrap介绍 Bootstrap是Twitter开源的基于HTML.CSS.JavaScript的前端框架. 它是为实现快速开发Web应用程序而设计的一套前端工具包. 它支 ...
- (二)Qt窗口应用程序Widget
QMainWindow,QWidget,QDialog,这三基类都可以作为顶层窗口 QWidget:是所有窗口类的父类,功能最简单 QMainWindow:如果窗口需要菜单栏,工具栏,状态栏,就需要Q ...
- Cucumber使用中问题
1.cucumber自动化执行提示chrome使用不支持的命令标记 --ignore-certificate-errors 大概问题是chrome版本和chrmedriver版本不对应 2." ...
- 教你如何写出高效整洁的 css 代码——css优化(转载)
css 写起来并不难,但在大型项目中,就变得难以管理,特别是不同的人在 css 书写风格上稍有不同,团队上就更加难以沟通,为此总结了一些如何实现高效整洁的 css 代码原则. css 优化的原则 1. ...