ubuntu安装hive
1.安装mysql,可参考下面链接
http://www.cnblogs.com/liuchangchun/p/4099003.html
2.安装hive,之前,先在mysql上创建一个hive,数据库,并在hive数据库中建立表user
create database hive;
use hive;
create table user(Host char(),User char(),Password char());
3.进入mysql,赋予权限,密码自己改
mysql -u root -p
insert into user(Host,User,Password) values("localhost","hive",password(""));
FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost' IDENTIFIED BY 'hive';
FLUSH PRIVILEGES;
4.解压hive安装包之后,配置环境
sudo gedit /etc/profile
#hive
export HIVE_HOME=/home/sendi/apache-hive-1.1.-bin
export PATH=$PATH:$HIVE_HOME/bin
5.修改hive/conf下的几个template模板,
cp hive-env.sh.template hive-env.sh
cp hive-default.xml.template hive-site.xml
6.配置hive-env.sh文件,指定HADOOP_HOME
HADOOP_HOME=/home/sendi/hadoop-2.6.
7.修改hive-site.xml文件,指定MySQL数据库驱动、数据库名、用户名及密码
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property> <property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property> <property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
<description>username to use against metastore database</description>
</property> <property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
<description>password to use against metastore database</description>
</property> <property>
<name>hive.metastore.local</name>
<value>true</value>
<description></description>
</property>
8.修改hive/bin下的hive-config.sh文件,设置JAVA_HOME,HADOOP_HOME
export JAVA_HOME=/usr/lib/jdk/jdk1..0_67
export HADOOP_HOME=/home/sendi/hadoop-2.6.
export HIVE_HOME=/home/sendi/apache-hive-1.1.-bin
9.下载mysql-connector-java-5.1.27-bin.jar文件,并放到$HIVE_HOME/lib目录下
10.在HDFS中创建/tmp和/user/hive/warehouse并设置权限
hadoop fs -mkdir /tmp
hadoop fs -mkdir /user/hive/warehouse
hadoop fs -chmod g+w /tmp
hadoop fs -chmod g+w /user/hive/warehouse
11.启动hive
12.启动时,可能会遇到下面的问题
Logging initialized using configuration in jar:file:/hive/apache-hive-1.1.-bin/lib/hive-common-1.1..jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/hadoop-2.5./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/hive/apache-hive-1.1.-bin/lib/hive-jdbc-1.1.-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
at jline.TerminalFactory.create(TerminalFactory.java:)
at jline.TerminalFactory.get(TerminalFactory.java:)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:)
at org.apache.hadoop.hive.cli.CliDriver.getConsoleReader(CliDriver.java:)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.apache.hadoop.util.RunJar.main(RunJar.java:)
13.原因是hadoop目录下存在老版本jline,解决方法:
1.进入hive的lib目录,把新版本的jline复制到hadoop的一下目录
/home/sendi/hadoop-2.6./share/hadoop/yarn/lib
2把hadoop就版本的jline删掉
14.如果还遇到以下问题:
jiahong@jiahongPC:~/apache/apache-hive-1.1.-bin$ hive
// :: WARN conf.HiveConf: HiveConf of name hive.metastore.local does not exist Logging initialized using configuration in jar:file:/home/jiahong/apache/apache-hive-1.1.-bin/lib/hive-common-1.1..jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/jiahong/apache/hadoop-2.6./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/jiahong/apache/apache-hive-1.1.-bin/lib/hive-jdbc-1.1.-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:472)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.apache.hadoop.util.RunJar.run(RunJar.java:)
at org.apache.hadoop.util.RunJar.main(RunJar.java:)
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D
at org.apache.hadoop.fs.Path.initialize(Path.java:)
at org.apache.hadoop.fs.Path.<init>(Path.java:)
at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:)
... more
Caused by: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D
at java.net.URI.checkPath(URI.java:)
at java.net.URI.<init>(URI.java:)
at org.apache.hadoop.fs.Path.initialize(Path.java:)
... more
jiahong@jiahongPC:~/apache/apache-hive-1.1.-bin$ hadoop dfs - ls /
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
15.修改hive-site.xml文件,修改之前要在hdfs上建立相应的文件夹,内容如下:
<property>
<name>hive.exec.scratchdir</name>
<value>/tmp/hive</value>
<description>HDFS root scratch dir for Hive jobs which gets created with write all () permission. For each connecting user, an HDFS scratch dir: ${hive.exec.scratchdir}/<username> is created, with ${hive.scratch.dir.permission}.</description>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/tmp/hive/local</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/tmp/hive/resources</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>

