疑似分散Hadoopクラスターに基づく疑似分散HBASEクラスターの構築


序文

この記事の目的は、疑似分散Hadoopクラスターに基づいて疑似分散HBASEクラスターを構築し、Baidu Smart CloudServerに基づいて疑似分散Hadoopクラスターを構築するための疑似分散Hadoopクラスター環境チュートリアルを構築することです。

動作環境

1、CentOS / 7.9 x86_64(64ビット)

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

ファイルの最後で挿入を押して、次のように入力します

#hbase
export HBASE_HOME=/software/hbase
export PATH=$HBASE_HOME/bin:$PATH

escを押して入力します:wdそしてEnterを押します

テスト結果

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そしてEnterを押します

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そしてEnterを押します

mkdir -p /software/data/tmp/zookeeper-hbase

regionserversファイルを構成します

vi regionservers

ファイルの内容を次のように変更します。

localhost 

クラスターを開始します

HBASEを起動する前にHadoopを起動する必要があり
ここに画像の説明を挿入
ます。図に示すように、jpsで確認して次のステップに進むことができます。

cd /software/hbase/bin/
./start-hbase.sh

図に示すように、起動は成功しています
ここに画像の説明を挿入

クラスターwebUIインターフェースを表示する

http://IP:16010/master-status

成功した場合は、図のようになります
ここに画像の説明を挿入

HBASEクラスターの最初の経験

クライアントを起動します

hbase shell

既存のテーブルを表示する

list

結果は次のとおりです。
ここに画像の説明を挿入

列クラスターmycfを使用してテーブルtbを作成します

create 'tb','mycf'  

テスト結果

list

結果は次のとおりです。
ここに画像の説明を挿入

おすすめ

転載: blog.csdn.net/qq_44843672/article/details/114242174