设为首页 加入收藏

TOP

Hive介绍及安装
2019-03-19 12:59:18 】 浏览:43
Tags:Hive 介绍 安装
版权声明:请注明出处:https://www.cnblogs.com/meiLinYa/ https://blog.csdn.net/meiLin_Ya/article/details/86165807

Hive介绍及安装

介绍:

Hive是基于Hadoop的数据仓库解决方案。由于Hadoop本身在数据存储和计算方面有很好的可扩展性和高容错性,因此使用Hive构建的数据仓库也秉承了这些特性。

简单来说,Hive就是在Hadoop上架了一层SQL接口,可以将SQL翻译成MapReduceHadoop上执行,这样就使得数据开发和分析人员很方便的使用SQL来完成海量数据的统计和分析,而不必使用编程语言开发MapReduce那么麻烦。

Hive就是我们所说的使用传统的sql分析海量数据的工具。可以把Hive当成一个“数据库”,它也具备传统数据库的数据单元,数据库(Database/Schema)和表(Table.实际上只是Hadoop上的一个工具。

所以从技术角度来看:

hive就是一个翻译器,将传统的sql转化成mapreduce或者说:hive是基于mapreduce 的一个上层数据分析框架

作用:

hive能够用来进行海量数据的存储、查询和离线分析。快速查询!

hive数据库:

库:Hive中的数据库概念,本质上仅仅是的一个目录结构或命名空间。

表:Hive中的表概念,本质上仅仅是数据的一个目录结构或命名空间。

数据单元:Databases:数据库。概念等同于关系型数据库的Schema,不多解释;

Tables:表。概念等同于关系型数据库的表,不多解释;

Partitions:分区。概念类似于关系型数据库的表分区,没有那么多分区类型,只支持固定分区,将同一组数据存放至一个固定的分区中。

Buckets (or Clusters):分桶。同一个分区内的数据还可以细分,将相同的KEY再划分至一个桶中,这个有点类似于HASH分区,只不过这里是HASH分桶,也有点类似子分区吧。

内、外部表的区别:

删除表时:

内部表:删除数据和元数据;

外部表:删除元数据。

数据是否共享:


hive运行底层:来张图:


安装:



配置:

vi /conf/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://ry-hadoop1:3306/hivecharacterEncoding=UTF-8</value>
</property>
<property>
	<name>javax.jdo.option.ConnectionDriverName</name>
	<value>com.mysql.jdbc.Driver</value>
</property>
<property>
	<name>javax.jdo.option.ConnectionUserName</name>
	<value>root</value>
</property>
<property>
	<name>javax.jdo.option.ConnectionPassword</name>
	<value>root</value>
</property>

  </configuration>
添加一个jdbc jar包



此时启动hive会报错,是因为hadoop中/home/bigdata/hadoop-2.6.0/share/hadoop/yarn/lib/jline-0.9.94.jar 的版本太低,所以我们将hive中jline-2.12.jar替换掉hadoop中版本低的。


然后启动hive,启动hive之前一定要启动集群。


posted on 2018-07-05 19:56 meiLinYa 阅读(...) 评论(...) 编辑 收藏
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇hive数据类型有哪些? 下一篇【Hive】HiveQL实战之分析函数&窗..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目