简体   繁体   English

如何在cloudera中获取文件夹的路径?

[英]How to get a path of a folder in cloudera?

Im trying to run a my code in java using hadoop but I get an error of the path of the file 我试图使用hadoop在java中运行我的代码,但是我得到了文件路径的错误

 scanner1 = new Scanner(new File("/home/cloudera/pos.txt")); //Path

The error message that I get is: 我得到的错误消息是:

Status : FAILED java.io.FileNotFoundException: /home/cloudera/pos.txt (Permission denied)

The "Permission denied" in the error message indicates you don't have read access to the directory. 错误消息中的“权限被拒绝”表示您没有该目录的读取权限。 Which user is running the java code, your personal user or the cloudera? 哪个用户正在运行java代码,您的个人用户还是cloudera? To fix, you should either make the data readable for your user, move it to a common location that is globally readable, think /usr/local, or run your code as the cloudera user. 要解决此问题,您应该让数据对您的用户可读,将其移动到全局可读的公共位置,思考/ usr / local,或者将您的代码作为cloudera用户运行。 Also, is this in HDFS or on the local filesystem? 另外,这是在HDFS还是在本地文件系统上?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM