2016-03-23 34 views
0

我想用Flume写入HDFS数据。 这是我的水槽代理配置:找不到我的数据写入hdfs与水槽

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 

Evetything正确启动和我启动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 

一切看起来正确的,但,我有一个问题,当我走线槽我的文件系统,我无法找到它具有文件被写了,他们根本不存在。有人可以帮助我吗? 感谢您花时间阅读本文,并对不起,如果我的英文不完美。

+0

如果您使用的是Windows,你怎么可以用这样'的/ etc /水槽路径/ conf/Data'? – Thanga

+0

对不起,我想说“窗口”不是windows。我在CentOs上使用hadoop –

+0

你能显示你的hdfs文件列表的截图吗? – Thanga

回答

0

使用完整的HDFS URI将解决您的问题。

试试这个:

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

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

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