接上篇我们继续:
一、配置Hue访问HDFS
外部系统访问HDFS只能使用httpfs的方式,不能使用HDFS默认自带的WebHdfs方式,但Ambari安
装的HDFS并没有默认安装hadoop-httpfs,所以这里需要先安装hadoop-httpfs
1. 安装hadoop-httpfs
yum install hadoop-httpfs
cd /etc/init.d
ln -s /usr/hdp/current/hadoop-httpfs/etc/rc.d/init.d/hadoop-httpfs hadoophttpfs
2. 配置hadoop-httpfs
/etc/hadoop-httpfs/conf
touch httpfs-site.xml
touch httpfs-signature.secret
vi httpfs-site.xml
<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
<property>
<name>httpfs.proxyuser.hue.hosts</name>
<value>*</value>
</property>
<property>
<name>httpfs.proxyuser.hue.groups</name>
<value>*</value>
</property>
</configuration>
vi httpfs-signature.secret
hadoop httpfs secret
3. 启动hadoop-httpfs
service hadoop-httpfs start
ps -ef | grep httpfs
lsof -i:14000
如果可以看到httpfs的进程且14000端口是开启的,则httpfs启动成功
4. 修改HDFS配置,登录Ambari平台,加入如下红框中的四个值,然后重启HDFS
5. 修改/opt/hue/hue-4.3.0/desktop/conf/hue.ini,找到[[hdfs_clusters]]位置,填写配置信息,如下
[[hdfs_clusters]]
# HA support by using HttpFs
[[[default]]]
# Enter the filesystem uri
fs_defaultfs=hdfs://vsmshdpcluster
# NameNode logical name.
## logical_name=
# Use WebHdfs/HttpFs as the communication mechanism.
# Domain should be the NameNode or HttpFs host.
# Default port is 14000 for HttpFs.
webhdfs_url=http://sosvsmshadoop1.ps.com:14000/webhdfs/v1
6. 重启Hue
End