简体   繁体   中英

Apache Flume spoolDirectory configuration is failing

I am using the following code to write the files in my source directory to 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

But I am getting the following error

: Failed to configure component! org.apache.flume.conf.ConfigurationException: Failed to configure component! at org.apache.flume.conf.source.SourceConfiguration.configure(SourceConfigurati on.java:110) at org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.validateSources( FlumeConfiguration.java:566) at org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.isValid(FlumeCon figuration.java:345) at org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.access$000(Flume Configuration.java:212) at org.apache.flume.conf.FlumeConfiguration.validateConfiguration(FlumeConfigur ation.java:126) at org.apache.flume.conf.FlumeConfiguration.(FlumeConfiguration.java:108) at org.apache.flume.node.PropertiesFileConfigurationProvider.getFlumeConfigurat ion(PropertiesFileConfigurationProvider.java:193) at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(Abstrac tConfigurationProvider.java:94) at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcher Runnable.run(PollingPropertiesFileConfigurationProvider.java:140) at java.util.concurrent.Executors$R unnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$ 301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Sch eduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11 42) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6 17) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.flume.conf.ConfigurationException: No channels set for test at org.apache.flume.conf.source.SourceConfiguration.configure(SourceConfigurati on.java:68) ... 15 more

Can anyone help what should I do to put my data from the source directory /Data to hdfs directory /user/team?

Stack Trace mention:

No channels set for test 

You have a specified sources as test

agent.sources = test

But while connecting it to channel

agent.sources.TwitterExampleDir.channels = memoryChannel

so you have to mention test instead of TwitterExampleDir

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM