1. 现象:在任意位置输入 hive,准备启动 hive 时,报错:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/mapred/MRVersion

 

 

 

 2. 原因:全局变量中未 添加 hive 的路径

3. 解决:

vi /etc/profile

添加:

export HIVE_HOME=/export/servers/apache-hive-2.1.1-bin   (/export/servers/apache-hive-2.1.1-bin 未本机 hive 安装路径,其他机器按实际情况进行修改 )

path 添加 hive 路径:

export PATH=:$JAVA_HOME/bin:$MAVEN_HOME/bin:$FINDBUGS_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$SQOOP_HOME/bin:$HIVE_HOME/bin:$PATH 

使配置生效:source /etc/profile

 

5. 重试:

 

posted on 2020-07-26 22:05  文泽9527  阅读(2741)  评论(0编辑  收藏  举报