注意点:
1. 创建hive-site.xml文件(根据hive-default.xml.template)
<name>javax.jdo.option.ConnectionURL</name>
<name>javax.jdo.option.ConnectionDriverName</name>
<name>javax.jdo.option.ConnectionUserName</name>
<name>javax.jdo.option.ConnectionPassword</name>
<name>hive.metastore.local</name>
<name>hive.metastore.warehouse.dir</name>
<name>hive.exec.scratchdir</name>
<name>hive.querylog.location</name>
2. 修改hive-exec-log4j.properties hive-log4j.properties,默认日志路径是/tmp/
3. 修改hive-env.sh,设置mysql连接器的jar环境变量
xport HIVE_AUX_JARS_PATH=${HIVE_HOME}/lib
下载mysql连接器
wget http://mysql.ntu.edu.tw/Downloads/Connector-J/mysql-connector-java-5.1.25.tar.gz
cp mysql-connector-java-5.1.25-bin.jar /home/hadoop/hive-installed/hive/lib/
4. 设置.bash_profile环境变量
######### HIVE ENVIRONMENT #########
export HIVE_HOME=/home/hadoop/hive-installed/hive
export HIVE_CONF_DIR=/home/hadoop/hive-installed/conf
5. 启动hive