1、错误如下所示,启动flume采集文件到hdfs案例的时候,出现如下所示的错误:
大概是说No channel configured for sink,所以应该是sink哪里配置出现了错误,百度了一下,然后检查了一下自己的配置:
// :: WARN conf.FlumeConfiguration: Could not configure sink sink1 due to: No channel configured for sink: sink1
org.apache.flume.conf.ConfigurationException: No channel configured for sink: sink1
at org.apache.flume.conf.sink.SinkConfiguration.configure(SinkConfiguration.java:)
at org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.validateSinks(FlumeConfiguration.java:)
at org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.isValid(FlumeConfiguration.java:)
at org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.access$(FlumeConfiguration.java:)
at org.apache.flume.conf.FlumeConfiguration.validateConfiguration(FlumeConfiguration.java:)
at org.apache.flume.conf.FlumeConfiguration.<init>(FlumeConfiguration.java:)
at org.apache.flume.node.PropertiesFileConfigurationProvider.getFlumeConfiguration(PropertiesFileConfigurationProvider.java:)
at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:)
at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$(ScheduledThreadPoolExecutor.java:)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
// :: INFO conf.FlumeConfiguration: Post-validation flume configuration contains configuration for agents: [agent1]
2、解决方法如下所示:
参考链接如https://*.com/questions/31798967/flume-could-not-configure-sink-no-channel-configured-for-sink
作者说应该是下面那种配置,一下子就明白了,自己的配置错误了,自己的如下所示:
修改以后,继续启动,解决问题。
[hadoop@slaver1 soft]$ flume-ng agent -n agent1 -c conf -f flume-1.5.0-cdh5.3.6-bin/conf/flume-conf.properties -Dflume.root.logger=DEBUG,console