1.编辑 conf/hbase-env.sh来告知HBase java的安装路径.在这个文件里你还可以设置HBase的运行环境,诸如 heapsize和其他 JVM有关的选项, 还有Log文件地址,等等. 设置 JAVA_HOME指向 java安装的路径.
2.
运 行HBase需要设置hbase.rootdir 属性.该属性是指HBase在HDFS中使用的目录的位置。例如,要想 /hbase 目录,让 namenode 监听locahost的9000端口,只有一份数据拷贝(HDFS默认是3份拷贝)。可以在 hbase-site.xml 写上如下内容
<configuration> ... <property> <name>hbase.rootdir</name> <value>hdfs://localhost:9000/hbase</value> <description>The directory shared by RegionServers. </description> </property> <property> <name>dfs.replication</name> <value>1</value> <description>The replication count for HLog & HFile storage. Should not be greater than HDFS datanode count. </description> </property> ... </configuration>
---------------------------------------------实际我的配置:
1.编辑 conf/hbase-env.sh
# The java implementation to use. Java 1.6 required.
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_67
export HBASE_HOME=/home/hadoop/hbase-0.98
2.
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>The replication count for HLog & HFile storage. Should not be greater than HDFS datanode count.
</description>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
</property></configuration>
完成,验证:
- 启动hadoop后再启动hbase
- http://localhost:60010/ 为master web UI