hive启动报错 java.lang.ClassNotFoundException: org.apache.hadoop.mapred.MRVersion

Posted IT界的小十七

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hive启动报错 java.lang.ClassNotFoundException: org.apache.hadoop.mapred.MRVersion相关的知识,希望对你有一定的参考价值。

[[email protected] hive-1.1.0-cdh5.7.0]$ hive
which: no hbase in (/home/hadoop/app/hive-1.1.0-cdh5.7.0/bin:/home/hadoop/app/hadoop-2.8.1/bin:/usr/java/jdk1.8.0_45/bin:/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/hadoop/bin)
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/mapred/MRVersion
at org.apache.hadoop.hive.shims.Hadoop23Shims.isMR2(Hadoop23Shims.java:852)
at org.apache.hadoop.hive.shims.Hadoop23Shims.getHadoopConfNames(Hadoop23Shims.java:923)
at org.apache.hadoop.hive.conf.HiveConf$ConfVars.<clinit>(HiveConf.java:358)
at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:58)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:642)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:626)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.RunJar.run(RunJar.java:234)
at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.mapred.MRVersion
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 12 more

这是因为hadoop是apache的,hive是cdh的,所以会报错。

以上是关于hive启动报错 java.lang.ClassNotFoundException: org.apache.hadoop.mapred.MRVersion的主要内容,如果未能解决你的问题,请参考以下文章

hive启动报错解决流程

初次安装hive-2.1.0启动报错问题解决方法

启动hive报错[ERROR] Terminal initialization failed; falling back to unsupported

Spark 连接hive,启动spark-shell报错:Error creating transactional connection factory

hive安装运行hive报错通解

hive启动报错 Name node is in safe mode.