HBase cluster environment installation

refer to 
http://blog.csdn.net/M_SIGNALs/article/details/52948867

 >>> hive integration with hbase ( https://cwiki.apache.org/confluence/display/Hive/HBaseIntegration )

hive/lib/   hbase/lib

1. Check whether the version of guava-12.0.1.jar is the same. If they are different, delete one, and then copy it to keep the version consistent.

2. Add a soft connection (the following jar packages may be incomplete, and can be supplemented according to the errors reported in the actual operation)

ln -s /opt/hbase/lib/hbase-common-0.98.6-cdh5.3.6.jar /opt/hive/lib/hbase-common-0.98.6-cdh5.3.6.jar

ln -s /opt/hbase/lib/hbase-server-0.98.6-cdh5.3.6.jar /opt/hive/lib/hbase-server-0.98.6-cdh5.3.6.jar

ln -s /opt/hbase/lib/hbase-client-0.98.6-cdh5.3.6.jar /opt/hive/lib/hbase-client-0.98.6-cdh5.3.6.jar

ln -s /opt/hbase/lib/hbase-protocol-0.98.6-cdh5.3.6.jar /opt/hive/lib/hbase-protocol-0.98.6-cdh5.3.6.jar

ln -s /opt/hbase/lib/hbase-it-0.98.6-cdh5.3.6.jar /opt/hive/lib/hbase-it-0.98.6-cdh5.3.6.jar

ln -s /opt/hbase/lib/htrace-core-2.04.jar /opt/hive/lib/htrace-core-2.04.jar

3.vi hive-site.xml Addition:

<property>

  <name>hbase.zookeeper.quorum</name>

  <value>master,slave1,slave2</value>

</property>

 

4. Create a table recognized by hbase:

hive>  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");

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326416751&siteId=291194637