2

***我想将一个文本文件从我的系统加载到 hdfs 中。

这是我的 conf 文件:

agent.sources = seqGenSrc
agent.sinks = loggerSink
agent.channels = memoryChannel

agent.sources.seqGenSrc.type = exec
agent.sources.seqGenSrc.command = tail -F my.system.IP/D:/salespeople.txt

agent.sinks.loggerSink.type = hdfs
agent.sinks.loggerSink.hdfs.path = hdfs://IP.address:port:user/flume
agent.sinks.loggerSink.hdfs.filePrefix = events-
agent.sinks.loggerSink.hdfs.round = true
agent.sinks.loggerSink.hdfs.roundValue = 10
agent.sinks.loggerSink.hdfs.roundUnit = minute

agent.channels.memoryChannel.type = memory
agent.channels.memoryChannel.capacity = 1000
agent.channels.memoryChannel.transactionCapacity = 100

agent.sources.seqGenSrc.channels = memoryChannel

agent.sinks.loggerSink.channel = memoryChannel

* *当我运行它时 .. 我得到关注 .. 然后它卡住了。

13/07/23 16:30:44 INFO nodemanager.DefaultLogicalNodeManager: Starting Channel memoryChannel
13/07/23 16:30:44 INFO nodemanager.DefaultLogicalNodeManager: Waiting for channel: 
memoryChannel to start. Sleeping for 500 ms
13/07/23 16:30:44 INFO nodemanager.DefaultLogicalNodeManager: Starting Sink loggerSink
13/07/23 16:30:44 INFO nodemanager.DefaultLogicalNodeManager: Starting Source seqGenSrc
13/07/23 16:30:44 INFO source.ExecSource: Exec source starting with command:tail -F 10.48.226.27/D:/salespeople.txt

* *我哪里错了,或者可能是什么错误?

4

1 回答 1

0

我假设您想将文件写入 /user/flume,因此您的路径应该是:
agent.sinks.loggerSink.hdfs.path = hdfs://IP.address:port/user/flume

当您的代理使用 tail -F 时,没有消息告诉您它已完成(因为它永远不会是 ^^)。如果您想知道您的文件是否已创建,您必须查看/user/flume文件夹。

我正在使用像您这样的配置,并且效果很好。您可以尝试使用
-Dflume.root.logger=INFO,console以获取更多信息吗?

于 2013-08-30T13:41:45.937 回答