Hive介绍及安装

介绍:

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

简单来说,Hive就是在Hadoop上架了一层SQL接口,可以将SQL翻译成MapReduce去Hadoop上执行,这样就使得数据开发和分析人员很方便的使用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/hive?characterEncoding=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之前一定要启动集群。

最新文章

  1. 三层ViewPager嵌套 的事件处理
  2. 【长期兼职】每天3小时写作=每月4000元外快(IT兼职写手)
  3. Error LNK2019: unresolved external symbol &quot;char * __stdcall _com_util::ConvertBSTRToString(wchar_t *)&quot;
  4. extern int a[] VS extern int *a
  5. MRTG开源监控安装手册
  6. MD5加密工具
  7. POJ2135:Farm Tour
  8. spark SQL随笔
  9. XPath、CSS 选择器 -学习地址
  10. 用于主题检测的临时日志(c5ac07a5-5dab-45d9-8dc2-a3b27be6e507 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)
  11. UVA 11178 Morley&#39;s Theorem(几何)
  12. JAVA关于泛型的笔记
  13. OpenGL中的常用绘图的命令与效果(经验设置)
  14. JVM各垃圾收集器对比
  15. 2018.08.11 洛谷P3224 [HNOI2012]永无乡(线段树合并)
  16. Swiper使用方法(向前和向后按钮在swiper-container外面)
  17. super函数的用法
  18. unity 静态合批
  19. C#高级编程 (第六版) 学习 第五章:数组
  20. 第十三次ScrumMeeting会议

热门文章

  1. kafka8 编写简单消费者
  2. 点击当前选项显示当前内容jquery
  3. node (02 CommonJs 和 Nodejs 中自定义模块)顺便讲讲module.exports和exports的区别 dependencies 与 devDependencies 之间的区别
  4. Oracle expdp impdp中 exclude/include 的使用
  5. Applet程序组件与AJAX技术
  6. DUBBO分布式入门
  7. Linux基础命令---lpq查看打印队列
  8. oracle常用函数介绍
  9. go get Unknown SSL protocol error in connection to gopkg.in
  10. vs2017 exe在Linux上运行