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的更多相关文章

  1. 大数据基础环境--jdk1.8环境安装部署

    1.环境说明 1.1.机器配置说明 本次集群环境为三台linux系统机器,具体信息如下: 主机名称 IP地址 操作系统 hadoop1 10.0.0.20 CentOS Linux release 7 ...

  2. 【原创】大数据基础之Zookeeper(2)源代码解析

    核心枚举 public enum ServerState { LOOKING, FOLLOWING, LEADING, OBSERVING; } zookeeper服务器状态:刚启动LOOKING,f ...

  3. 【原创】大数据基础之Ambari(1)简介、编译安装、使用

    官方:http://ambari.apache.org/ The Apache Ambari project is aimed at making Hadoop management simpler ...

  4. 【原创】大数据基础之Impala(1)简介、安装、使用

    impala2.12 官方:http://impala.apache.org/ 一 简介 Apache Impala is the open source, native analytic datab ...

  5. 【原创】大数据基础之词频统计Word Count

    对文件进行词频统计,是一个大数据领域的hello word级别的应用,来看下实现有多简单: 1 Linux单机处理 egrep -o "\b[[:alpha:]]+\b" test ...

  6. 【原创】大数据基础之Benchmark(2)TPC-DS

    tpc 官方:http://www.tpc.org/ 一 简介 The TPC is a non-profit corporation founded to define transaction pr ...

  7. 大数据基础知识问答----hadoop篇

    handoop相关知识点 1.Hadoop是什么? Hadoop是一个由Apache基金会所开发的分布式系统基础架构.用户可以在不了解分布式底层细节的情况下,开发分布式程序.充分利用集群的威力进行高速 ...

  8. 大数据基础知识:分布式计算、服务器集群[zz]

    大数据中的数据量非常巨大,达到了PB级别.而且这庞大的数据之中,不仅仅包括结构化数据(如数字.符号等数据),还包括非结构化数据(如文本.图像.声音.视频等数据).这使得大数据的存储,管理和处理很难利用 ...

  9. 大数据基础知识问答----spark篇,大数据生态圈

    Spark相关知识点 1.Spark基础知识 1.Spark是什么? UCBerkeley AMPlab所开源的类HadoopMapReduce的通用的并行计算框架 dfsSpark基于mapredu ...

  10. 学习大数据基础框架hadoop需要什么基础

    什么是大数据?进入本世纪以来,尤其是2010年之后,随着互联网特别是移动互联网的发展,数据的增长呈爆炸趋势,已经很难估计全世界的电子设备中存储的数据到底有多少,描述数据系统的数据量的计量单位从MB(1 ...

随机推荐

  1. 小程序蓝牙BLE——自动连接设备(手环)

    了解小程序蓝牙API: /** *蓝牙API: * 1.初始化蓝牙(判断蓝牙是否可用):openBluetoothAdapter * 2.获取蓝牙设备状态(蓝牙是否打开):getBluetoothAd ...

  2. mysql-笔记--增删改查

    查看数据库:可以使用 show databases; 命令查看已经创建了哪些数据库 指定数据库:在登录后使用 use 语句指定, 命令: use 数据库名;要对一个数据库进行操作, 必须先选择该数据库 ...

  3. sgu438-The_Glorious_Karlutka_River

    Description SGU似乎死了... 题目搬到了Codeforces... Problem - 99999438 - Codeforces Solution 动态最大流. 考虑如果不求时间, ...

  4. ORM基础之ORM介绍和基础操作

    一.ORM介绍 1.ORM概念 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据库存在的互不匹配的现象的技术. 简单的说,ORM是通过 ...

  5. 初识服务器和Linux

    一.什么是计算机 1.介绍 一说到计算机,我们首先想到的就是电脑,没错,电脑就是计算机,但是计算机不只是电脑. 所谓的电脑就是一种计算机,而计算机其实是:接收使用者输入的指令与资料,经中央处理器的数学 ...

  6. 【XSY2962】作业 数学

    题目描述 有一个递推式: \[ \begin{align} f_0&=1-\frac{1}{e}\\ f_n&=1-nf_{i-1} \end{align} \] 求 \(f_n\) ...

  7. zabbix误报交换机重启

    交换机的sysUpTime是由一个32-bit的counter来计数的,单位是0.01秒,所以最大时间为496天,过了496天就溢出,变成0,然后又重新计算时间,所以zabbix误报. snmpwal ...

  8. Linux系统初始化配置项(centos7)

    主机刚安装完系统,会做一些配置上的优化. 修改时区 通过命令将时区设置为亚洲/上海. timedatectl set-timezone Asia/Shanghai #centos7 cp /usr/s ...

  9. VMware下安装linux虚拟机

    安装VMware [下一步] [下一步] 点击[自定义],[下一步] 更改安装目录,[下一步] [下一步] [下一步] [跳过] [完成] 点击桌面图标 如下勾选,输入邮箱,[继续] [完成] 安装l ...

  10. CF618G(利用浮点数精度+矩乘优化DP)

    这题真的太神辣,%了一发题解,原来还能这么搞QWQ 设\(A_{i,j}\)表示不加任何限制时,第\(i\)个格子会出现权值为\(j\)的史莱姆的概率,则有: \[A_{i,j}=A_{i,j-1}* ...