这是在前一篇Hadoop 3.1.1高可用(HA)集群安装笔记 基础上,进行的操作.
安装HBase
mkdir -p /opt/hbase
tar -xf hbase-2.1.0-bin.tar.gz
cd hbase-2.1.0
#添加环境变量
export HBASE_HOME=/opt/hbase/hbase-2.1.0
#修改使用集群中的zookeeper
vim conf/hbase-env.sh
export HBASE_MANAGES_ZK=false
export HBASE_CLASSPATH=/opt/hadoop/hadoop-3.1.1/etc/hadoop
export HBASE_LOG_DIR=/opt/data/logs/hbase
mkdir -p /opt/data/logs/hbase
cp /opt/hbase/hbase-2.1.0/lib/client-facing-thirdparty/htrace-core-3.1.0-incubating.jar /opt/hbase/hbase-2.1.0/lib/
vim conf/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.rootdir</name>
<value>hdfs://mycluster/hbase</value>
</property>
<!-- 分布式开关 -->
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<!-- zookeeper集群地址 -->
<property>
<name>hbase.zookeeper.quorum</name>
<value>nn01,nn02,dn01,dn02,dn03</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/opt/data/zookeeper</value>
</property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
</configuration>
vim conf/regionservers
dn01
dn02
dn03
nn01启动
start-hbase.sh
访问web页面
master | regionServer |
---|---|
http://master:16010 | http://master:16030 |
来源:oschina
链接:https://my.oschina.net/u/1028790/blog/2218580