Building a pseudo-distributed HBASE cluster based on a pseudo-distributed Hadoop cluster
Preface
The purpose of this article is to build a pseudo-distributed HBASE cluster based on a pseudo-distributed Hadoop cluster, and build a pseudo-distributed Hadoop cluster environment tutorial to build a pseudo-distributed Hadoop cluster based on Baidu Smart Cloud Server
Operating environment
1、CentOS / 7.9 x86_64 (64bit)
2、jdk-8u281-linux-x64
3、hadoop-2.7.6
4、hbase-2.2.0
Unzip HBASE
cd /software/
tar -zxvf /download/hbase-2.2.0-bin.tar.gz
mv hbase-2.2.0/ hbase
Configure HBASE
Configure system variables
vi /etc/profile
Press insert at the end of the file and enter the following
#hbase
export HBASE_HOME=/software/hbase
export PATH=$HBASE_HOME/bin:$PATH
Press esc to enter: wd and press enter
test result
hbase version
If successful, the result is as follows
Configure the hbase-env.sh file
cd hbase/conf/
vi hbase-env.sh
export JAVA_HOME=/software/jdk
export HBASE_CLASSPATH=/software/hbase/conf
export HBASE_MANAGES_ZK=true
Press esc to enter: wd and press enter
Configure 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>
Press esc to enter: wd and press enter
mkdir -p /software/data/tmp/zookeeper-hbase
Configure the regionservers file
vi regionservers
Modify the contents of the file as:
localhost
Start the cluster
You need to start Hadoop before starting HBASE. You can check with jps
to proceed to the next step as shown
cd /software/hbase/bin/
./start-hbase.sh
As shown in the figure, the startup is successful
View the cluster webUI interface
http://IP:16010/master-status
If successful, it is as shown in the figure
First experience with HBASE cluster
Start the client
hbase shell
View existing tables
list
The results are as follows:
Create a table tb with a column cluster mycf
create 'tb','mycf'
test result
list
The results are as follows: