在本地虚拟机中安装伪分布式的hbase
首先去官网下载
https://www-us.apache.org/dist/hbase/2.1.1/hbase-2.1.1-bin.tar.gz
下载完后解压
之后需要修改两个配置文件
hbase-env.sh
export JAVA_HOME=/apps/soft/java/jdk1.8.0_161
export HBASE_CLASSPATH=/apps/soft/hbase-2.1.1
export HBASE_MANAGES_ZK=false
将 HBASE_MANAGES_ZK 设置为false 使用外部的zookeeper
之后修改 hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://hadoop:8020/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>www.codeguoj.cn</value>
</property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
<description>
Controls whether HBase will check for stream capabilities (hflush/hsync).
Disable this if you intend to run on LocalFileSystem, denoted by a rootdir
with the 'file://' scheme, but be mindful of the NOTE below.
WARNING: Setting this to false blinds you to potential data loss and
inconsistent system state in the event of process and/or node failures. If
HBase is complaining of an inability to use hsync or hflush it's most
likely not a false positive.
</description>
</property>
<property>
<name>hbase.master.info.port</name>
<value>60010</value>
</property>
</configuration>
之后进入到bin 目录下 有个start-hbase.sh 运行即可
启动成功后可以通过 ui 或者jps 查看是否启动成功
[root@hadoop bin]# jps
2340 RunJar
1511 DataNode
1864 ResourceManager
1706 SecondaryNameNode
5690 Jps
1406 NameNode
1966 NodeManager
5118 HMaster
5246 HRegionServer
[root@hadoop bin]#