Hue官方网站:https://gethue.com/
HUE官方用户手册:https://docs.gethue.com/
官方安装文档:https://docs.gethue.com/administrator/installation/install/
HUE下载地址:https://docs.gethue.com/releases/
Hue的安装并不是那么简单,官方并没有编译好的软件包,需要从github上下载源码、安装依赖、编译安装。以下详细讲解Hue下载、编译、安装的操作过程。
安装Hue的节点上最好没有安装过MySQL,否则可能有版本冲突,这里选择将Hue安装在 linux122 上。
-
下载软件包、上传、解压(hue-release-4.3.0.zip、apache-maven-3.6.3-bin.tar.gz)
yum install unzip # 解压hue unzip hue-release-4.3.0.zip # 解压maven tar -zxvf apache-maven-3.6.3-bin.tar.gz -C ../servers/
-
安装依赖包
# 需要Python支持(Python 2.7+ / Python 3.5+) python --version # 在 CentOS 系统中安装编译 Hue 需要的依赖库 yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi yum install cyrus-sasl-plain gcc gcc-c++ krb5-devel libffi-devel libxml2-devel libxslt-devel yum install cyrus-sasl-plain gcc gcc-c++ krb5-devel libffi-devel libxml2-devel libxslt-devel yum install sqlite-devel gmp-devel yum install -y rsync
备注:
以上依赖仅适用CentOS/RHEL 7.X,其他情况请参考https://docs.gethue.com/administrator/installation/dependencies/
安装Hue的节点上最好没有安装过MySQL,否则可能有版本冲突
安装过程中需要联网,网络不好会有各种奇怪的问题 -
安装maven
编译 Hue 还需要 Maven 环境,因此在编译前需要安装 Maven。
下载 apache-maven-3.6.3-bin.tar.gz,上传虚拟机解压缩,添加环境变量vi /etc/profile # 添加环境变量 export MAVEN_HOME=/opt/servers/apache-maven-3.6.3 export PATH=$PATH:$MAVEN_HOME/bin source /etc/profile # 验证安装 mvn --version
-
hue编译
# 进入 hue 源码目录,进行编译。 使用 PREFIX 指定安装 Hue 的路径 cd /opt/software/hue-release-4.3.0 PREFIX=/opt/servers make install cd /opt/servers # 如果想把HUE从移动到另外一个地方,由于HUE使用了Python包的一些绝对路径,移动之后则必须执行以下命令: # 这里不要执行 rm app.reg rm -r build make apps
备注:这一步持续的时间比较长,还会从网上下载 jar;需要联网
-
修改hadoop配置
在 hdfs-site.xml 中增加配置
<!-- HUE --> <property> <name>dfs.webhdfs.enabled</name> <value>true</value> </property> <property> <name>dfs.permissions.enabled</name> <value>false</value> </property>
在 core-site.xml 中增加配置
<!-- HUE --> <property> <name>hadoop.proxyuser.hue.hosts</name> <value>*</value> </property> <property> <name>hadoop.proxyuser.hue.groups</name> <value>*</value> </property> <property> <name>hadoop.proxyuser.hdfs.hosts</name> <value>*</value> </property> <property> <name>hadoop.proxyuser.hdfs.groups</name> <value>*</value> </property>
增加 httpfs-site.xml 文件,加入配置
<configuration> <!-- HUE --> <property> <name>httpfs.proxyuser.hue.hosts</name> <value>*</value> </property> <property> <name>httpfs.proxyuser.hue.groups</name> <value>*</value> </property> </configuration>
备注:修改完HDFS相关配置后,需要把配置scp给集群中每台机器,重启hdfs服务。
-
修改hue配置
# 进入 Hue 安装目录 cd /opt/servers/hue # 进入配置目录 cd desktop/conf # 复制一份HUE的配置文件,并修改复制的配置文件 cp pseudo-distributed.ini.tmpl pseudo-distributed.ini vi pseudo-distributed.ini # [desktop] http_host=linux122 http_port=8000 is_hue_4=true time_zone=Asia/Shanghai dev=true server_user=hue server_group=hue default_user=hue # 211行左右。禁用solr,规避报错 app_blacklist=search # [[database]]。Hue默认使用SQLite数据库记录相关元数据,替换为mysql engine=mysql host=linux123 port=3306 user=hive password=12345678 name=hue # 1003行左右,Hadoop配置文件的路径 hadoop_conf_dir=/opt/servers/hadoop-2.9.2/etc/hadoop
# 在mysql中创建数据库hue,用来存放元数据 mysql -uhive -p12345678 mysql> create database hue; # 初始化数据库 build/env/bin/hue syncdb build/env/bin/hue migrate # 检查数据
-
启动hue服务
# 增加 hue 用户和用户组 groupadd hue useradd -g hue hue # 在hue安装路径下执行 build/env/bin/supervisor
在浏览器中输入:linux122:8000,可以Hue画面,说明安装成功。
第一次访问的时候,需要设置超级管理员用户和密码。记住它(hue/123456)。