Hive 0.12.0安装配置
1:解壓
tar zxf?hive-0.12.0-bin.tar.gz
mv?hive-0.12.0-bin hadoop
移動到hadoop目錄
2:配置環境變量
[jifeng@jifeng02 hive-0.12.0-bin]$ cat ../../.bash_profile # .bash_profile# Get the aliases and functions if [ -f ~/.bashrc ]; then. ~/.bashrc fi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATH export JAVA_HOME=$HOME/jdk1.7.0_45 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export HADOOP_HOME=$HOME/hadoop/hadoop-1.2.1 export ANT_HOME=$HOME/apache-ant-1.9.4export HIVE_HOME=$HOME/hadoop/hive-0.12.0-bin export HBASE_HOME=$HOME/hbase-0.94.21 export PIG_HOME=$HOME/pig-0.12.0 export PIG_CLASSPATH=$HOME/hadoop/hadoop-1.2.1/conf/export PATH=$PATH:$ANT_HOME/bin:$HIVE_HOME/bin::$HBASE_HOME/bin:$PIG_HOME/bin:$HADOOP_HOME/bin [jifeng@jifeng02 hive-0.12.0-bin]$ 使用配置生效?source ../../.bash_profile3:配置Hive
修改conf目錄下的文件
[jifeng@jifeng02 hive-0.12.0-bin]$ cd conf [jifeng@jifeng02 conf]$ mv hive-env.sh.template hive-env.sh [jifeng@jifeng02 conf]$ mv hive-default.xml.template hive-site.xml修改bin目錄下的文件 [jifeng@jifeng02 conf]$ cd .. [jifeng@jifeng02 hive-0.12.0-bin]$ cd bin [jifeng@jifeng02 bin]$ cat hive-config.sh # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.# # processes --config option from command line #this="$0" while [ -h "$this" ]; dols=`ls -ld "$this"`link=`expr "$ls" : '.*-> \(.*\)$'`if expr "$link" : '.*/.*' > /dev/null; thenthis="$link"elsethis=`dirname "$this"`/"$link"fi done# convert relative path to absolute path bin=`dirname "$this"` script=`basename "$this"` bin=`cd "$bin"; pwd` this="$bin/$script"# the root of the Hive installation if [[ -z $HIVE_HOME ]] ; thenexport HIVE_HOME=`dirname "$bin"` fi#check to see if the conf dir is given as an optional argument while [ $# -gt 0 ]; do # Until you run out of parameters . . .case "$1" in--config)shiftconfdir=$1shiftHIVE_CONF_DIR=$confdir;;--auxpath)shiftHIVE_AUX_JARS_PATH=$1shift;;*)break;;;esac done# Allow alternate conf dir location. HIVE_CONF_DIR="${HIVE_CONF_DIR:-$HIVE_HOME/conf}"export HIVE_CONF_DIR=$HIVE_CONF_DIR export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH# Default to use 256MB export HADOOP_HEAPSIZE=${HADOOP_HEAPSIZE:-256} export JAVA_HOME=$HOME/jdk1.7.0_45 export HIVE_HOME=$HOME/hadoop/hive-0.12.0-bin export HADOOP_HOME=$HOME/hadoop/hadoop-1.2.1 [jifeng@jifeng02 bin]$ 最后新加三行export JAVA_HOME=$HOME/jdk1.7.0_45
export HIVE_HOME=$HOME/hadoop/hive-0.12.0-bin
export HADOOP_HOME=$HOME/hadoop/hadoop-1.2.1
4:啟動Hive
先啟動hadoop
注意:報錯—請修改hive-site.xml:(vi編輯下:?/auth)
[Fatal Error] hive-site.xml:2002:16: 元素類型 "value" 必須由匹配的結束標記 "</value>" 終止。14/08/19 15:32:58 FATAL conf.Configuration: error parsing conf file: org.xml.sax.SAXParseException; systemId: file:/home/jifeng/hadoop/hive-0.12.0-bin/conf/hive-site.xml; lineNumber: 2000; columnNumber: 16; 元素類型 "value" 必須由匹配的結束標記 "</value>" 終止。
???在2002行第16字符那里??<value>auth</auth>
? ?修改為: <value>auth</value>?
hive>show tables;
此時還報錯:
FAILED:Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.java.lang.RuntimeException: Unable to instantiateorg.apache.hadoop.hive.metastore.HiveMetaStoreClient
最后將hive-site.xml?里面hive.metastore.schema.verification?的值改為?false后,就沒出現錯誤了。
總結
以上是生活随笔為你收集整理的Hive 0.12.0安装配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Pig 0.12.1安装和使用
- 下一篇: Hive学习和配置Mysql