基于伪分布式Hadoop集群搭建伪分布式HBASE集群
前言
本文目的在于基于伪分布式Hadoop集群搭建伪分布式HBASE集群,搭建伪分布式Hadoop集群环境教程为基于百度智能云服务器搭建伪分布式Hadoop集群
运行环境
1、CentOS / 7.9 x86_64 (64bit)
2、jdk-8u281-linux-x64
3、hadoop-2.7.6
4、hbase-2.2.0
解压HBASE
cd /software/
tar -zxvf /download/hbase-2.2.0-bin.tar.gz
mv hbase-2.2.0/ hbase
配置HBASE
配置系统变量
vi /etc/profile
按文件末尾按insert,输入以下内容
#hbase
export HBASE_HOME=/software/hbase
export PATH=$HBASE_HOME/bin:$PATH
按esc输入:wd按回车
检验结果
hbase version
如果成功结果如下
配置hbase-env.sh文件
cd hbase/conf/
vi hbase-env.sh
export JAVA_HOME=/software/jdk
export HBASE_CLASSPATH=/software/hbase/conf
export HBASE_MANAGES_ZK=true
按esc输入:wd按回车
配置hbase-site.xml
cd hbase/conf/
vi 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.master</name>
<value>localhost</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/software/data/tmp/zookeeper-hbase</value>
</property>
</configuration>
按esc输入:wd按回车
mkdir -p /software/data/tmp/zookeeper-hbase
配置regionservers文件
vi regionservers
修改文件内容为:
localhost
启动集群
启动HBASE前需先启动Hadoop,可用jps检查
如图所示即可进行下一步
cd /software/hbase/bin/
./start-hbase.sh
如图所示即为启动成功
扫描二维码关注公众号,回复:
12616557 查看本文章
查看集群webUI界面
http://IP:16010/master-status
如成功即为如图所示
HBASE集群初体验
启动客户端
hbase shell
查看现有表
list
结果如下:
创建一张表tb,表中含有一个列簇mycf
create 'tb','mycf'
检查结果
list
结果如下: