Hive 0.10+Hbase 0.96統合使用

2766 ワード

私がやったのはHive 0.10+Hbase 0.96の統合で、他のバージョンの統合プロセスもあまり悪くありません.
一.hiveのプロファイルconf/hive-site.xmlを変更する
javax.jdo.option.ConnectionURL jdbc:mysql://192.168.35.59:3306/hive?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName hive javax.jdo.option.ConnectionPassword hive123            hive.querylog.location            /usr/local/test/hive-0.10.0-bin/logs               
  hive.aux.jars.path
  file:///usr/local/test//lib/hive-hbase-handler-0.13.0.jar, file:///usr/local/test/hive-0.10.0-bin/lib/hbase-client-0.96.1.1-hadoop2.jar,   file:///usr/local/test/hive-0.10.0-bin/lib/hbase-common-0.96.1.1-hadoop2.jar,   file:///usr/local/test/hive-0.10.0-bin/lib/hbase-common-0.96.1.1-hadoop2-tests.jar,   file:///usr/local/test/hive-0.10.0-bin/lib/hbase-protocol-0.96.1.1-hadoop2.jar,   file:///usr/local/test/hive-0.10.0-bin/lib/hbase-server-0.96.1.1-hadoop2.jar,           file:///usr/local/test/hive-0.10.0-bin/lib/htrace-core-2.01.jar,   file:///usr/local/test/hive-0.10.0-bin/lib/zookeeper-3.4.5.jar,   file:///usr/local/test/hive-0.10.0-bin/lib/protobuf-java-2.5.0.jar,   file:///usr/local/test/hive-0.10.0-bin/lib/guava-12.0.1.jar

二.hiveプロファイルhive.aux.jars.pathに関連するjarパケットをhbaseのlibディレクトリからhiveのlibディレクトリにコピーし、他のhbaseのlibディレクトリの下に関連しないすべてのhbaseの先頭のjarパケットもhbaseのlibディレクトリにコピーする       hiveのlibディレクトリの下で、hive libディレクトリの下にある既存のhbase-0.92.0-tests.jarとhbase-0.92.0.jarを削除し、hbaseパッケージを導入することと競合する他のパッケージも削除します.
三.hive,zookeeper 1,zookeeper 2,zookeeper 3はhbase接続zookeeperアドレスであり、デフォルトポート2181
     hiveのbinディレクトリで./hive-hiveconf hbase.zookeeper.quorum=zookeeper 1,zookeeper 2,zookeeper 3を実行
四.hiveでhbaseとの関連テーブルを作成する
       CREATE TABLE hbase_table_1(key int, value string)         STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'        WITH SERDEPROPERTIES ("hbase.columns.mapping"= ":key,cf1:val")        TBLPROPERTIES ("hbase.table.name"= "xyz");
説明:hbase.table.nameはhbaseのtable名を定義します    hbase.columns.mappingはhbaseの列族を定義する 
次のデータ操作はブログを参照してください.http://blog.csdn.net/aaaaaaaa2000/article/details/7565456
六.統合中に発生した問題
     java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/MasterNotRunningException
    hbaseのjarパケットをhiveのlibにコピーしなかったため