hbase 程序开发环境准备

准备环境:

1、jdk安装调试完毕

2、eclipse安装调试完毕

hbase配置

1、将如下jar文件引入工程中: hadoop-core-1.0.0.jar,hbase-0.94.0-security.jar,zookeeper-3.4.3.jar,protobuf-java-2.4.0a.jar

2、拷贝hbase运行环境中的hbase-site.xml到工程根目录下。

3、hbase-site.xml中注意以下几个配置:

 <configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://hostname:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>*.*.*.*, *.*.*.*, *.*.*.*</value>
</property>
<property skipInDoc="true">
<name>hbase.defaults.for.version</name>
<value>0.90.2</value>
</property>
</configuration>

 4、配置C:\WINDOWS\system32\drivers\hosts

将hadoop集群中添加到host的配置复制到本文件中。

 以上配置完成后客户端即可正常访问。

猜你喜欢

转载自peigang.iteye.com/blog/1628157