vim .bash_profile
#hive-0.11.0
export HIVE_HOME=/nutch/hive
export HIVE_BIN=/nutch/hive/bin
export PATH=$PATH:$HIVE_HOME/bin
source .bash_profile
cd hive/conf #配置文件目录
cp hive-env.sh.template hive-env.sh
vim hive-env.sh
export HADOOP_HOME=/nutch/hadoop
export HIVE_CONF_DIR=/nutch/hive/conf
export HIVE_AUX_JARS_PATH=/nutch/hive/lib
mkdir -p /nutch/hive-0.11.0/warehouse
mkdir -p /nutch/hive-0.11.0/tmp
mkdir -p /nutch/hive-0.11.0/log
cp hive-default.xml.template hive-site.xml
vim hive-site.xml
键入‘/hive.metastore.warehouse.dir’(回车)
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/nutch/hive-0.11.0/warehouse</value>
</property>
这个是设定数据目录
<property>
<name>hive.querylog.location</name>
<value>/nutch/hive-0.11.0/log</value>
</property>
//文件中没有可以自己添加
<property>
<name>hive.exec.scratdir</name>
<value>/nutch/hive-0.11.0/tmp</value>
</property>
这个是设定临时文件目录
<property>
<name>hive.aux.jars.path</name>
<value>file:///nutch/hive/lib/hive-hbase-handler-0.11.0.jar,
file:///nutch/hive/lib/hbase-0.94.14.jar,
file:///nutch/hive/lib/zookeeper-3.4.5.jar
</value>
</property>
这个是用于存放hive相关日志的目录
cp hive-log4j.properties.template hive-log4j.proprties
vim hive-log4j.properties
log4j.appender.EventCounter=org.apache.hadoop.log.metrics.EventCounter
如果没有修改的话会出现:
WARNING: org.apache.hadoop.metrics.EventCounter is deprecated.
please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
hive图形界面
添加war包到hive的lib目录:
下载添加到/usr/lib/hive/lib/hive-hwi-0.9.0-cdh4.1.0.war
添加配置到hive-site.xml
<property>
<name>hive.hwi.listen.host</name>
<value>172.16.2.29</value>
<description>This is the host address the Hive Web Interface will listen on</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>hive.hwi.war.file</name>
<value>$HIVE_HOME/lib/hive_hwi.war</value>
<description>This is the WAR file with the jsp content for Hive Web Interface</description>
</property>
设置ANT_LIB路径
export ANT_LIB=/usr/lib/apache-ant-1.9.0/lib
启动hwi
hive --service hwi > hwi.log
http://172.16.2.29:9999/hwi/