0

我有 Hadoop 2.7.1 e 它运行成功。接下来我下载了 apache-hive-2.1.1-bin 并编辑了“.bashrc”文件以更新用户的环境变量。现在,当我使用命令“*/sbin/start-dfs.sh”启动 Hadoop 时,出现错误:“无法找到或加载主类 org.apache.hadoop.hdfs.server.datanode.DataNode”

Air-di-Danilo:2.7.1 danilogrifoni$ */sbin/start-dfs.sh
18/04/28 12:33:36 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [localhost]
localhost: starting namenode, logging to /usr/local/Cellar/hadoop/2.7.1/libexec/logs/hadoop-danilogrifoni-namenode-Air-di-Danilo.out
localhost: Errore: impossibile trovare o caricare la classe principale org.apache.hadoop.hdfs.server.namenode.NameNode
localhost: starting datanode, logging to /usr/local/Cellar/hadoop/2.7.1/libexec/logs/hadoop-danilogrifoni-datanode-Air-di-Danilo.out
localhost: Errore: impossibile trovare o caricare la classe principale org.apache.hadoop.hdfs.server.datanode.DataNode
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /usr/local/Cellar/hadoop/2.7.1/libexec/logs/hadoop-danilogrifoni-secondarynamenode-Air-di-Danilo.out
0.0.0.0: Errore: impossibile trovare o caricare la classe principale org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode
18/04/28 12:34:22 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

这是我编辑的 bashrc 文件:

export HADOOP_HOME=/usr/local/Cellar/hadoop/2.7.1
export HADOOP_PREFIX=/usr/local/Cellar/hadoop/2.7.1/libexec
export HADOOP_CONF_DIR=/usr/local/Cellar/hadoop/2.7.1/libexec/etc/hadoop
export HADOOP_MAPRED_HOME=/usr/local/Cellar/hadoop/2.7.1
export HADOOP_COMMON_HOME=/usr/local/Cellar/hadoop/2.7.1
export HADOOP_HDFS_HOME=/usr/local/Cellar/hadoop/2.7.1
export YARN_HOME=/usr/local/Cellar/hadoop/2.7.1
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
export HADOOP_CLASSPATH=$(hadoop classpath):$HADOOP_CLASSPATH



export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
export PATH=$PATH:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin



export PATH=$PATH:/usr/local/Cellar/hadoop/2.7.1/bin
export HADOOP_PID_DIR=/usr/local/Cellar/hadoop/2.7.1

# Set HIVE_HOME

export HIVE_HOME=/Users/danilogrifoni/Documents/apache-hive-2.1.1-bin
export PATH=$PATH:/Users/danilogrifoni/Documents/apache-hive-2.1.1-bin/bin
4

1 回答 1

0

您是否在设置 bashrc 文件时运行了 source .bashrc 命令?

于 2018-04-28T14:15:10.707 回答