一直想搭建HBase单节点开发测试环境,今天实践了一下。经过摸索,终于HBase现在可以在windows下安装,而且不需要cygwin。
hadoop2.7.6安装:hadoop在window下安装
Hbase版本:hbase-1.2.6
HBase和Hadoop的对照表
通过对照表可知:hadoop2.7.6 支持hbase1.2.6
开始安装
1 下载HBase1.2.6
解压 D:\Soft\hbase-1.2.6 ,目录随意
2 修改配置文件 hbase-site.xml
D:\Soft\hbase-1.2.6\conf\hbase-site.xml
扫描二维码关注公众号,回复:
1832428 查看本文章
<?
xml
version=
"1.0"
?>
<?
xml-stylesheet
type=
"text/xsl"
href=
"configuration.xsl"
?>
<
configuration
>
<
property
>
<!-- hbase提供的服务地址-->
<
name
>hbase.master
</
name
>
<
value
>localhost:6000
</
value
>
</
property
>
<
property
>
<
name
>hbase.master.maxclockskew
</
name
>
<
value
>180000
</
value
>
</
property
>
<
property
>
<!-- hbase在hdfs里的目录 -->
<
name
>hbase.rootdir
</
name
>
<
value
>hdfs://localhost:9000/hbase
</
value
>
</
property
>
<
property
>
<
name
>hbase.cluster.distributed
</
name
>
<
value
>false
</
value
>
</
property
>
<
property
>
<!-- ZK的主机地址 -->
<
name
>hbase.zookeeper.quorum
</
name
>
<
value
>localhost
</
value
>
</
property
>
<
property
>
<!-- hbase在ZK上保存数据的目录 -->
<
name
>hbase.zookeeper.property.dataDir
</
name
>
<
value
>/hbase
</
value
>
</
property
>
<
property
>
<
name
>dfs.replication
</
name
>
<
value
>1
</
value
>
</
property
>
</
configuration
>
3 修改运行环境 hbase-env.cmd
D:\Soft\hbase-1.2.6\conf\hbase-env.cmd
配置JDK
@
rem
The java implementation to use. Java 1.7+ required.
@
rem
set JAVA_HOME=c:\apps\java
set JAVA_HOME=D:\Soft\java\jdk1.8.0_151
4 HBase配置完毕
5 启动hadoop
进入hadoop安装目录D:\Soft\hadoop-2.7.6\sbin,打开cmd,执行 start-all.cmd
6 启动HBase
进入HBase安装目录D:\Soft\hbase-1.2.6\bin,打开cmd,执行 start-hbase.cmd
7 启动HBase的rest服务
进入HBase安装目录D:\Soft\hbase-1.2.6\bin,打开cmd,hbase rest start -p 6000
访问"http://localhost:8085/rest.jsp
8 启动HBase Shell
进入HBase安装目录D:\Soft\hbase-1.2.6\bin,打开cmd,hbase shell
测试shell命令
9 Hadoop中查看hbase节点