首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Dataproc HDFS文件URI

Dataproc HDFS文件URI
EN

Stack Overflow用户
提问于 2021-09-27 15:25:28
回答 1查看 497关注 0票数 2

我有一个问题,如何获得路径/url的文件位于dataproc hdfs?我希望基于位于dataproc中的文件运行一个M/R作业。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-27 17:28:03

以下是Dataproc集群中所有有效的HDFS URI:

  1. hdfs://<master-hostname>:8020/<path-to-file>
  2. hdfs://<master-hostname>/<path-to-file>
  3. hdfs:///<path-to-file>

第三个可以工作,因为默认情况下,在Dataproc集群的每个节点中,fs.defaultFS属性在/etc/hadoop/conf/core-site.xml中被配置为hdfs://<master-hostname>8020是默认的NameNode端口。

代码语言:javascript
复制
  <property>
    <name>fs.defaultFS</name>
    <value>hdfs://<master-hostname></value>
    <description>
      The name of the default file system. A URI whose scheme and authority
      determine the FileSystem implementation. The uri's scheme determines
      the config property (fs.SCHEME.impl) naming the FileSystem
      implementation class. The uri's authority is used to determine the
      host, port, etc. for a filesystem.
    </description>
  </property>

您可以在任何节点上运行hadoop fs -ls <uri>来列出文件。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69349242

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档