一、获取hive 0.11文件

1、直接在apache网站下载release版

2、自己下载源码编译。方法:

git clone https://github.com/amplab/hive.git -b shark-0.11 git_hive-0.11_shark

cd git_hive-0.11_shark

ant package

因为我是为了后面和shark一起用,apache网站的hive经测试与shark集成有问题,所以用的是针对shark修改过的hive源码,自己编译。我使用shark时,shark针对hive o.11版的支持还有bug,还没有发布过针对hive 0.11的release版本,也需要自己编译。

shark在git上找到有两个不同公司维护的源码,因此,hive的源码地址有两个:

https://github.com/amplab/hive

https://github.com/WANdisco/amplab-hive

因为本文章是事后总结,忘了当时用的到底是哪个公司的代码。

二、在profile中设置HADOOP_HOME、HADOOP_CONF_DIR、HIVE_HOME、CLASSPATH等变量即可。

如果仅用hive+hadoop,hive仅需在master部署一份即可。

如果要用shark,每个worker节点都要部署,因为shark要用hive的lib目录下的.jar文件。

三、配置conf/hive-site.xml文件。

<configuration>
 
<property> 
   <name>hive.metastore.local</name> 
   <value>true</value> 
   <description>controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM</description> 
</property> 
 
<property> 
   <name>javax.jdo.option.ConnectionURL</name> 
   <value>jdbc:mysql://172.16.19.139:3306/hive_11</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>

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

四、启动hive:

1、hive                                                           //启动hive的cli,提供一个命令交互界面。

2、hive --service hiveserver                       //启动server端。用hive的jdbc包搞java开发,就要这样用。但关闭linux终端后,即不可用。

3、nohup hive --service hiveserver         //关于linux终端后,hive server在后台运行。

五、hive测试:

show tables;

create table lam01(id int, name string);

select * from lam01;

六、其它

查看hive文件:hadoop fs -ls -R /user/hive

七、安装过程中的错误记录

错误3:

MetaException(message:file:/user/hive/warehouse/xxxx is not a directory or unable to create one)

解决:CLASSPATH中加入HADOOP_CONF_DIR

错误2:

