如何确定hdfs dfs
命令连接的URI?
是否有存储URI的配置文件或者可以用于显示URI的命令?
我查看了FileSystemShell文档和dfsadmin文档,但没有找到相关信息。(同时,我无法访问大多数dfsadmin命令。)
当我使用hdfs:///user/myUserName/...
命令时,它会抛出异常:
Exception in thread "main" java.io.IOException: Incomplete HDFS URI, no host: hdfs:///user/myUserName/test.avro
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:136)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2591)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:89)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2625)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2607)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:368)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:296)
at org.apache.avro.mapred.FsInput.<init>(FsInput.java:38)
at org.apache.avro.tool.Util.openSeekableFromFS(Util.java:110)
at org.apache.avro.tool.DataFileGetSchemaTool.run(DataFileGetSchemaTool.java:47)
at org.apache.avro.tool.Main.run(Main.java:87)
at org.apache.avro.tool.Main.main(Main.java:76)
像hdfs dfs -ls
这样的简单命令可以正常工作。
使用Hadoop 3.1.0版本。
core-default
would typically always befile:///
. It is always recommended to setdefaultFS
iscore-site
- OneCricketeer