HUE -- 安装部署和测试

1. 安装前的准备

  1. 安装依赖
yum install asciidoc cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain gcc gcc-c++ \
krb5-devel libffi-devel libtidy libxml2-devel libxslt-devel make mysql mysql-devel \
openldap-devel python-devel sqlite-devel openssl-devel gmp-devel -y

2. 安装

  1. 上传tar报:hue-4.8.0.tgz
  2. 以非root登录并进入目录
  3. tar vf hue-4.8.0.tgz
  4. cd hue-4.8.0
  5. 系统需要python2.7+或者python3.6+的环境和nodejs环境,然后直接make apps(大概需要3-10分钟)

3. 修改配置

  1. 进入到desktop/conf目录下,找到hue.ini文件
  2. 修改hue.ini文件
#secret_key可以在官网找到
#https://docs.gethue.com/administrator/configuration/server/#specifying-the-secret-key
secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
http_host=xxx
http_port=8888
time_zone=Asia/Shanghai

4. 启动

  1. build/env/bin/supervisor
  2. 访问HUE服务主页:http://xxx:8888/
  3. 首次登录需要创建用户,且该用户既是最高权限用户

在这里插入图片描述

5. 集成

5.1 元数据信息集成mysql

  1. 先在mysql里面创建数据库hue
create database hue default character set utf8 default collate utf8_general_ci;

grant all on hue.* to 'hue'@'%' identified by 'admin'; 
-- 这里我使用了之前创建hue用户的密码admin
  1. 修改hue.ini(两个地方,一个database下,一个librdbms下)
    在这里插入图片描述
    在这里插入图片描述
  2. 初始化和迁移数据库
build/env/bin/hue syncdb
build/env/bin/hue migrate
  1. 重启即可

5.2 集成mysql数据源

  官网地址:https://docs.gethue.com/administrator/configuration/connectors/

  官网介绍,Except [impala] and [beeswax] which have a dedicated section, all the other ones should be appended below the [[interpreters]] of [notebook] e.g.:

即,除了impala和hive,其他的数据源都需要配置interpreters。

  1. 安装mysql-client
./build/env/bin/pip install mysqlclient
  1. 配置interpreters
[[[mysql]]]	
name=MySQL
interface=sqlalchemy
options='{"url": "mysql://root:root@localhost:3306/hue"}'
  1. 或者用jdbc的连接方式,则使用如下配置:
[[[mysqljdbc]]]
name=MySql JDBC
interface=jdbc
options='{"url": "jdbc:mysql://localhost:3306/hue", "driver": "com.mysql.jdbc.Driver", "user": "root", "password": "root"}'
  1. 重启服务

5.3 集成hive

  1. 配置hue.ini
[beeswax]
hive_server_host=localhost
hive_server_port=10000

5.4 集成clickhouse

  1. 安装sqlalchemy-clickhouse
./build/env/bin/pip install sqlalchemy-clickhouse
  1. 配置interpreters
[[[clickhouse]]]
name = Clickhouse
interface=sqlalchemy
options='{"url": "clickhouse://..."}'
  1. 或者用jdbc的连接方式,则使用如下配置:
[[[clickhouse]]]
name=ClickHouse
interface=jdbc
options='{"url": "jdbc:clickhouse://localhost:8123", "driver": "ru.yandex.clickhouse.ClickHouseDriver", "user": "readonly", "password": ""}'
  1. 重启服务

5.5 集成druid

  1. 安装pydruid
./build/env/bin/pip install pydruid
  1. 配置interpreters
[notebook]
[[interpreters]]
[[[druid]]]
name = Druid
interface=sqlalchemy
options='{"url": "druid://druid-host.com:8082/druid/v2/sql/?header=true"}'
  1. 重启服务
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值