找不到使用flume在hdfs中写入的数据

rn0zuynd  于 2021-06-02  发布在  Hadoop
关注(0)|答案(2)|浏览(332)

我正在尝试用flume在hdfs中写入数据。这是我的flume代理配置:

a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source

a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 41414

# Describe the sink

a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path = /etc/flume/conf/Data
a1.sinks.k1.hdfs.callTimeout = 150000
a1.sinks.k1.hdfs.fileType = DataStream
a1.sinks.k1.hdfs.writeFormat = Text
a1.sinks.k1.hdfs.rollSize = 0
a1.sinks.k1.hdfs.rollCount = 10000
a1.sinks.k1.hdfs.rollInterval = 600

# Use a channel which buffers events in memory

a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel

a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

每件事都正确启动,我启动telnet命令在我的端口上写。每次输入后,我都会从启动代理的窗口中收到以下消息:

16/03/23 10:19:16 INFO hdfs.BucketWriter: Creating /etc/flume  /conf/FlumeData/FlumeData.1458728356159.tmp
16/03/23 10:29:17 INFO hdfs.BucketWriter: Closing /etc/flume/conf/FlumeData/FlumeData.1458728356159.tmp
16/03/23 10:29:17 INFO hdfs.BucketWriter: Renaming /etc/flume/conf/FlumeData/FlumeData.1458728356159.tmp to /etc/flume/conf/FlumeData/FlumeData.145

一切看起来都是正确的,但是,我有一个问题,当我通过我的文件系统,我找不到已经写的文件,他们只是不存在。有人能帮我吗?谢谢你抽出时间来读这篇文章,如果我的英语不太好,我很抱歉。

mcdcgff0

mcdcgff01#

使用完整的hdfsuri可以解决您的问题。
试试这个:

a1.sinks.k1.hdfs.path = hdfs://namenode_hostname:port/etc/flume/conf/Data
yiytaume

yiytaume2#

我想你可以试着这样写,试试这个代码:

a1.sinks.k1.hdfs.path = hdfs://namenode_hostname:port/etc/flume/conf/Data

相关问题