8

The SLF4J error has been bugging me for a while now. It appears every time I type any hadoop shell command before showing the output of the command.

$ hadoop fs -ls
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.

This is a pseudo distributed installation of cdh5 on Ubuntu 14.04.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Antoni
  • 2,542
  • 20
  • 21

1 Answers1

9

Currently cloudera cdh5 does not officialy supports Ubuntu 14.04, although in the forums it says it will support it sometime before end of year.

However, I found a workaround.

Edit your hadoop-env.sh and add:

export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/share/java/slf4j-simple.jar

Where the /usr/share/java/slf4j-simple.jar should point to an implementation of slf4j present in your system (I simply did a find /usr/. -name slf4j*.jar -print to find it)

See http://www.slf4j.org/codes.html#StaticLoggerBinder for details

Now the logs works

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
Antoni
  • 2,542
  • 20
  • 21
  • That worked thanks! Just putting here a pointer to download the jar if not already there `curl -o /usr/share/java/slf4j-simple.jar https://repo1.maven.org/maven2/org/slf4j/slf4j-simple/1.7.29/slf4j-simple-1.7.29.jar` (or whatever version you want) – Andrea Bergonzo Nov 19 '19 at 17:30