【问题标题】:Apache Flume spoolDirectory configuration is failingApache Flume spoolDirectory 配置失败
【发布时间】:2016-05-26 15:52:38
【问题描述】:

我正在使用以下代码将源目录中的文件写入 hdfs。

  # Initialize agent's source, channel and sink
agent.sources = test
agent.channels = memoryChannel
agent.sinks = flumeHDFS

# Setting the source to spool directory where the file exists
agent.sources.test.type = spooldir
agent.sources.test.spoolDir = /Data

# Setting the channel to memory
agent.channels.memoryChannel.type = memory
# Max number of events stored in the memory channel
agent.channels.memoryChannel.capacity = 10000
# agent.channels.memoryChannel.batchSize = 15000
agent.channels.memoryChannel.transactioncapacity = 1000000

# Setting the sink to HDFS
agent.sinks.flumeHDFS.type = hdfs
agent.sinks.flumeHDFS.hdfs.path = /user/team
agent.sinks.flumeHDFS.hdfs.fileType = DataStream

# Write format can be text or writable
agent.sinks.flumeHDFS.hdfs.writeFormat = Text

# use a single csv file at a time
agent.sinks.flumeHDFS.hdfs.maxOpenFiles = 1

# rollover file based on maximum size of 10 MB
agent.sinks.flumeHDFS.hdfs.rollCount=0
agent.sinks.flumeHDFS.hdfs.rollInterval=2000
agent.sinks.flumeHDFS.hdfs.rollSize = 0
agent.sinks.flumeHDFS.hdfs.batchSize =1000000

# never rollover based on the number of events
agent.sinks.flumeHDFS.hdfs.rollCount = 0

# rollover file based on max time of 1 min
#agent.sinks.flumeHDFS.hdfs.rollInterval = 0
# agent.sinks.flumeHDFS.hdfs.idleTimeout = 600

# Connect source and sink with channel
agent.sources.TwitterExampleDir.channels = memoryChannel
agent.sinks.flumeHDFS.channel = memoryChannel

但我收到以下错误

: 配置组件失败! org.apache.flume.conf.ConfigurationException:配置失败 零件! 在 org.apache.flume.conf.source.SourceConfiguration.configure(SourceConfigurati on.java:110) 在 org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.validateSources( FlumeConfiguration.java:566) 在 org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.isValid(FlumeCon figuration.java:345) 在 org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.access$000(Flume 配置.java:212) 在 org.apache.flume.conf.FlumeConfiguration.validateConfiguration(FlumeConfigur ation.java:126) 在 org.apache.flume.conf.FlumeConfiguration.(FlumeConfiguration.java:108) 在 org.apache.flume.node.PropertiesFileConfigurationProvider.getFlumeConfigurat 离子(PropertiesFileConfigurationProvider.java:193) 在 org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(Abstract tConfigurationProvider.java:94) 在 org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcher Runnable.run(PollingPropertiesFileConfigurationProvider.java:140) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 在 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$ 301(计划线程池执行程序.java:180) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Sch eduledThreadPoolExecutor.java:294) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11 42) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6 17) 在 java.lang.Thread.run(Thread.java:745) 引起:org.apache.flume.conf.ConfigurationException:没有为测试设置通道 在 org.apache.flume.conf.source.SourceConfiguration.configure(SourceConfigurati on.java:68) ... 15 更多

谁能帮我把我的数据从源目录/Data放到hdfs目录/user/team?

【问题讨论】:

    标签: hadoop flume flume-ng


    【解决方案1】:

    堆栈跟踪提及:

    No channels set for test 
    

    您将sources 指定为test

    agent.sources = test
    

    但是在连接到channel

    agent.sources.TwitterExampleDir.channels = memoryChannel
    

    所以你必须提到test 而不是TwitterExampleDir

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-17
      • 2015-12-03
      • 1970-01-01
      • 1970-01-01
      • 2021-06-28
      • 1970-01-01
      相关资源
      最近更新 更多