分享

hive版本升级问题

levycui 发表于 2015-10-11 11:23:32 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 3 17116
请问 hadoop 2.4 与 hive0.14兼容吗?  谁知道官网的兼容列表url

目前生产环境 我们使用的hadoop2.4+hive0.13,使用ambari管理的,现在需要升级hive到0.14,如何进行hive升级操作。

指点下,谢谢。

已有(3)人评论

跳转到指定楼层
Alkaloid0515 发表于 2015-10-11 14:29:24
下面仅供参考
Hive升级至0.13


一、升级MetaStore
1.更新hive源码
    git checkout -b release-0.13.0 release-0.13.0
2.编译hive
    export MAVEN_OPTS=-Xmx512m
    mvn package -Phadoop-1,dist -Dmaven.test.skip=true
3.配置Hive
    1.cp hive-default.xml.template hive-site.xml
    2.cp hive-log4j.properties.template hive-log4j.properties
    3.配置hive-log4j.properties
        log4j.appender.EventCounter=org.apache.hadoop.metrics.jvm.EventCounter
        (解决log4j:ERROR Could not instantiate class [org.apache.hadoop.hive.shims.HiveEventCounter]. )
    4.配置hive-site.xml
        javax.jdo.option.ConnectionURL=jdbc:mysql://10.12.9.156/hivemetastore?createDatabaseIfNotExist=true
        javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
        javax.jdo.option.ConnectionUserName=root
        javax.jdo.option.ConnectionPassword=123456
        hive.metastore.warehouse.dir=/user/hive/warehouse
    5.配置hive-config.sh
        export HADOOP_HEAPSIZE=${HADOOP_HEAPSIZE:-4096}
        (默认最大对内存256M)
    6.其他
        删除lib/hbase/lib/libthrift-0.8.0.jar
        (解决java.lang.NoSuchMethodError: org.apache.thrift.EncodingUtils.setBit(BIZ)B)
二、升级DataDir
1.对于lib中的hive jar文件,用高版本替换低版本
2.对于lib中的hcatlog jar文件,用高版本替换低版本
3.配置hive-site.xml
    hive.metastore.uris=http://10.12.9.156:9083
    hive.metastore.warehouse.dir=/user/hive/warehouse
4.配置hive-log4j.properties
    cp hive-log4j.properties.debug hive-log4j.properties
    (解决log4j:ERROR Could not instantiate class [org.apache.hadoop.hive.shims.HiveEventCounter])
三、升级数据库
1.停掉所有MetaStore对Mysql的连接
2.备份老数据库
    mysqldump -h10.11.210.198 -uwap -ptiantianxiangshang hivemetastore >hivemetastore.sql
    mysqldump --skip-add-drop-table --no-data -h10.11.210.198 -uwap -ptiantianxiangshang hivemetastore >hivemetastore_schema.sql
3.更新数据库
    cd scripts/metastore/upgrade/mysql/
    mysql -hlocalhost -uroot -p123456 -e"use hivemetastore; source upgrade-0.12.0-to-0.13.0.mysql.sql;"
四、启动MetaStore
1.启动MetaStore
    hive --service metastore
2.测试DataDir
    datadir hive -e "select uuid, query from custom.commonc_pc_pv where logdate=2014050800 limit 20"

回复

使用道具 举报

levycui 发表于 2015-10-12 19:09:01
升级完成了,分享下经验:
环境:
ambari 1.7 、hive0.13

升级方法:

备份mysql数据库(重要,出现问题回滚)
mysqldump -u hive -phive hive >> hive013_hive.sql
mysqldump -u root -proot --ignore-table=mysql.event mysql >> hive013_mysql.sql

ambari关闭hive metastore、hiveserver2、webhcatserver

查看ambari安装hive的默认位置:

[root@nn02 apache-hive-0.14.0-bin]# whereis hive
hive: /usr/bin/hive  /etc/hive  /usr/lib/hive  /usr/share/man/man1/hive.1.gz

[root@nn02 hive]# ll /usr/bin/hive
-rwxr-xr-x 1 root root 481 Oct 25  2014 /usr/bin/hive

[root@nn02 hive]# cd /usr/lib/
[root@nn02 lib]# ll
drwxr-xr-x  5 root root 4096 Sep 24 09:46 hive
drwxr-xr-x  7 root root 4096 Sep 24 09:46 hive-hcatalog

[root@nn02 lib]# cd hive

[root@nn02 hive]# pwd

/usr/lib/hive
[root@nn02 hive]# ll
total 12
drwxr-xr-x 3 root root 4096 Sep 24 09:46 bin
lrwxrwxrwx 1 root root   14 Sep 24 09:46 conf -> /etc/hive/conf
drwxr-xr-x 4 root root 4096 Sep 24 10:06 lib
drwxr-xr-x 3 root root 4096 Sep 24 09:46 scripts
----------------------------

解压hive0.14文件
tar -zxvf /usr/lib/apache-hive-0.14.0-bin.tar.gz .

修改hive目录名字
mv /usr/lib/hive /usr/lib/hive_version_013.bak (重要,出现问题回滚)
mv /usr/lib/apache-hive-0.14.0-bin /usr/lib/hive

rm /usr/lib/apache-hive-0.14.0-bin/conf
ln –s /etc/hive/conf  conf

原配置不用修改

/usr/bin/hive  /etc/hive

-----------------------------
升级mysql结构,执行:
[root@nn02 mysql]# mysql -uhive -phive hive <upgrade-0.13.0-to-0.14.0.mysql.sql
Upgrading MetaStore schema from 0.13.0 to 0.14.0
Finished upgrading MetaStore schema from 0.13.0 to 0.14.0

从ambari中启动hive即可。

Hive客户端也需要升级下。

http://blog.chinaunix.net/uid-25691489-id-5211961.html
回复

使用道具 举报

s060403072 发表于 2015-10-12 19:43:16
学习了,顶楼主
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条