升级Hadoop Hive的版本


Cloudera发行版中的Hive版本稍微有点低,可能满足不了一些功能需求,不过我们可以按照如下方式将其进行升级。

$ sudo wget http://archive.apache.org/dist/hive/hive-0.8.1/hive-0.8.1-bin.tar.gz
$ sudo tar xzvf hive-0.8.1-bin.tar.gz

$ sudo /etc/init.d/hadoop-hive-server stop

$ sudo mv /usr/lib/hive /usr/lib/hive-0.7.1
$ sudo mv hive-0.8.1-bin /usr/lib/hive-0.8.1
$ sudo ln -s /usr/lib/hive-0.8.1 /usr/lib/hive
$ cd /usr/lib/hive/lib
$ sudo ln -s hive-hbase-handler-0.8.1.jar hive-hbase-handler.jar

$ sudo vim /etc/hive/conf/hive-site.xml
新增或更改如下配置

<property>
  <name>hive.hwi.war.file</name>
  <value>/usr/lib/hive/lib/hive-hwi-0.8.1.war</value>
  <description>This is the WAR file with the jsp content for Hive Web Interface</description>
</property>

<property>
  <name>hive.aux.jars.path</name>
  <value>file:///usr/lib/hive/lib/hive-hbase-handler-0.8.1.jar,file:///usr/lib/hbase/hbase-0.90.4-cdh3u3.jar,file:///usr/lib/zookeeper/zookeeper-3.3.4-cdh3u3.jar,file:///usr/lib/hbase/lib/guava-r06.jar</value>
</property>

不过这样,可能会带来Hive的一些问题,
错误信息类似下面:
message:org.apache.hadoop.hbase.MasterNotRunningException

这里,是因为升级过后的Hive的hbase包依赖关系不对,做以下处理即可
$ sudo cp /usr/lib/hbase/hbase-0.90.4-cdh3u3.jar /usr/lib/hive/lib/
$ sudo cp /usr/lib/hbase/hbase-0.90.4-cdh3u3-tests.jar /usr/lib/hive/lib/

$ sudo cp /usr/lib/hive-0.7.1/lib/mysql-connector-java-5.1.22-bin.jar /usr/lib/hive/lib

$ cd /usr/lib/hive/lib
$ sudo mv hbase-0.89.0-SNAPSHOT.jar /tmp/
$ sudo mv hbase-0.89.0-SNAPSHOT-tests.jar /tmp/

$ cd /usr/lib/hive
$ sudo mv conf conf_bak
$ sudo ln -s /etc/hive/conf conf

重建数据库表结构
mysql> DROP DATABASE metastore;
mysql> CREATE DATABASE metastore;
mysql> USE metastore;
mysql> SOURCE /usr/lib/hive/scripts/metastore/upgrade/mysql/hive-schema-0.8.0.mysql.sql;

最后重启Hive
$ sudo /etc/init.d/hadoop-hive-server restart

,

  1. No comments yet.
(will not be published)
*