flume出现org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme “hdfs“

Posted 厨 神

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了flume出现org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme “hdfs“相关的知识,希望对你有一定的参考价值。

flume没有hadoop环境
排查:

  1. flume-env.sh加上export JAVA_HOME=/opt/module/jdk

  2. 把hadoop的配置文件core-site.xmlhdfs-site.xml放在$FLUME_HOME/conf

  3. jar包依赖问题
    /opt/module/hadoop/share/hadoop/hdfs/lib/hadoop-annotations-3.1.3.jar
    /opt/module/hadoop/share/hadoop/hdfs/lib/hadoop-auth-3.1.3.jar
    /opt/module/hadoop/share/hadoop/hdfs/lib/htrace-core4-4.1.0-incubating.jar
    /opt/module/hadoop/share/hadoop/common/lib/commons-io-2.5.jar
    /opt/module/hadoop/share/hadoop/common/lib/commons-configuration2-2.1.1.jar
    /opt/module/hadoop/share/hadoop/common/lib/guava-27.0-jre.jar 替换成高版本的
    /opt/module/hadoop/share/hadoop/hdfs/hadoop-hdfs-3.1.3.jar
    /opt/module/hadoop/share/hadoop/common/hadoop-common-3.1.3.jar
    /opt/module/hadoop/share/hadoop/common/lib/woodstox-core-5.0.3.jar

  4. 没有which命令!!!!!!!
    在flume-ng脚本里,有一个which hadoop,用来查找有没有hadoop命令的
    which前面是自动添加hadoop环境变量的。
    但是如果没有which命令,他就永远也找不到hadoop在哪里!!!!!


可以再命令行里面用which hadoop测试一下有没有which,如果是command not found就是没有which命令,下载一下就行了
yum install which -y

#Debian
apt-get install which
 
#Ubuntu
apt-get install which
 
#Alpine
apk add which
 
#Arch Linux
pacman -S which
 
#Kali Linux
apt-get install which
 
#CentOS
yum install which
 
#Fedora
dnf install which
 
#Raspbian
apt-get install which
 
#Docker
docker run cmd.cat/which which

没有网下载which的,把HADOOP_IN_PATH变成hadoop的目录就行

以上是关于flume出现org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme “hdfs“的主要内容,如果未能解决你的问题,请参考以下文章

flume采集数据报错问题解决

Hive错误:FAILED:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回代码2

Linux的hadoop运行hadoop的时候出现错误:找不到或者无法加载主类 org.apache.hadoop.fs.FsShell

hadoop 作业中的 org.apache.hadoop.fs.BlockMissingException

无法找到org.apache.hadoop.conf.Configuration

Error:(37, 47) java: 无法访问org.apache.hadoop.mapred.JobConf 找不到org.apache.hadoop.mapred.JobConf的类文件(