5

I opened up localhost:9870 and try to upload a txt file to the hdfs.

I see the error message below

Failed to retrieve data from /webhdfs/v1/?op=LISTSTATUS: Server Error
10

5 Answers 5

4

I had the same issue with JDK 9. The fix for me was to add this line in hadoop-env.sh

export HADOOP_OPTS="--add-modules java.activation"

Thats because java.activation package is deprecated in Java 9.

1
  • I have -Hadoop 3.0.0 -Java 9.0.4 And this solution worked for me. Thanks S2L
    – Isomorph
    Jun 7, 2018 at 17:51
4

I got this to work with OpenJDK 13 by downloading hadoop 2.9.2 and copying the activation-1.1.jar file from that download into the $HADOOP_HOME/share/hadoop/yarn folder you're using for Hadoop 3. Then you have to run stop-dfs.sh and stop-yarn.sh and then start them both again. No need to edit any config files with this method since it will automatically be added to the classpath.

2
3

Just solved such a problem, I have multiple java versions and hadoop3.1.0.

you need to specify the java home variable in etc/hadoop/hadoop-env.sh, and the java version should be 1.8.

0

This occurs due to conflicting versions of Java and OpenJDK installed as a dependency of Homebrew. So it would be nice to uninstall Java. using the commands below

  1. Uninstall java

#!/bin/bash

sudo rm -rvf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
sudo rm -rvf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rvf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rvf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rvf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rvf /Library/LaunchDaemons/com.oracle.java.JavaUpdateHelper.plist
sudo rm -rvf /Library/Preferences/com.oracle.java.Helper-Tool.plist

you can check with [this link][1]

  1. Create symlink to point to Homebrew open JDK dependency

    sudo ln -sfn $(brew --prefix)/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk

  2. Check for Java path using

    $ /usr/libexec/java_home

    It generates a path like this

    /opt/homebrew/Cellar/openjdk@11/11.0.18/libexec/openjdk.jdk/Contents/Home

  3. update the Hadoop environment file with the OpenJDK path by using this command in the terminal

    $cd /opt/homebrew/Cellar/hadoop/3.3.1/libexec/etc/hadoop $code hadoop-env.sh

update the JAVA_HOME path with the following

export JAVA_HOME=/opt/homebrew/Cellar/openjdk@11/11.0.18/libexec/openjdk.jdk/Contents/Home

Bonus: Check your java path with echo $JAVA_HOME

0

Try to install Java version 11 (or lower) or 1.8. I changed to Java 1.8, and it solves my problem. Hadoop is not compatible with a java version higher than 11.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.