hadoop2.6 配置hive 1.2.1 过程以及问题解决


需要注意的问题,首先并不需要修改4个置文件也可以成功,我是没有修改置的,可以正常使用;其次是版本兼容问题,留意.

参考链接

1   https://chrisfroehlingsdorf.de/installing-apache-hive-on-digital-ocean/

2   http://lizhenliang.blog.51cto.com/7876557/1665891

3   http://abcltb.blog.163.com/blog/static/3369299420152167229205/

测试例子参考链接http://lizhenliang.blog.51cto.com/7876557/1665891

置过程:

官网下载apache-hive-1.2.1-bin.tar.gz

解压到安装目录/usr/local/

1.系统添加参数/etc/profile

 

 

export HIVE_HOME=/usr/local/apache-hive-1.2.1-bin

export PATH=${PATH}:${HIVE_HOME}/bin

 

2.Hive 里面添加HADOOP_HOME

#and add the following line below it:
export HADOOP_HOME=/opt/hadoop

 

 

整体过程参考如下

 1 #alright, lets setup Hive on your Cluster (Masternode) 2 cd /opt/ 3 mkdir hive 4 cd hive 5  6 #checkout http://apache.claz.org/hive/stable/ for the latest bin version 7 #and download it 8 wget http://apache.claz.org/hive/stable/apache-hive-1.1.0-bin.tar.gz 9 tar -xvzf apache-hive-1.1.0-bin.tar.gz10 11 #edit the env. vars12 sudo nano /etc/bash.bashrc13 #add the following lines:14 export HIVE_HOME=/opt/hive/apache-hive-1.1.0-bin15 export PATH=$PATH:$HIVE_HOME/bin16 export HADOOP_HOME=/opt/hadoop17 18 #configuring hive19 cd /opt/hive/apache-hive-1.1.0-bin/bin20 nano hive-config.sh21 22 #find the following lines:23 # Allow alternate conf dir location.24 HIVE_CONF_DIR="${HIVE_CONF_DIR:-$HIVE_HOME/conf"25 export HIVE_CONF_DIR=$HIVE_CONF_DIR26 export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH27 28 #and add the following line below it:29 export HADOOP_HOME=/opt/hadoop30 31 #run a quick "bash" re-read32 bash33 34 #grant hduser local rights to hive installation35 sudo chown -R hduser:hadoop /opt36 37 #start your cluster if you haven't already38 su hduser39 /opt/hadoop/sbin/start-all.sh40 41 #we have to setup a directory for the hive tables42 hdfs dfs -mkdir -p /user/hive/warehouse43 hdfs dfs -chmod g+w /user/hive/warehouse #grant rights44 45 #special config stuff46 #(I figured this out when I was trying to get Hadoop 2.6.0 running with Hive 1.1.0)47 #if you are using other version of the two you might not need this48 #just try to run "hive" at first and see if you get any errors!49 rm -r /opt/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar50 rm -r /opt/hadoop/share/hadoop/yarn/lib/jline-0.9.94.jar51 52 #you can now run hive53 hive

这样启动还没有解决版本兼容问题,所以会报错

 

Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected

 

原因:

${hadoop_home}/share/hadoop/yarn/lib目录下的jline包版本过低,把${hive_home}/lib目录的jline包copy到${hadoop_home}/share/hadoop/yarn/lib目录下,启动hive

问题解决.



你可能感兴趣的:(hadoop2.6 配置hive 1.2.1 过程以及问题解决)