赞
踩
应用在服务器上启动后,从HDFS下载文件失败,报错如下:
Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
The short-circuit local reads feature cannot be used because libhadoop cannot be loaded.
第一句提示不能加载Hadoop的库,检查库,提示hadoop命令不存在:
$ hadoop checknative -a
-bash: hadoop: command not found
检查集群发现,开发的应用属于myapp用户,而hadoop应用属于myhadoop用户,故不能短路本地读取HDFS
参考:HDFS 本地短路读取 Short-Circuit Local Reads_风筝Lee的博客-CSDN博客
在hdfs-site.xml中,找到 dfs.block.local-path-access ,增加myapp用户
<property>
<name>dfs.block.local-path-access.user</name>
<value>myhadoop,myapp</value>
</property>
重启应用,错误没了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。