Heim  >  Artikel  >  Datenbank  >  基于MySQL元数据的Hive的安装和简单测试

基于MySQL元数据的Hive的安装和简单测试

WBOY
WBOYOriginal
2016-06-07 16:43:191315Durchsuche

hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供简单的sql查询功能,可以将sql语句转换

引言: Hive是一种强大的数据仓库查询语言,,类似SQL,本文将介绍如何搭建Hive的开发测试环境。

1. 什么是Hive?

hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供简单的sql查询功能,可以将sql语句转换为MapReduce任务进行运行。 其优点是学习成本低,可以通过类SQL语句快速实现简单的MapReduce统计,不必开发专门的MapReduce应用,十分适合数据仓库的统计分析。

2.  按照Hive的准备条件

2.1  Hadoop集群环境已经安装完毕

 2.2 本文使用Ubuntu做为开发环境(14.04)

3. 安装步骤

3.1 下载Hive包:apache-hive-0.13.1-bin.tar.gz

3.2 将其解压到/opt目录下

   tar xzvf apache-hive-0.13.1-bin.tar.gz

3.3 设置环境变量

export HIVE_HOME=/opt/apache-hive-0.13

export PATH=$PATH:$HIVE_HOME/bin

export CLASSPATH=$CLASSPATH:$HIVE_HOME/bin

3.4. 修改hive-env.xml,复制hive-env.xml.template.

# Set HADOOP_HOME to point to a specific hadoop install directory

HADOOP_HOME=/opt/hadoop-1.2.1

# Hive Configuration Directory can be controlled by:

export HIVE_CONF_DIR=/opt/apache-hive-0.13/conf

3.5 修改hive-site.xml,主要修改数据库的连接信息.

 
  hive.metastore.uris
  thrift://127.0.0.1:9083
  Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.


  javax.jdo.option.ConnectionURL
  jdbc:mysql://BladeStone-Laptop:3306/hive?createDatabaseIfNotExist=true
  JDBC connect string for a JDBC metastore


  javax.jdo.option.ConnectionDriverName
  com.mysql.jdbc.Driver
  Driver class name for a JDBC metastore


  javax.jdo.option.ConnectionUserName
  hive
  username to use against metastore database


  javax.jdo.option.ConnectionPassword
  123456
  password to use against metastore database

基于Hadoop集群的Hive安装

Hive内表和外表的区别

Hadoop + Hive + Map +reduce 集群安装部署

Hive本地独立模式安装

Hive学习之WordCount单词统计

3.6 安装mysql数据库

sudo apt-get install mysql-server


3.7 创建

3.8 在

 

更多详情见请继续阅读下一页的精彩内容:

linux

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:Oracle UNDO 监控Nächster Artikel:Neo4j集群环境搭建