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 # 我们这里使用hue 3.11版本,手动下载v2.0.0 wget https://github.com/EsharEditor/ambari-hue-service/archive/v2.0.0.tar.gz mkdir -p /var/lib/ambari-server/resources/stacks/HDP/$VERSION/services/HUE tar xf v2.0.0.tar.gz -C /var/lib/ambari-server/resources/stacks/HDP/$VERSION/services/HUE rm -fr /usr/hdp/current/hadoop-client/lib/hue-plugins-3.11.0-SNAPSHOT.jar
重启ambari-server
1
ambari-server restart
通过Ambari安装Hue
On bottom left -> Actions -> Add service -> check Hue server -> Next -> Next -> Change any config you like (e.g. install dir, port) -> Next -> Deploy 数据库使用默认的SqlLite即可,改成postgresql未安装成功!
Q&A
Q1:编译报错信息:error: ffi.h: No such file or directory (HUE 3.10.0编译时报此错误)
A1:解决办法:yum -y install libssl-devel libffi-devel
Q2:启动运行报错:UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xef in position 166: ordinal not in range(128)
Q3: Hue提交Oozie任务,任务一直处于运行状态,Log日志报错信息如下:org.apache.oozie.action.ActionExecutorException: JA009: Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses
报错:The Spark session could not be created in the cluster: at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.mkdirs(ClientNamenodeProtocolTranslatorPB.java:558) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:252) at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:104) at com.sun.proxy.$Proxy28.mkdirs(Unknown Source) at org.apache.hadoop.hdfs.DFSClient.primitiveMkdir(DFSClient.java:3018) … 28 more A4: 解决办法:在hadoop的core-site.xml文件中添加spark用户的授权信息:
Hue中的报错信息: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs foundHiveserver2日志中的报错信息: ERROR [HiveServer2-Handler-Pool: Thread-31]: server.TThreadPoolServer (TThreadPoolServer.java:run(296)) - Error occurred during processing of message. java.lang.RuntimeException: org.apache.thrift.transport.TSaslTransportException: No data or no sasl data in the stream A5: 问题分析:Hue连接Hiveserver2使用的是Python,在Centos操作系统上丢失了一些依赖:cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi 解决办法:yum -y install cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi 设置以下配置像为NOSASL或None