Hive单机版安装(Linux)
【摘要】 单机版hive的运行原理:LocalFileSystem+LocalMR+derby db + embemed MetaStore依赖的这些模块,都可以替换成相应的集群版。根据自己的实际情况配置。前提:已经安装配置JAVA_HOME软件下载:Hadoop 2.8.5下载:https://mirror.bit.edu.cn/apache/hadoop/core/hadoop-2.8.5/had...
单机版hive的运行原理:
LocalFileSystem+LocalMR+derby db + embedded MetaStore
依赖的这些模块,都可以替换成相应的集群版。根据自己的实际情况配置。
前提:
已经安装配置JAVA_HOME
软件下载
Hadoop 2.8.5下载:
https://mirror.bit.edu.cn/apache/hadoop/core/hadoop-2.8.5/hadoop-2.8.5.tar.gz
Hive2.3.7下载:
https://mirror.bit.edu.cn/apache/hive/hive-2.3.7/apache-hive-2.3.7-bin.tar.gz
解压到任意目录,比如:/home/nemon/software
设置环境变量
export HADOOP_HOME=/home/nemon/software/hadoop-2.8.5 export HIVE_HOME=/home/nemon/software/apache-hive-2.3.7-bin
初始化:
cd $HIVE_HOME bin/schematool -dbType derby -initSchema --verbose
运行:
cd $HIVE_HOME bin/hive
Hive3单机版会遇到的问题:
2020-08-13 14:39:59,339 INFO [main] conf.HiveConf (HiveConf.java:findConfigFile(187)) - Found configuration file null Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357) at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338) at org.apache.hadoop.mapred.JobConf.setJar(JobConf.java:518) at org.apache.hadoop.mapred.JobConf.setJarByClass(JobConf.java:536) at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:430) at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:5135) at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:5098) at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:96) at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1473) 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:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:318) at org.apache.hadoop.util.RunJar.main(RunJar.java:232)
原因:
Hive带的guava版本与Hadoop要用的不一致。
解决:
使用Hadoop的guava jar
mv /home/nemon/software/apache-hive-3.1.0-bin/lib/guava-19.0.jar /home/nemon/software/apache-hive-3.1.0-bin/lib/guava-19.0.jar.b cp guava-27.0-jre.jar /home/nemon/software/apache-hive-3.1.0-bin/lib
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)