• flume采集kafka到hdfs遇到的问题2


    Exception in thread "SinkRunner-PollingRunner-DefaultSinkProcessor" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357)
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338)
        at org.apache.hadoop.conf.Configuration.setBoolean(Configuration.java:1679)
        at org.apache.flume.sink.hdfs.BucketWriter.open(BucketWriter.java:226)
        at org.apache.flume.sink.hdfs.BucketWriter.append(BucketWriter.java:541)
        at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:401)
        at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
        at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)
        at java.lang.Thread.run(Thread.java:748)
    Exception in thread "SinkRunner-PollingRunner-DefaultSinkProcessor" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357)
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338)
        at org.apache.hadoop.conf.Configuration.setBoolean(Configuration.java:1679)
        at org.apache.flume.sink.hdfs.BucketWriter.open(BucketWriter.java:226)
        at org.apache.flume.sink.hdfs.BucketWriter.append(BucketWriter.java:541)
        at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:401)
        at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
        at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)
        at java.lang.Thread.run(Thread.java:748)

    报错信息:

    遇到这种问题,无非两种情况,一是 丢失jar包,二是 jar包冲突。

    由于对hadoop以及flume版本选择比较随意。猜测是jar包存在冲突。找到报错类 com.google.common.base.Preconditions ,通过查询 该类存在 guava jar包中。

    flume的lib中 /opt/flume/apache-flume-1.9.0-bin/lib (guava-11.0.2.jar),

    而 hadoop 的 lib 中 /opt/hadoop/hadoop-3.2.1/share/hadoop/common/lib/ (guava-27.0-jre.jar),

    删除版本低的,并拷贝高版本的。 问题解决。

  • 相关阅读:
    Jquery 面板导航,切换效果
    Jquery闪耀的地方,dom遍历,过滤查找的例子
    Jquery 通过 data- 来实现按钮点击切换显示隐藏
    Bootstrap 点击按钮切换内容
    c语言快速学习
    嵌入式学习
    16_文件的操作
    06_指针
    11_函数的退出方式
    10_参数数量可变的函数及命令行参数
  • 原文地址:https://www.cnblogs.com/ajinjinjin/p/15887288.html
Copyright © 2020-2023  润新知