启动apache flume时的nullpointerexception

时间:2015-10-13 20:05:44

标签: apache hadoop nullpointerexception flume

我正在试图运行水槽而且我得到了nullpointerexception:

  

的.jar:在/ usr /本地/ hadoop的/的libexec /../ LIB /口 - 2.0.8.jar:在/ usr /本地/ hadoop的/的libexec /../ LIB / servlet的API-2.5-20081211。罐子:在/ usr /本地/ Hadoop的/ libexec目录/../ LIB / xmlenc-0.52.jar:在/ usr /本地/ Hadoop的/ libexec目录/../ LIB / JSP-2.1 / JSP-2.1.jar:在/ usr /本地/hadoop/libexec/../lib/jsp-2.1/jsp-api-2.1.jar:/home/training/Downloads/hive-0.10.0/lib/*'   -Djava.library.path =:在/ usr /本地/ Hadoop的/ libexec目录/../ lib中/本地/ Linux的i386-32   org.apache.flume.node.Application --name agent SLF4J:类路径   包含多个SLF4J绑定。 SLF4J:发现绑定   [JAR:文件:/home/training/Downloads/apache-flume-1.6.0-bin/lib/slf4j-log4j12-1.6.1.jar /org/slf4j/impl/StaticLoggerBinder.class]   SLF4J:发现绑定   [JAR:文件:/home/training/Downloads/hive-0.10.0/lib/slf4j-log4j12-1.6.1.jar /org/slf4j/impl/StaticLoggerBinder.class]   SLF4J:请参阅http://www.slf4j.org/codes.html#multiple_bindings   说明。 15/10/13 05:47:28 ERROR node.Application:致命错误   跑步时发生。以下是例外情况。   java.io.File上的java.lang.NullPointerException。(File.java:251)   在org.apache.flume.node.Application.main(Application.java:302)

     

我曾经开始使用的命令如下:

水槽:

  

./ flume-ng agent --conf   /home/training/Downloads/apache-flume-1.6.0-bin/conf/flume-conf.properties.template   --name agent

     

水槽配置文件如下:

     

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

     

agent.sources.seqGenSrc.type = exec ag​​ent.sources.seqGenSrc.command = tail   -F /home/training/Desktop/log.txt agent.sources.seqGenSrc.channels = memoryChannel   agent.sinks.loggerSink.type =记录器   agent.sinks.loggerSink.channel = memoryChannel   agent.channels.memoryChannel.type =存储器   agent.channels.memoryChannel.capacity = 100

     

agent.sinks.loggerSink.type = HDFS   agent.sinks.loggerSink.hdfs.path = HDFS://本地主机:54310 /用户/训练/日志   agent.sinks.loggerSink.hdfs.fileType =的数据流中

你可以告诉我我错过了什么 提前感谢您的回复。

1 个答案:

答案 0 :(得分:0)

我注意到两件事:

  1. 在命令中使用--conf参数,但省略--conf-file参数。例如,我开始像这样说:
  2. ./bin/flume-ng agent -Dflume.root.logger=INFO,console --conf ./conf --conf-file ./conf/test.conf --name agent

    1. 在您的配置中,您首先将接收器的类型设置为loggerSink,然后将接收器的类型设置为hdfs。我不认为设置水槽的类型两次是你想要的(或Flume想要的)。
    2. 顺便说一下,我重新格式化了你的配置:

      agent.sources=seqGenSrc
      agent.channels=memoryChannel
      agent.sinks=loggerSink
      
      agent.sources.seqGenSrc.type=exec
      agent.sources.seqGenSrc.command=tail -F /home/training/Desktop/log.txt
      agent.sources.seqGenSrc.channels=memoryChannel
      agent.sinks.loggerSink.type=logger
      agent.sinks.loggerSink.channel=memoryChannel
      agent.channels.memoryChannel.type=memory
      agent.channels.memoryChannel.capacity=100
      
      agent.sinks.loggerSink.type=hdfs
      agent.sinks.loggerSink.hdfs.path=hdfs://localhost:54310/user/training/logs
      agent.sinks.loggerSink.hdfs.fileType=DataStream