问题
使用hdfs作为sinks时报错信息如下:
2021-08-24 15:10:11,638 INFO avro.ReliableSpoolingFileEventReader:
Preparing to move file /tmp/logs/log.txt to /tmp/logs/log.txt.COMPLETED
2021-08-24 15:10:15,199 INFO hdfs.HDFSDataStream:
Serializer = TEXT, UseRawLocalFileSystem = false
2021-08-24 15:10:15,240 ERROR hdfs.HDFSEventSink: process failed
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.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)
解决
问题出在 NoSuchMethodError,但是这个类在哪个jar文件里,这是个问题!!!这种问题只能求助无私的分享者《线索一》《Hive文件上传HDFS出错》:
[root@tcloud ~]
/usr/local/hadoop-3.1.3/share/hadoop/hdfs/lib/guava-27.0-jre.jar
/usr/local/hadoop-3.1.3/share/hadoop/common/lib/guava-27.0-jre.jar
[root@tcloud ~]
/usr/local/flume/lib/guava-11.0.2.jar
[root@tcloud ~]
[root@tcloud ~]
[root@tcloud ~]
/usr/local/flume/lib/guava-27.0-jre.jar
测试成功了!感谢无私的程序员朋友!👍 👍 👍
|