1、下载apache-hive-1.2.1-bin.tar.gz并解压
$tar -xf apache-hive-1.2.1-bin.tar.gz
$cd apache-hive-1.2.1-bin
$cd conf
2、复制hive-env.sh.tmplate为hive-env.sh,复制hive-default.xml.tmplate为hive-site.xml
1)$vim hive-env.sh,增加如下内容
HADOOP_HOME=/usr/local/hadoop-2.6.0
export HIVE_CONF_DIR=/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin/conf
export HIVE_HOME=/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin
2)$vim hive-site.xml,修改如下内容:
< property >
< name>hive.exec.scratchdir< /name>
< !–< value>/tmp/hive< /value>–>
< value>hdfs://Master:9000/hive/scratchdir< /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>${/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin/iotmp}/${system:user.name}< /value>–>
< value>/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin/iotmp< /value>
< description>Local scratch space for Hive jobs< /description>
< /property>
< property>
< name>hive.downloaded.resources.dir< /name>
< value>/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin/iotmp< /value>
< description>Temporary local directory for added resources in the remote file system.< /description>
< /property>
< property>
< name>hive.metastore.warehouse.dir< /name>
< !–< value>/user/hive/warehouse< /value>–>
< value>hdfs://Master:9000/hive/warehousedir
< description>location of default database for the warehouse
< property>
< name>hive.metastore.uris
< value/>
< !–< value>thrift://Master:9084–>
< description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.
< property>
< name>javax.jdo.option.ConnectionPassword
< !–< value>mine–>
< value>h