Chinaunix首页 | 论坛 | 博客
  • 博客访问: 279566
  • 博文数量: 82
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 874
  • 用 户 组: 普通用户
  • 注册时间: 2015-03-21 09:58
个人简介

traveling in cumputer science!!

文章分类

全部博文(82)

文章存档

2016年(13)

2015年(69)

我的朋友

分类: HADOOP

2016-04-24 16:40:38

HIVE安装环境:ubuntu14.04  hadoop-2.6.0  hive-2.0.0
SQL看了有一两周啦,开始环境实践!!

1.下载安装

下载链接:
解压安装:

点击(此处)折叠或打开

  1. tar -xzvf hive-x.y.z.tar.gz -C your_hive_path/hive

2.参数配置

2.1设置环境变量

打开/home/your_user_name/.bashrc
添加如下内容:

点击(此处)折叠或打开

  1. export HIVE_HOME=/home/warrior/bigData/hive
  2. export PATH=$HIVE_HOME/bin:$PATH

2.2设置配置文件

在/../hive/conf下
将hive-default.xml.template改为hive-site.xml

点击(此处)折叠或打开

  1. mv hive-default.xml.template hive-site.xml
将hive-log4j.properties.template改为hive-log4j.properties

点击(此处)折叠或打开

  1. mv hive-log4j.properties.template hive-log4j.properties
将hive-exec-log4j.properties.template改为hive-exec-log4j.properties

点击(此处)折叠或打开

  1. mv hive-exec-log4j.properties.template hive-exec-log4j.properties

3.运行过程以及遇到问题:

执行hive遇到问题

(1)报错信息:

点击(此处)折叠或打开

  1. Exception in thread "main" java.lang.RuntimeException: Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql)
解决办法:
如果还没有运行过hive,则执行

点击(此处)折叠或打开

  1. schematool -initSchema -dbType derby
如果已经执行过hive并报错,则在$HIVE_HOME/bin/下执行

点击(此处)折叠或打开

  1. mv metastore_db metastore_db.tmp
  2. schematool -initSchema -dbType derby
然后再执行hive,可能还会出现后面的问题!!

(2)报错信息:

点击(此处)折叠或打开

  1. Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D
解决办法,修改hive-site.xml :
<1创建目录:

点击(此处)折叠或打开

  1. cd ~
  2. mkdir -P ~/tmp/hive/local
  3. mkdir -P ~/tmp/hive/resources
<修改配置文件

点击(此处)折叠或打开

  1. <property>
  2.     <name>hive.exec.scratchdir</name>
  3.     <value>/home/your_user_name/tmp/hive</value>
  4.     <description>HDFS root scratch dir for Hive jobs which gets created with write all (733) permission. For each connecting user, an
  5. HDFS scratch dir: ${hive.exec.scratchdir}/&lt;username&gt; is created, with ${hive.scratch.dir.permission}.</description>
  6.   </property>
  7.   <property>
  8.     <name>hive.exec.local.scratchdir</name>
  9.     <value>home/your_user_name/tmp/hive/local</value>
  10.     <description>Local scratch space for Hive jobs</description>
  11.   </property>
  12.   <property>
  13.     <name>hive.downloaded.resources.dir</name>
  14.     <value>/home/your_user_name/tmp/hive/resources</value>
  15.     <description>Temporary local directory for added resources in the remote file system.</description>
  16.   </property>
再次执行hive,这回OK啦!!

参考链接:


http://www.cnblogs.com/likehua/p/3825479.html









阅读(1982) | 评论(0) | 转发(0) |
0

上一篇:IntelliJ IDEA 开发hadoop 配置与打jar包

下一篇:没有了

给主人留下些什么吧!~~