背景
我们已经搭建了HA高可用的hdfs集群,现在要在hdfs集群的基础上搭建hbase集群。可以看我之前的一篇hdfs集群搭建,
https://blog.csdn.net/fantasticqiang/article/details/80707837
自行官网下载hbase,我这里选用1.2.3版本
修改hbase配置文件
1. hbase-env.sh
//#配置一下JAVA环境
export JAVA_HOME=/usr/local/jdk
//# Tell HBase whether it should manage it's own instance of Zookeeper or not.
export HBASE_MANAGES_ZK=false
2. hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<configuration>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://mycluster/hbase</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>es02:2181,es03:2181,es04:2181</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/hadoop/zk/data</value>
</property>
</configuration>
3. 配置regionservers,regionserver的节点
es02
es03
es04
注意事项
由于hdfs配置了HA高可用,我们在hadoop的hdfs-site.xml中配置了"dfs.nameservices"的名称“mycluster”他下面有两个名称节点“nn1,nn2”,我们需要把hadoop中的hdfs-site.xml和core-site.xml放到hbase目录下的conf文件夹中,不然hbase集群在启动的时候会报"unkonwHostException"。
启动测试
//启动命令
start-hbase.sh
登录webUI 查看