参考博客:http://blog.youkuaiyun.com/daniel_ustc/article/details/12795627
在第二步编辑hive-site.xml的时候可以加入
<property>
<name>hive.zookeeper.quorum</name>
<value>host01,host02,host03</value>
</property>
这样启动时就不需要另外加参数了
创建hive的外部表以关联hbase:
CREATE EXTERNAL TABLE hbase_table_1(key string, value string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,columnfamily:col1")
TBLPROPERTIES("hbase.table.name" = "hbase_test");
另外可以在创建hive表的时候直接创建hbase的关联表
CREATE TABLE test_hbase(key int, value string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val")
TBLPROPERTIES ("hbase.table.name" = "test_hive");