首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >fs.hdfs.hadoopconf在flink-flink.flink中的用途

fs.hdfs.hadoopconf在flink-flink.flink中的用途
EN

Stack Overflow用户
提问于 2016-07-13 01:47:48
回答 1查看 2.5K关注 0票数 3

新手到弗林克。

我能够在远程hdfs集群中的文件上运行示例wordcount.jar,而无需在flink中声明fs.hdfs.hadoopconf变量。

所以想知道上面提到的变量的目的到底是什么。

声明它是否改变了运行示例jar的方式?

指挥:

代码语言:javascript
复制
flink-cluster.vm ~]$ /opt/flink/bin/flink run  /opt/flink/examples/batch/WordCount.jar --input hdfs://hadoop-master:9000/tmp/test-events

输出:

代码语言:javascript
复制
.......
07/13/2016 00:50:13 Job execution switched to status FINISHED.
(foo,1)
.....
(bar,1)
(one,1)

设置:

  • HDFS上的远程hdfs集群://hadoop-master.vm. on :9000
  • 在Flink上运行的flink集群. on

谢谢

更新

正如Serhiy所指出的,在conf中声明了fs.hdfs.hadoopconf,但是在运行带有更新参数的作业时,hdfs:///tmp/test-events.1468374669125得到了以下错误

flink-conf.yaml

代码语言:javascript
复制
# You can also directly specify the paths to hdfs-default.xml and hdfs-site.xml
# via keys 'fs.hdfs.hdfsdefault' and 'fs.hdfs.hdfssite'.
#
fs.hdfs.hadoopconf: hdfs://hadoop-master:9000/
fs.hdfs.hdfsdefault :  hdfs://hadoop-master:9000/

指挥:

代码语言:javascript
复制
flink-cluster.vm ~]$ /opt/flink/bin/flink run  /opt/flink/examples/batch/WordCount.jar --input hdfs:///tmp/test-events

产出:

代码语言:javascript
复制
Caused by: org.apache.flink.runtime.JobException: Creating the input splits caused an error: The given HDFS file URI (hdfs:///tmp/test-events.1468374669125) did not describe the HDFS NameNode. The attempt to use a default HDFS configuration, as specified in the 'fs.hdfs.hdfsdefault' or 'fs.hdfs.hdfssite' config parameter failed due to the following problem: Either no default file system was registered, or the provided configuration contains no valid authority component (fs.default.name or fs.defaultFS) describing the (hdfs namenode) host and port.
    at org.apache.flink.runtime.executiongraph.ExecutionJobVertex.<init>(ExecutionJobVertex.java:172)
    at org.apache.flink.runtime.executiongraph.ExecutionGraph.attachJobGraph(ExecutionGraph.java:679)
    at org.apache.flink.runtime.jobmanager.JobManager.org$apache$flink$runtime$jobmanager$JobManager$$submitJob(JobManager.scala:1026)
    ... 19 more
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-07-13 07:06:30

来自文档

fs.hdfs.hadoopconf:通往Hadoop的配置目录(可选值)的绝对路径。指定此值允许程序使用短URI (hdfs:///path/to/files,而不包括文件URI中的NameNode地址和端口)引用HDFS文件。如果没有此选项,则可以访问HDFS文件,但需要像hdfs://address:port/path/to/files这样的完全限定URI。此选项还会导致文件编写器获取HDFS块大小和复制因子的默认值。Flink将在指定的目录中查找“core-site.xml”和“hdfs-site.xml”文件。

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

https://stackoverflow.com/questions/38341401

复制
相关文章

相似问题

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