Hive version: 3.1.2
System: macOS Mojave 10.14.4
Run on Hadoop 2.10.0
安装准备
Java 8
https://www.jianshu.com/p/6289bd0bb69c
Hadoop 2.10.0
https://blog.csdn.net/adorechen/article/details/104589268
初始化
cp $HIVE_HOME/conf/hive-env.sh.template $HIVE_HOME/conf/hive-env.sh
vim $HIVE_HOME/conf/hive-env.sh
修改$HADOOP_HOME=你的hadoop安装路径
In addition, you must use below HDFS commands to create /tmp
and /user/hive/warehouse
(aka hive.metastore.warehouse.dir
) and set them chmod g+w
before you can create a table in Hive.
$ $HADOOP_HOME/bin/hadoop fs -mkdir /tmp $ $HADOOP_HOME/bin/hadoop fs -mkdir /user/hive/warehouse $ $HADOOP_HOME/bin/hadoop fs -chmod g+w /tmp $ $HADOOP_HOME/bin/hadoop fs -chmod g+w /user/hive/warehouse
Running Hive CLI
To use the Hive command line interface (CLI) from the shell:
$ $HIVE_HOME/bin/hive
启动hive cli 后执行语句 select version(); 测试下, 发现报错:
FAILED: HiveException java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
查看hive日志位置,然后查看日志得到错误信息。
find /private -name "hive.log" 2>/dev/null