Hive remote install mode (mysql) step by step
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&useUnicode=true&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&characterEncoding=latin1&user=hive&password=hive&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&characterEncoding=utf8&user=hive&password=hive&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的更多相关文章
- 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 ...
- 安装Hive(独立模式 使用mysql连接)
安装Hive(独立模式 使用mysql连接) 1.默认安装了java+hadoop 2.下载对应hadoop版本的安装包 3.解压安装包 tar zxvf apache-hive-1.2.1-bin. ...
- 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 ...
- 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 ...
- Step by step Dynamics CRM 2013安装
原创地址:http://www.cnblogs.com/jfzhu/p/4008391.html 转载请注明出处 SQL Server可以与CRM装在同一台计算机上,也可安装在不同的计算机上.演示 ...
- 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 ...
- HIve体系结构,hive的安装和mysql的安装,以及hive的一些简单使用
Hive体系结构: 是建立在hadoop之上的数据仓库基础架构. 和数据库相似,只不过数据库侧重于一些事务性的一些操作,比如修改,删除,查询,在数据库这块发生的比较多.数据仓库主要侧重于查询.对于相同 ...
- e2e 自动化集成测试 架构 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (四) Q 反回调
上一篇文章“e2e 自动化集成测试 架构 京东 商品搜索 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (三) SqlServ ...
- e2e 自动化集成测试 架构 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (三) SqlServer数据库的访问
上一篇文章“e2e 自动化集成测试 架构 京东 商品搜索 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step 二 图片验证码的识别” ...
随机推荐
- jquery1.9+获取append后的动态元素
jquery 1.9+放弃了live,说是用on代替了! 那么如果我们以前用live来获取jquery动态添加的元素,现在应该用on怎么写呢? 首先: <div id="one&quo ...
- Python入门笔记(22):Python函数(5):变量作用域与闭包
一.全局变量与局部变量 一个模块中,最高级别的变量有全局作用域. 全局变量一个特征就是:除非被删除,否则他们存活到脚本运行结束,且对于所有的函数都可访问. 当搜索一个标识符(也称变量.名字等),Pyt ...
- yii2.0用户登录,退出判断(摘录)
文章来源:http://blog.sina.com.cn/s/blog_88a65c1b0101ix13.html 判断用户是否登录 在 Yii2.0 里面,判断用户是否已经登录,我们用下面的代码即可 ...
- 【iOS】Quartz2D截屏
一.简单说明 在程序开发中,有时候需要截取屏幕上的某一块内容,比如捕鱼达人游戏.如图: 完成截屏功能的核心代码:- (void)renderInContext:(CGContextRef)ctx;调用 ...
- ASP.NET本质论第二章应用程序对象学习笔记1
1.请求的处理参数—上下文对象HttpContext 1) 针对每一次请求,ASP.NET将创建一个处理这次请求所使用的HttpContext对象实例,这个对象实例将用来在ASP.NET服务器的处理过 ...
- ASP.NET MVC 微信公共平台开发之获取用户消息并处理
ASP.NET MVC 微信公共平台开发 获取用户消息并处理 获取用户消息 用户发送的消息是在微信服务器发送的一个HTTP POST请求中包含的,获取用户发送的消息要从POST请求的数据流中获取 微信 ...
- gridView使用
只读 for (int i = 0; i <9; i++) { this.gridView1.Columns[i].OptionsColumn.ReadOnly = true; } 不显示面板 ...
- SPServices.SPDisplayRelatedInfo
Function $().SPServices.SPDisplayRelatedInfo Certification Functionality SPDisplayRelatedInfo is a f ...
- Java 中Comparator 的使用,实现集合排序
目标:实现对Person 对象的年龄,从小到大排序 1.实现排序 package com.app; import java.util.ArrayList; import java.util.Colle ...
- iOS 7中实现模糊效果
本文译自iOS 7 Blur Effects with GPUImage. iOS 7在视觉方面有许多改变,其中非常吸引人的功能之一就是在整个系统中巧妙的使用了模糊效果.许多第三方应用程序已经采用了这 ...