Prerequisite:

Hadoop cluster is avalable;

Mysql installed on namenode;

Step1: download the latest hive tar packages and extract .

Download:http://apache.dataguru.cn/hive/hive-0.12.0/

tar xvf tar xvf hive-0.12..tar.gz

Step2: set the environment for hive.

# su to root add hive home

Vim /etc/profile

export HIVE_HOME=/home/hadoop/hive/hive-0.12.

export PATH =$PATH:$HIVE_HOME/bin;

Step3: do this in mysql Create the connection user hive with password hive.

mysql –u root –p

CREATE USER 'hive'@'%' IDENTIFIED BY 'hive';

GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' WITH GRANT OPTION;

flush privileges;

Step4: copy the mysql connector to hive/lib folder.

copy mysql-connector-java-5.1.-bin.jar to hive/lib/

Step5:update the hive-site.xml

Vim hive-site.xml

The sample content is following:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property> <name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://namenode:3306/hive?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=latin1</value>
</property> <property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property> <property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property> <property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
</property> <property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
<property> <name>hive.stats.dbconnectionstring</name>
<value>jdbc:mysql://namenode:3306/hive_stats?useUnicode=true&amp;characterEncoding=latin1&amp;user=hive&amp;password=hive&amp;createDatabaseIfNotExist=true</value>
<description>The default connection string for the database that stores temporary hive statistics.</description> </property> <property>
<name>hive.stats.dbconnectionstring</name>
<value>jdbc:mysql://namenode:3306/hive_stats?useUnicode=true&amp;characterEncoding=utf8&amp;user=hive&amp;password=hive&amp;createDatabaseIfNotExist=true</value>
</property> <property>
<name>hive.stats.dbclass</name>
<value>jdbc:mysql</value>
</property> <property>
<name>hive.stats.jdbcdriver</name>
<value>com.mysql.jdbc.Driver</value>
</property> </configuration>

Step6: hive shell, test the install.

Hive;

Show tables;

Then you can go to mysql , check the metastore database hive,

Show tables to check the metastore tables in mysql.

Step7:quick start:

create table student(sid int,sname string) row format delimited fields terminated by '\t' stored as textfile;

load data local inpath '/home/hadoop/data/student.txt' overwrite into table student;

select * from student;

cd /data

vim student.txt
yaoxiaohua
yaoyuanyie
yaotianyie

我一开始在安装的时候,hive启动还总是出一些问题,是hive-site.xml的配置造成的.

可以开启调试模试,根据日志查找原因.

启动调试模式进行操作:

hive -hiveconf hive.root.logger=DEBUG,console

我的mysql安装的比较早,一开始居然忘记root密码了,如果你也遇到了这种情况,

可以参见:

http://blog.sina.com.cn/s/blog_4488002e0100z574.html

主要思路是使用安全登录命令,然后update user表的信息.

mysqld_safe --skip-grant-tables 

可能会用到的一些命令:

rpm -qa | grep mysql  // 这个命令就会查看该操作系统上是否已经安装了mysql数据库

Service mysqld status //检查mysqld的状态

Chkconfig mysqld on //设置开机自动启动mysql服务

