# Set HADOOP_HOME to point to a specific hadoop install directory
HADOOP_HOME=/Users/kk/hadoop/hadoop-2.6.5
# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/Users/kk/hadoop/hive-1.2.0/conf
# Folder containing extra ibraries required for hive compilation/execution can be controlled by:
export HIVE_AUX_JARS_PATH=/Users/kk/hadoop/hive-1.2.0/lib
HADOOP_HOME:Hadoop根目录
HIVE_CONF_DIR:Hive配置文件夹
HIVE_AUX_JARS_PATH:Hive依赖jar包的路径
1.3 配置hive-site.xml
编辑hive-site.xml文件,修改以下参数
<property>
<name>hive.exec.scratchdir</name>
<value>/Users/kangkang/hadoop/warehouse</value>
<description>HDFS root scratch dir for Hive jobs which gets created with write all (733) permission. For each connecting user, an HDFS scratch dir: ${hive.exec.scratchdir}/<username> is created, with ${hive.scratch.dir.permission}.</description>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/Users/kangkang/hadoop/hive-1.2.0/tmp/${user.name}</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/Users/kangkang/hadoop/hive-1.2.0/tmp/${hive.session.id}_resources</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
...
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/Users/kangkang/hadoop/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
...
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
<description>password to use against metastore database</description>
</property>
...
<property>
<name>hive.hwi.listen.port</name>
<value>9999</value>
<description>This is the port the Hive Web Interface will listen on</description>
</property>
...
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hivedbcreateDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
...
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
...
<property>
<name>hive.querylog.location</name>
<value>/Users/kangkang/hadoop/hive-1.2.0/tmp/${system:user.name}</value>
<description>Location of Hive run time structured log file</description>
</property>
...