一、使用的jar版本
1、hbase-client:0.96.1.1-cdh5.0.0
2、spring-data-hadoop:2.2.1.RELEASE
3、Spring:4.2.1.RELEASE
二、hbase-site.xml配置
<configuration>
<property>
<name>hbase.zookeeper.quorum</name>
<value>chhliu1,chhliu2,chhliu3</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
</configuration>
注:由于
hbase
依赖了
zookeeper
,所以需要指定
zookeeper
集群的地址以及端口号,此处需在
hosts
文件中加入
chhliu1
,
chhliu2
,
chhliu3
对应的
IP
地址。
三、applicationContext配置文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:hdp="http://www.springframework.org/schema/hadoop"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spr