【原创】大数据基础之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 ...
随机推荐
- C#调用Delphi DLL获取字符串(C# IntPtr 与 string互转 )
前因后果 调用一门锁的dll实现读取酒店IC卡数据,直接用Readme里的方法出错. 函数声明: 一.读卡函数 ************************ Delphi 调用 ****** ...
- openstack第四章:neutron— 网络服务
第四篇neutron— 网络服务 一.neutron 介绍: Neutron 概述 传统的网络管理方式很大程度上依赖于管理员手工配置和维护各种网络硬件设备:而云环境下的网络已经变得非常复杂,特别是 ...
- linux 下一些命令
1. 后台执行命令 nohup http://blog.csdn.net/liuyanfeier/article/details/62422742 2. 查看日志文件 格式:tailf logfil ...
- YCD 软件更新方法
备份Messenger的数据库和Player的Chainmail数据 Upgrade process in Cnario is quite simple, uninstall old version ...
- "unexpected console statement” in Node.js
.eslintrc.js module.exports = { rules: { 'no-console': 'off', }, };
- python 基本数据类型以及运算符操作
一.基本数据类型 为何要区分类型? 数据类型的值是变量值得类型,变量值之所以区分类型,是因为变量的值 用来记录事物的状态,而事物的状态有不同的种类,对应着,也必须用不 用类型去区分它们. 1.数字类型 ...
- vhdl 数据类型转换 使用IEEE标准库numeric_std 需要进行两次转换 use ieee.numeric_std.all;
use ieee.numeric_std.all;
- Web框架的原理和Django初识
一.Web框架的本质 1.本质 实际上Web应用本质上就是一个socket服务端, 而用户的浏览器就是一个socket客户端. 2.最原始的web框架 socket服务端 import socket ...
- [BZOJ 4818] [SDOI 2017] 序列计数
Description Alice想要得到一个长度为 \(n\) 的序列,序列中的数都是不超过 \(m\) 的正整数,而且这 \(n\) 个数的和是 \(p\) 的倍数. Alice还希望,这 \(n ...
- 洛谷P1220关路灯题解
题目 此题是一个状态转移方程还算比较多的一个区间DP,这个题也能启示我们如果某个状态不能够很好地解决问题,那么不妨试试再加一维,而且如果转移顺序不确定的话,可以试试记忆化搜索,说不定就可以比较容易的写 ...