ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Hadoop安装hive

2020-12-24 16:57:06  阅读:169  来源: 互联网

标签:xml lib License Hadoop hive guava 安装


文章目录


前言

Hadoop安装hive的过程以及遇到的问题加解决办法

一、下载

我是从官网下载的

https://mirror.bit.edu.cn/apache/hive/hive-3.1.2/

在这里插入图片描述

二、上传到Hadoop

1.上传

在这里插入图片描述

2.解压

在这里插入图片描述
改名
在这里插入图片描述

3.配置环境变量

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述使变量生效

此时查看hive的版本会报错

在这里插入图片描述
原因是hive和Hadoop的guava的版本一个太低一个太高,所以把低版本删掉,将 hive/lib/guava-19.0-jre.jar删除;将hadoop/share/hadoop/commons/lib/guava-27.0guava-27.0-jre.jar 复制到lib下


hive的lib下

在这里插入图片描述
到你自己的Hadoop的lib下
在这里插入图片描述
将guava-27.0guava-27.0-jre.jar 复制到hive的lib下
在这里插入图片描述
查看
在这里插入图片描述

4.开启集群查看版本

在这里插入图片描述其实应该一开始打开集群的

5.修改配置文件

切换到hive/conf目录下拷贝 hive-default.xml.template 为 hive-site.xml
修改hive-site.xml 文件以下需要指定数据连接信息(jdbc:mysql://192.168.2.115:3306/hive //hive数据库事先必须创建好)不知咋建也可以在hive-site.xml中写行代码
可以用notepad++打开Hadoop01,创建一个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.
–>

    <!-- 插入一下代码 -->
<property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>root</value>
</property>
<property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>Root1234567890!</value>#这是你自己的MySQL的密码
</property>
javax.jdo.option.ConnectionURL jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver hive.exec.script.wrapper

6.将MySQL的驱动程序弄到hive/lib下

我不知道这个程序在哪,我就下了一个
这是官网https://dev.mysql.com/downloads/file/?id=476197
在这里插入图片描述
我下到了自己电脑中解压好,把jar包上传到了hive/lib下

7.初始化hive的元数据库

我是在官网下载的
https://mirror.bit.edu.cn/apache/hive/hive-3.1.2/
上传到
在这里插入图片描述
schematool -dbType mysql –initSchema
如果会报错
在这里插入图片描述
这是因为数据库没有创建hive的数据库,但是上面的hive-site.xml中我已经加了一行代码,如果不存在就创建。
在这里插入图片描述
成功后输入 ./hive

成功进入
推出的话quit;

标签:xml,lib,License,Hadoop,hive,guava,安装
来源: https://blog.csdn.net/bigdatasyr/article/details/111638509

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有