1.预安装maven
下载并解压maven
配置maven环境变量
mvn -v测试maven
2.安装HUE依赖
yum install -y gcc libxml2-devel libxslt-devel mysql-devel python-devel python-setuptools python-simplejson sqlite-devel ant gmp-devel cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi libffi-devel libffi asciidoc ant gcc-c++ krb5-devel make mvn mysql openldap-devel
openssl-devel
3.下载hue(安装git)
git clone https://github.com/cloudera/hue.git
4.编译
cd hue/
make apps
等待漫长的编译完成
编译过程中可能会出现错误,基本都是依赖安装的不到位,根据错误提示重新安装相应依赖即可
5.修改配置文件:
vim desktop/conf/pseudo-distributed.ini
[desktop]
secret_key=allenzhang #任意值,越复杂越好,用来加密用的
http_host=192.168.204.111 #安装hue的机器
http_port=8000 #默认端口,可自定义
use_cherrypy_server= True #决定启动某个web服务
server_user=hue
server_group=hue
enable_server=yes
初次启动
# /opt/hue/build/env/bin/supervisor
启动后通过浏览器访问8000端口。
以下为报错解决:
error: command 'gcc' failed with exit status 1
make[2]: *** [/opt/hue/desktop/core/build/cryptography-1.3.1/egg.stamp] Error 1
make[2]: Leaving directory `/opt/hue/desktop/core'
make[1]: *** [.recursive-env-install/core] Error 2
make[1]: Leaving directory `/opt/hue/desktop'
make: *** [desktop] Error 2
缺少依赖:yum install gcc libffi-devel python-devel openssl-devel
前面已经安过的依赖,但是报错还是要重新安装一遍
-------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hue-plugins: Could not resolve dependencies for project com.cloudera.hue:hue-plugins:jar:3.12.0-SNAPSHOT: Could not transfer artifact org.apache.hadoop:hadoop-hdfs:jar:2.6.0-cdh5.5.0 from/to cdh.releases.repo (https://repository.cloudera.com/content/groups/cdh-releases-rcs): GET request of: org/apache/hadoop/hadoop-hdfs/2.6.0-cdh5.5.0/hadoop-hdfs-2.6.0-cdh5.5.0.jar from cdh.releases.repo failed: SSL peer shut down incorrectly -> [Help 1]
修改pom文件
#vim /opt/hue/maven/pom.xml
2.6.4
2.6.4
将hadoop-core修改为hadoop-common
hadoop-common
将hadoop-test的版本改为1.2.1
hadoop-test
1.2.1
删除两个ThriftJobTrackerPlugin.Java文件
# rm -rf /opt/hue/desktop/libs/hadoop/java/src/main/java/org/apache/hadoop/thriftfs/ThriftJobTrackerPlugin.java
# rm -rf /opt/hue/desktop/libs/hadoop/java/src/main/java/org/apache/hadoop/mapred/ThriftJobTrackerPlugin.java
----------------------------------------------------------
启动报错# build/env/bin/supervisor
KeyError: "Couldn't get user id for user hue"
增加hue用户:adduser hue
-----------------------------------------------
访问8000端口,报错OperationalError: attempt to write a readonly database
原因是 /opt/hue/desktop/desktop.db 只有读权限
# chmod +777 desktop.db 即可
再访问报错 OperationalError: unable to open database file
原因是包含desktop.db的文件夹对hue用户也是只能读不能写的
[root@hadoop01 hue]# chown -R hue:root *
启动成功