日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Hive 0.12.0安装配置

發布時間:2024/9/30 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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_profile

3:配置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

[jifeng@jifeng02 bin]$ cd .. [jifeng@jifeng02 hive-0.12.0-bin]$ cd .. [jifeng@jifeng02 hadoop]$ hiveLogging initialized using configuration in jar:file:/home/jifeng/hadoop/hive-0.12.0-bin/lib/hive-common-0.12.0.jar!/hive-log4j.properties hive>

注意:報錯請修改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安装配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。