当前位置:   article > 正文

[HDFS]FileSystem.copyToLocalFile下载文件报错Unable to load native-hadoop library for your platform..._the short-circuit local reads feature cannot be us

the short-circuit local reads feature cannot be used because libhadoop canno

应用在服务器上启动后,从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>

重启应用,错误没了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/851351
推荐阅读
相关标签
  

闽ICP备14008679号