gpt4 book ai didi

apache - 启动Apache槽时为nullpointerexception

转载 作者:行者123 更新时间:2023-12-02 21:34:45 24 4
gpt4 key购买 nike

我正在尝试运行水槽,并且我得到nullpointerexception:

.jar:/usr/local/hadoop/libexec/../lib/oro-2.0.8.jar:/usr/local/hadoop/libexec/../lib/servlet-api-2.5-20081211.jar:/usr/local/hadoop/libexec/../lib/xmlenc-0.52.jar:/usr/local/hadoop/libexec/../lib/jsp-2.1/jsp-2.1.jar:/usr/local/hadoop/libexec/../lib/jsp-2.1/jsp-api-2.1.jar:/home/training/Downloads/hive-0.10.0/lib/*' -Djava.library.path=:/usr/local/hadoop/libexec/../lib/native/Linux-i386-32 org.apache.flume.node.Application --name agent SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/training/Downloads/apache-flume-1.6.0-bin/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/training/Downloads/hive-0.10.0/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 15/10/13 05:47:28 ERROR node.Application: A fatal error occurred while running. Exception follows. java.lang.NullPointerException at java.io.File.(File.java:251) at 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

The flume config file is as follows:

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



你能让我知道我在想什么吗?
预先感谢您的回复。

最佳答案

我注意到两件事:

  • 在命令中,您使用--conf参数,但省略了--conf-file参数。例如,我像这样启动水槽:
  • ./bin/flume-ng agent -Dflume.root.logger=INFO,console --conf ./conf --conf-file ./conf/test.conf --name agent
  • 在配置中,首先将接收器的类型设置为loggerSink,然后将接收器的类型设置为hdfs。我认为您不需要(或Flume想要)两次设置接收器的类型。

  • 顺便说一句,我重新格式化了您的配置:
    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

    关于apache - 启动Apache槽时为nullpointerexception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33111654/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com