Hue整合HDFS

Hue安裝

關於Hue的編譯和安裝詳見我的另一片博客:https://blog.csdn.net/DataIntel_XiAn/article/details/103543368

 

配置hadoop

hdfs-site.xml

	<!-- Enable WebHDFS (REST API) in Namenodes and Datanodes. -->
	<property>
		<name>dfs.webhdfs.enabled</name>
		<value>true</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>

	<!-- 任意節點使用hadoop集羣的代理用戶hadoop都能訪問hdfs集羣 -->
	<property>
		<name>hadoop.proxyuser.hadoop.hosts</name>
		<value>*</value>
	</property>
	<!-- 代理用戶的組所屬 -->
	<property>
		<name>hadoop.proxyuser.hadoop.groups</name>
		<value>*</value>
	</property>

httpfs-site.xml

	<property>
		<name>httpfs.proxyuser.hue.hosts</name>
		<value>*</value>
	</property>
	<property>
		<name>httpfs.proxyuser.hue.groups</name>
		<value>*</value>
	</property>

 

配置Hue

[hadoop]
	fs_defaultfs=hdfs://hadoop:8020
	webhdfs_url=http://hadoop:50070/webhdfs/v1
	hadoop_conf_dir=/home/hadoop/hadoop/etc/hadoop

 

啓動測試

除了正常啓動集羣意外還需要啓動(httpfs.sh start

用戶權限問題

Cannot access: /user/hadoop. Note: you are a Hue admin but not a HDFS superuser, "hdfs" or part of HDFS supergroup, "supergroup".

403 Client Error: Forbidden for url: http://hadoop:50070/webhdfs/v1/user/hadoop?op=GETFILESTATUS&user.name=hue&doas=hadoop {"RemoteException":{"exception":"SecurityException","javaClassName":"java.lang.SecurityException","message":"Failed to obtain user group information: org.apache.hadoop.security.authorize.AuthorizationException: User: hue is not allowed to impersonate hadoop"}} (error 403) 

需要修改配置文件的默認超級用戶,然後重啓

  # This should be the hadoop cluster admin
   default_hdfs_superuser=hadoop

再次登錄,查看HDFS發現已經正常,至此Hue整合HDFS已經成功!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章