Mac 开发 Hue

1)环境准备

Maven 3.6.1

python (Anaconda 2.7.16)

MySQL 5.7

git 2.21

 

2)Hue源码下载

git clone git@github.com:arwangasdaf/arwangasdaf.github.io.git 

 

3)编译

1、到hue下执行 make apps

此时可能会遇到到bug有:

 

- 无法找到python.h文件

解决办法:修改 Makefile.vars 文件

 在这里我是修改了默认的python路径到Anaconda下的python下

 

- 找不到openssl 

解决办法:

brew upgrade openssl

export CPPFLAGS=-I/usr/local/opt/openssl/include

export LDFLAGS=-L/usr/local/opt/openssl/lib

 

- 找不到sasl.h

解决办法:

执行

export CFLAGS="-I$(xcrun --show-sdk-path)/usr/include/sasl"

pip install python-ldap

 

- 找不到mysql的config

修改mysql_config的路径

 

4)MySQL初始化

Hue默认以自带的sqlite数据库保存元数据,但是不适合开发环境,在这里需要使用MySQL来替代默认的sqlite数据库

 

- MySQL新建Hue表和Hue用户

create database hue default character set utf8 default collate utf8_general_ci;

grant all on hue.* to 'hue'@'%' identified by 'hue';

grant all privileges on *.* to hue@localhost identified by 'hue' with grant option;

select * from information_schema.schemata;

flush privileges;

 

- Hue修改 pseudo-distributed.ini 文件

[[database]] 

  engine=mysql
  host=localhost
  port=3306
  user=hue
  password=hue
  name=hue

 

- 数据库迁移

在build/env下执行

bin/hue syncdb

bin/hue migrate

 

5)pycharm搭建Hue开发环境

- 在pycharm中打开Hue工程

 

- 在preference中选择Interpreter

这个地方一定要选择编译出来的build/env/bin下的python环境

 

- Django环境变量

 

- Edit configuration

点击run即可启动

 

6)选择sparkSql的Editor,修改 pseudo-distributed.ini 文件

[[[sparksql]]]

  name=SparkSql

  interface=hiveserver2

[spark]

   # Host of the Sql Server

   sql_server_host=host

   # Port of the Sql Server

   sql_server_port=10001

重启Hue即可完成功能

posted on 2019-06-06 21:10  扬礼  阅读(739)  评论(0编辑  收藏  举报

导航