fuse_dfs failed to mount

Issue

fuse_dfs command failed to mount HDFS with these messages

fuse_init.c:134 FATAL: dfs_init: fuseConnectInit failed with error -22!

Root Caused

This issue caused by "*" character in CLASSPATH env. According to Harsh J. [1]

The issue here is that JNI doesn't like wildcards in the classpath string - it does not evaluate them the same way the regular runtime does. Try placing a full list of explicit jars on the classpath and it will not throw that Class-Not-Found error anymore.

$ hadoop classpath
/home/user01/hadoop/etc/hadoop:/home/user01/hadoop/share/hadoop/common/lib/*:/home/user01/hadoop/share/hadoop/common/*:/home/user01/hadoop/share/hadoop/hdfs:/home/user01/hadoop/share/hadoop/hdfs/lib/*:/home/user01/hadoop/share/hadoop/hdfs/*:/home/user01/hadoop/share/hadoop/yarn/lib/*:/home/user01/hadoop/share/hadoop/yarn/*:/home/user01/hadoop/share/hadoop/mapreduce/lib/*:/home/user01/hadoop/share/hadoop/mapreduce/*:/home/user01/hadoop/share/hadoop/tools/lib/*

Fix

$ export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$HADOOP_HOME/lib/native
$ export CLASSPATH=`hadoop classpath --glob`
$ hadoop-fuse-dfs hdfs://nameservice1/ /export/hdfs/
$ ls -l /export/hdfs

References

  1. lists.apache.org/thread/sw6jvsxyg5vpyhgx5kk..
  2. stackoverflow.com/a/36119203/1377004