在Hadoop单机环境搭建成功后(见 http://www.linuxidc.com/Linux/2012-07/64508.htm ),可以搭建hive。
在hdfs上建目录:
添加权限:
设置HADOOP_HOME,并将其添加到~/.bashrc
下载解压hive:
$ wget http://labs.mop.com/apache-mirror/hive/stable/hive-0.8.1.tar.gz .
$ 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>