16.先启动hadoop,再启动hive
sendi@sendijia:~/hadoop-2.6.$ hive Logging initialized using configuration in jar:file:/home/sendi/apache-hive-1.1.-bin/lib/hive-common-1.1..jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/sendi/hadoop-2.6./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/sendi/apache-hive-1.1.-bin/lib/hive-jdbc-1.1.-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
hive>
ubuntu安装hive的更多相关文章
- Ubuntu 安装hive + mysql
先安装mysql sudo apt-get update sudo apt-get install mysql-server sudo mysql_secure_installation具体详情请另查 ...
- ubuntu - 安装hive
粗略步骤: 详细参考:https://www.2cto.com/net/201804/735478.html 环境:ubunut jdk hadoop mysql 一.下载hive 二.解压( ...
- Ubuntu16.04下安装Hive
上一篇博客我们已经说过了要如何安装Hadoop,别忘记了我们的目的是安装Hive.所以这篇博客,我就来介绍一下如何安装Hive. 一.环境准备 (1)Vmware (2) Ubuntu 16.04 ...
- 安装Hive过程中报错:Unsupported major.minor version 52.0
在安装hive的过程中,我觉得我是按照教程走的,但是在启动hive时还是报错了,错误如下 Exception in thread "main" java.lang.Unsuppor ...
- Mac OS、Ubuntu 安装及使用 Consul
Consul 概念(摘录): Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置.与其他分布式服务注册与发现的方案,比如 Airbnb 的 SmartStac ...
- ubuntu安装mysql
好记性不如烂笔头,记录一下,ubuntu安装mysql的指令. 安装MySQL: sudo apt-get install mysql-server sudo apt-get install mysq ...
- ubuntu安装vim时提示 没有可用的软件包 vim,但是它被其它的软件包引用了 解决办法
ubuntu安装vim时提示 没有可用的软件包 vim-gtk3,但是它被其它的软件包引用了 解决办法 本人在ubuntu系统安装vim 输入 sudo apt-get install vim 提示 ...
- 安装Hive(独立模式 使用mysql连接)
安装Hive(独立模式 使用mysql连接) 1.默认安装了java+hadoop 2.下载对应hadoop版本的安装包 3.解压安装包 tar zxvf apache-hive-1.2.1-bin. ...
- docker 1.8+之后ubuntu安装指定版本docker-engine
这边记录ubuntu安装过程,首先是官网文档 If you haven’t already done so, log into your Ubuntu instance. Open a termina ...
随机推荐
- Hive深入浅出
1. Hive是什么 1) Hive是什么? 这里引用 Hive wiki 上的介绍: Hive is a data warehouse infrastructure built on top of ...
- DTW
DTW主要是应用在孤立词识别的算法,用来识别一些特定的指令比较好用,这个算法是基于DP(动态规划)的算法基础上发展而来的.这里介绍语音识别就先介绍下语音识别的框架,首先我们要有一个比对的模版声音,然后 ...
- eclipse+cdt+minGW (C/C++ 编译)
1. 安装Eclipse CDT 方法1: 已安装Eclipse的话,可以通过菜单Help->Install New Software,安装CDT插件. 点击ADD后 Name:CDT L ...
- "奇葩家园“之 asyncTask 与 url 下载篇
asyncTask 是android提供的一个轻量级的异步处理的类,有3个泛型参数,params,progress,result params: 启动任务执行的时候传入的参数比如请求的 url 地址 ...
- JavaScript 字符串处理详解【转自:http://www.cnblogs.com/mondLei/p/4096855.html】
一.创建字符串 创建一个字符串,将一组字符串用引号包起来,将其赋值给一个字符串变量. var JsStr="Hello,JavaScript String!"; 二.字 ...
- APP_Store - 怎样为iOS8应用制作预览视频
关于iOS 8应用预览视频的话题,从设计.技术规范,到录屏.编辑工具,介绍的都比较详尽:建议收藏,在接下来用的到的时候作以参考.下面进入译文. 最近一两个月里,苹果的世界里出现了很多新东西,比如屏幕更 ...
- Qt的QTabelWidget
QTableWidget的用法总结 http://blog.csdn.net/zb872676223/article/details/39959061 [Qt]在QTableWidget中添加QCh ...
- PB串口编程资料(转)
----MSCOMM32参数基本介绍2008年03月29日 星期六 上午 11:37MSComm 控件通过串行端口传输和接收数据,为应用程序提供串行通讯功能.MSComm控件在串口编程时非常方便,程序 ...
- 关于1>LINK : fatal error LNK1168: 无法打开 ....exe或者....dll进行写入的问题
我们用VS编译器运行我们的程序时候,可能会出现关于1>LINK : fatal error LNK1168: 无法打开 ...dll 进行写入或者是1>LINK : fatal err ...
- VRP-Lua学习笔记
至于vrp是什么东西以及为什么要学习vrp,vrp的简单操作这些问题请自行右转抵拢倒拐找百度或者去中视典官网去找教程,我这里不会在赘述. 今天默认我们已经会使用VRP的脚本编辑器,用其他语言来为VRP ...