当前位置:   article > 正文

Hive-2.3.7安装(实际上是3.1.2)_apache-hiv-2.3.7

apache-hiv-2.3.7

Hive-2.3.7安装(实际上是3.1.2)

官网下载tar.gz

https://mirrors.koehn.com/apache/hive/hive-2.3.7/

在这里插入图片描述

解压到指定目录

tar -zxvf apache-hive-2.3.7-bin.tar.gz -C …/software/
cd …/software
mv apache-hive-2.3.7-bin/ hive-2.3.7
cd hive-2.3.7/conf

vim hive-site.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<configuration>
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:mysql://mysql所在IP地址:3306/hivemetastore?createDatabaseIfNotExist=true</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>com.mysql.jdbc.Driver</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>mysql账号</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>mysql密码</value>
  </property>
  <property>
    <name>hive.cli.print.current.db</name>
    <value>true</value>
  </property>
  <property>
    <name>hive.cli.print.header</name>
    <value>true</value>
  </property>
  <!-- 绑定运行hiveServer2的主机host,默认localhost -->
  <property>
    <name>hive.server2.thrift.bind.host</name>
    <value>yts1</value>
  </property>
  <!-- 指定hive metastore服务请求的uri地址 -->
  <property>
    <name>hive.metastore.uris</name>
    <value>thrift://yts1:9083</value>
  </property>

</configuration>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55

下载连接mysql的jar包

https://mvnrepository.com/artifact/mysql/mysql-connector-java/5.1.37

在这里插入图片描述

将jar包放到hive的lib目录中

在这里插入图片描述

vim /etc/profile

export HIVE_HOME=/new/software/hive-2.3.7
export PATH=$PATH:$HIVE_HOME/bin
  • 1
  • 2

source /etc/profile

初始化hive

schematool -dbType mysql -initSchema
  • 1

在这里插入图片描述

替换guava

因为我的hadoop版本是3.3.0,guava的版本不一致,会报错,只需要删除hive/lib中的低版本的guava,把hadoop中高版本的guava放在hive的lib中就ok了

在这里插入图片描述

warning

我的hive是2.3.7 ,hadoop是3.3.0 ,可能是版本不兼容吧,导致最后没法用,最后换了hive 3.1.2的版本,可以使用了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/633532
推荐阅读
相关标签
  

闽ICP备14008679号