Error in metadata: MetaException(message:Got exception: org.apache.hadoop.hive.metastore.api.MetaException javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes

解决:

只要修改MySQL中Hive元数据库MetaStore的字符集便可。

alter database dbname character set latin1;

错误1:

java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient。

解决:在CLASSPATH中要有mysql的jdbc驱动。

编译错误:

mvn-init:

[echo] hcatalog-core

BUILD FAILED

/home/hadoop/git_hive-0.11_shark/build.xml:274: The following error occurred while executing this line:

/home/hadoop/git_hive-0.11_shark/build.xml:113: The following error occurred while executing this line:

/home/hadoop/git_hive-0.11_shark/build.xml:115: The following error occurred while executing this line:

/home/hadoop/git_hive-0.11_shark/hcatalog/build.xml:65: The following error occurred while executing this line:

/home/hadoop/git_hive-0.11_shark/hcatalog/build-support/ant/deploy.xml:77: get doesn't support the "skipexisting" attribute

解决:找到对应的.xml文件行,好像是去掉skipexisting属性。好像报了2次错误,因为还有另一个文件也是这个问题,依次解决就行了。

hive0.11的编译/安装/配置的更多相关文章

  1. Valgrind 3.11.0编译安装

    Valgrind 3.11.0编译安装 Valgrind是一款用于内存调试.内存泄漏检测以及性能分析的软件开发工具. Valgrind遵守GNU通用公共许可证条款,是一款自由软件. 到3.3.0版本为 ...

  2. haproxy1.7编译安装配置

    #haproxy1.7编译安装配置#高可用.负载均衡 使用 #haproxy1.7编译安装配置 #centos7 x86_64 #高可用.负载均衡 使用 #下载 #http://www.haproxy ...

  3. azkaban编译安装配置文档

    azkaban编译安装配置文档 参考官方文档: http://azkaban.github.io/azkaban/docs/latest/ azkaban的配置文件说明:http://azkaban. ...

  4. Visual Studio 2015编译安装配置QT5.5.1(含QTWEBKIT)

    尽管QT5.5.1和VisualStudio 2015都已经发布很久了,但是QT项目组视乎不会为QT5.5.1专门发布预编译的QT5.5.1 for windows(2015)版本的,也不会专门发布V ...

  5. cloudera impala编译 安装 配置 启动

    无论是采用GDB调试impala或者尝试修改impala源码,前提都是需要本地环境编译impala,这篇文章详细的分享一下impala编译方法以及编译过程遇到的棘手的问题: 前言: impala官方的 ...

  6. blfs(systemd版本)学习笔记-编译安装配置dhcpcd

    我的邮箱地址:zytrenren@163.com欢迎大家交流学习纠错! dhcpcd项目地址:http://www.linuxfromscratch.org/blfs/view/stable-syst ...

  7. blfs(systemv版本)学习笔记-编译安装配置dhcpcd

    我的邮箱地址:zytrenren@163.com欢迎大家交流学习纠错! dhcpcd项目地址:http://www.linuxfromscratch.org/blfs/view/8.3/basicne ...

  8. heartbeat 编译安装配置

    一.heartbeat介绍 heartbeat是HA高可用集群的一个重要组件,heartbeat实现了资源转移和心跳信息传递.它的常用组合方式为heartbeat v1,heartbeat v2+cr ...

  9. CentOS 7.4下源码编译安装配置LAMP环境详解

    CentOS 7.4搭建LAMP,LAMP:Linux.Apache.MySQL.PHP. 目录:第一部分 准备工作第二部分 安装Apache服务第三部分 安装MySQL服务第四部分 搭建PHP运行环 ...

随机推荐

  1. 根据版本的不同整理所有的绿色SQL Server

    在这篇论坛文章中,读者可以了解到如何根据不同的SQL Server版本,整理出所有版本的绿色SQL Server的具体方法,详细内容请参考下文: 1. Sqlservr.exe 运行参数 Sql Se ...

  2. WPF从入门到放弃系列第一章 初识WPF

    什么是WPF WPF(Windows Presentation Foundation)是微软推出的基于Windows Vista的用户界面框架,属于.NET Framework 3.0的一部分.它提供 ...

  3. 【JPA】query新对象 需要 构造函数

    构造函数 @Query("select g from Note g where id=?1" ) Note findById(Long id); @Query("sele ...

  4. BZOJ 2124等差子序列 线段树&&hash

    [题目描述 Description] 给一个 1 到 N 的排列{Ai},询问是否存在 1<=p1<p2<p3<p4<p5<…<pLen<=N(Len& ...

  5. EL四大作用域 9个jsp对象有效范围 及 对应的类

    java中request,session,application的作用范围 page,request,session,application四者的作用范围: page的作用范围是当前页面:对应El表达 ...

  6. java 中 sleep(1000) 和 wait(1000) 的区别?

    1.首先 sleep 方法是Thread类中的静态方法,他的作用是使当前线程暂时睡眠指定的时间,可以不用放在synchronized方法或者代码块中,但是 wait 方法是Object类的方法,它是使 ...

  7. msisdn与imsi简介

    =======================================imsi========================================1 定义:imsi=MCC+MNC ...

  8. css之自动换行

    自动换行问题,正常字符的换行是比较合理的,而连续的数字和英文字符常常将容器撑大, 挺让人头疼,下面介绍的是CSS如何实现换行的方法 对于div,p等块级元素 正常文字的换行(亚洲文字和非亚洲文字)元素 ...

  9. WEB黑客工具箱之LiveHttpHeaders介绍

    一.LiveHttpHeaders之安装 自行百度 二.LiveHttpHeaders主窗口 根据我们目的的不同,LiveHttpHeaders有两种启动方法:当我们只想监视通信量的时候,可以从浏览器 ...

  10. HDU 4540 威威猫系列故事——打地鼠(DP)

    点我看题目 题意 :中文题,不详述. 思路 : 状态转移方程 dp[ i ][ j ] = dp[i-1][k] + fabs(a[ i ][ j ]-a[i-1][k]) ; dp[i][j]代表的 ...