Hadoop error while searching for Java class

Asked

Viewed 162 times

1

I’m having trouble setting up the Hadoop environment. I’m doing a zero installation on a Centos 6.7 machine.

When trying to execute any Hadoop command, for example:

hdfs namenode -format
hadoop claspath
hadoop version

I get the error message:

Error: Unable to find or load main class Djava.library.path=.home.Hadoop.install.Hadoop-2. 7.1.lib

Below my conf:

[hadoop@node1 hadoop]$ cat **hadoop-env.sh**
export JAVA_HOME=${JAVA_HOME}

export JAVA_HOME="/usr/lib/jvm/jdk1.8.0_101"
export HADOOP_OPTS="$HADOOP_OPTS ‐Djava.net.preferIPv4Stack=true"
export HADOOP_CONF_DIR="/hadoop‐2.7.1/etc/hadoop"

[hadoop@node1 hadoop]$ cat **core-site.xml** 
<configuration>
<property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000/</value>
</property>
<property>
        <name>dfs.permissions</name>
        <value>false</value>
</property>
<property>
        <name>hadoop.tmp.dir</name>
        <value>/hadoop‐2.7.1/tmp</value>
</property>
</configuration>

Variables from the HADOOP

export HADOOP_INSTALL="/home/hadoop/install/hadoop-2.7.1"
export PATH=$PATH:$HADOOP_INSTALL/bin
export PATH=$PATH:$HADOOP_INSTALL/sbin
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_HOME=$HADOOP_INSTALL
export HADOOP_HDFS_HOME=$HADOOP_INSTALL
export YARN_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native
export HADOOP_OPTS="‐Djava.library.path=$HADOOP_INSTALL/lib"
export LD_LIBRARY_PATH=$HADOOP_INSTALL/lib/native/:$LD_LIBRARY_PATH
export JAVA_HOME="/usr/lib/jvm/jdk1.8.0_101"


PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/lib/jvm/jdk1.8.0_101/bin:/usr/lib/jvm/jdk1.8.0_101:/usr/lib/jvm/jdk1.8.0_101:/home/hadoop/install/hadoop-2.7.1/bin:/home/hadoop/install/hadoop-2.7.1/sbin:/home/hadoop/install/hadoop-2.7.1/bin:/home/hadoop/install/hadoop-2.7.1/sbin:/home/hadoop/install/hadoop-2.7.1/bin:/home/hadoop/install/hadoop-2.7.1/sbin:/home/hadoop/install/hadoop-2.7.1/bin:/home/hadoop/install/hadoop-2.7.1/sbin:/home/hadoop/install/hadoop-2.7.1/bin:/home/hadoop/install/hadoop-2.7.1/sbin:/home/hadoop/install/hadoop-2.7.1/bin:/home/hadoop/install/hadoop-2.7.1/sbin:/home/hadoop/install/hadoop-2.7.1/bin:/home/hadoop/install/hadoop-2.7.1/sbin:/home/hadoop/install/hadoop-2.7.1/bin:/home/hadoop/install/hadoop-2.7.1/sbin


JAVA_HOME=/usr/lib/jvm/jdk1.8.0_101

Path of the Hadoop

[hadoop@node1 hadoop]$ pwd

/home/hadoop/install/hadoop-2.7.1/etc/hadoop
  • 1

    Bá, son. Give a little formatting on that question there, please.

  • I accidentally published.... I’m editing... sorry

  • Don’t apologize, it happens. I just wanted to give a real touch.

1 answer

0

Go to:

cd /opt/hadoop/etc/hadoop/
vi hadoop-env.sh

Discontent the export JAVA_HOME=

add the export JAVA_HOME=/opt/jdk

do the same for the export HADOOP_HOME=/opt/hadoop

The same needs to be done at nodes-slave

## Iniciar o HDFS
$HADOOP_HOME/sbin/start-dfs.sh
  • 1 - to format text use Markdown. 2- The JAVA_HOME of it is not commented???

Browser other questions tagged

You are not signed in. Login or sign up in order to post.