Hive remote install mode (mysql) step by step的更多相关文章

  1. Step by step Install a Local Report Server and Remote Report Server Database

    原创地址:http://www.cnblogs.com/jfzhu/p/4012097.html 转载请注明出处 前面的文章<Step by step SQL Server 2012的安装 &g ...

  2. 安装Hive(独立模式 使用mysql连接)

    安装Hive(独立模式 使用mysql连接) 1.默认安装了java+hadoop 2.下载对应hadoop版本的安装包 3.解压安装包 tar zxvf apache-hive-1.2.1-bin. ...

  3. Step by step guide to set up master and slave machines(转)

    Note: There is no need to install Jenkins on the slave machine. On your master machine go to Manage ...

  4. Step by step guide to set up master and slave machines on Windows

    Note: There is no need to install Jenkins on the slave machine. On your master machine go to Manage ...

  5. Step by step Dynamics CRM 2013安装

    原创地址:http://www.cnblogs.com/jfzhu/p/4008391.html 转载请注明出处   SQL Server可以与CRM装在同一台计算机上,也可安装在不同的计算机上.演示 ...

  6. Tomcat Clustering - A Step By Step Guide --转载

    Tomcat Clustering - A Step By Step Guide Apache Tomcat is a great performer on its own, but if you'r ...

  7. HIve体系结构,hive的安装和mysql的安装,以及hive的一些简单使用

    Hive体系结构: 是建立在hadoop之上的数据仓库基础架构. 和数据库相似,只不过数据库侧重于一些事务性的一些操作,比如修改,删除,查询,在数据库这块发生的比较多.数据仓库主要侧重于查询.对于相同 ...

  8. e2e 自动化集成测试 架构 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (四) Q 反回调

    上一篇文章“e2e 自动化集成测试 架构 京东 商品搜索 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (三) SqlServ ...

  9. e2e 自动化集成测试 架构 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (三) SqlServer数据库的访问

    上一篇文章“e2e 自动化集成测试 架构 京东 商品搜索 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step 二 图片验证码的识别” ...

随机推荐

  1. iOS开发系列通讯录、蓝牙、内购、GameCenter、iCloud、Passbook系统服务开

    --系统应用与系统服务 iOS开发过程中有时候难免会使用iOS内置的一些应用软件和服务,例如QQ通讯录.微信电话本会使用iOS的通讯录,一些第三方软件会在应用内发送短信等.今天将和大家一起学习如何使用 ...

  2. TortoiseSVN中出现的图标问题及解决方法

    1.红色感叹号表示这个文件从服务器上下载下来以后,在本地被修改过.这时执行提交操作就可以了.2.黄色感叹号表示这个文件在提交的时候发现存在冲突,也就是说有别人在你提交之前对这个文件的同一个版本进行了修 ...

  3. 【jQuery基础学习】00 序

    作为一个从来没有认真学过jQuery的菜来讲,我所学的都是jQuery基础. 算是让自己从0开始系统学一遍吧.学习书籍为:<锋利的jQuery>. 虽然是个序,表示一下我是个菜,但还是来几 ...

  4. Fluent NHibernate and Mysql,SQLite,PostgreSQL

    http://codeofrob.com/entries/sqlite-csharp-and-nhibernate.html https://code.google.com/archive/p/csh ...

  5. 【BZOJ 4551】【TJOI2016】【HEOI2016】树

    http://www.lydsy.com/JudgeOnline/problem.php?id=4551 题目描述 给定一棵有根树(根为 1),有以下两种操作:1. 标记操作:对某个结点打上标记(在最 ...

  6. 自定义View_2_关于自定义组合View

    自定义View(2) Android当中给我们提供了丰富的UI控件,当然也许满足不了我们的需求,我们就必须学会自定义自己的View,我们怎么算是自定义自己的view呢! 我们会根据原来有的View对V ...

  7. ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

    The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramewor ...

  8. Atitit. Atiposter 发帖机 新特性 poster new feature   v7 q39

    Atitit. Atiposter 发帖机 新特性 poster new feature   v7 q39 V1  初步实现sina csdn cnblogs V2  实现qzone sohu 的发帖 ...

  9. SharePoint 2013 排错之"Code blocks are not allowed in this file"

    今天,设置页面布局的自定义母版页时,设置完了以后保存,然后预览报错,错误如下截图:删掉自定义母版页的MasterPageFile属性,页面依然报错:感觉甚是奇怪,因为有版本控制,还原为最初的版本,依然 ...

  10. How does Web Analytics works under sharePoint 2010

    [http://gokanx.wordpress.com/2013/06/15/how-does-web-analytics-works-under-sharepoint-2010/] You nee ...