Ubuntu 下 Hive搭建笔记

Hadoop单机环境搭建成功后(见  ),可以搭建hive。

在hdfs上建目录:

$ hmkdir /tmp   $ hmkdir /user/hive/warehouse  

添加权限:

$ hchmod g+w   /tmp   $ hchmod g+w   /user/hive/warehouse  

设置HADOOP_HOME,并将其添加到~/.bashrc

export HADOOP_HOME=/home/zxm/hadoop/hadoop-1.0.3  

下载解压hive:
$ wget .
$ tar -zxvf hive-0.8.1.tar.gz

启动hive:
$ cd /home/zxm/hadoop/hive-0.8.1 ; ./bin/hive

测试:
$ ./hive
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/zxm/hadoop/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties
Hive history file=/tmp/work/hive_job_log_work_201207051945_218572007.txt
hive> SHOW TABLES;
OK
Time taken: 7.281 seconds
hive> CREATE TABLE pokes (foo INT, bar STRING);
OK
Time taken: 0.398 seconds
hive> SHOW TABLES;                             
OK
pokes
Time taken: 0.181 seconds
hive> DESCRIBE pokes;
OK
foo     int
bar     string
Time taken: 0.58 seconds
hive> 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/c1b201e098f57613b7cc54f881fef62b.html