• flume启动报错:java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V


    一、问题描述

      新部署的flume在启动时候报错:java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V


    2020-06-30 11:40:20,359 (SinkRunner-PollingRunner-DefaultSinkProcessor) [ERROR - org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:459)] process failed
    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:221)
      at org.apache.flume.sink.hdfs.BucketWriter.append(BucketWriter.java:572)
      at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:412)
      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:221)
      at org.apache.flume.sink.hdfs.BucketWriter.append(BucketWriter.java:572)
      at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:412)
      at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
      at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)

    报错截图:

    {F664C7E8-5A5F-4B93-8A03-B42B20BFEFF5}_20200630115354

    问题解决:

    一般这类问题,classNotFound,不是少jar包,那就是jar包冲突,查看flume安装目录下lib下面查看是有guava这个包的:

    image

    排除少包jar包的问题,那就是jar包冲突,在查看,本地环境hadoop目录下lib中也是有这个guava这个包:

    image

    显然是二者版本不一致导致的

    问题解决:

    找到原因之后,那就有解决办法了

    将原有的flume中的低版本的guava包移除,然后拷贝hadoop/lib目录下的高版本的jar包到flume/lib中:

    image

    image

    完成上述两步操作之后,然后重新启动flume,报错消失

  • 相关阅读:
    随机森林算法参数调优
    BAYES和朴素BAYES
    阿里云 金融接口 token PHP
    PHP mysql 按时间分组 表格table 跨度 rowspan
    MySql按周,按月,按日分组统计数据
    PHP 获取今日、昨日、本周、上周、本月的等等常用的起始时间戳和结束时间戳的时间处理类
    thinkphp5 tp5 会话控制 session 登录 退出 检查检验登录 判断是否应该跳转到上次url
    微信 模板消息
    php 腾讯 地图 api 计算 坐标 两点 距离 微信 网页 WebService API
    php添加http头禁止浏览器缓存
  • 原文地址:https://www.cnblogs.com/Gxiaobai/p/13213303.html
Copyright © 2020-2023  润新知