1、安装
1.1、下载apache-hive-0.13.1-bin.tar.gz
1.2、解压至安装目录
tar -zxv -f apache-hive-0.13.1-bin.tar.gz -C ../soft/
#此处为了方便,进行了文件路径重命名
mv apache-hive-0.13.1-bin/ hive013
1.3、修改.bash_profile文件
export HIVE_HOME=/home/xuelu/soft/hive013
PATH=$PATH:$HADOOP_HOME/bin:$MAVEN_HOME/bin:$ZOOKEEPER_HOME/bin:$HIVE_HOME/bin
2、运行
由于Hive依赖于Hadoop,必须保证hadoop已经安装,并在Path中配置,另外
In addition, you must create /tmp
and /user/hive/warehouse
(aka hive.metastore.warehouse.dir
) and set them chmod g+w
in HDFS before you can create a table in Hive.
Commands to perform this setup:
$ $HADOOP_HOME/bin/hdfs dfs -mkdir /tmp $ $HADOOP_HOME/bin/hdfs dfs -mkdir /user/hive/warehouse $ $HADOOP_HOME/bin/hdfs dfs -chmod g+w /tmp $ $HADOOP_HOME/bin/hdfs dfs -chmod g+w /user/hive/warehouse
To use the Hive command line interface (CLI) from the shell:
$ $HIVE_HOME/bin/hive
原文地址:https://cwiki.apache.org/confluence/display/Hive/GettingStarted