HBase single pseudo-distributed installation

Copyright: https: //shirukai.github.io/ | https://blog.csdn.net/shirukai/article/details/85212747

HBase single pseudo-distributed installation

Release Notes:

hadoop-2.7.6

zookeeper-3.4.13

hbase-2.1.0

1 download the installation package

Official website address: http://hbase.apache.org/downloads.html

1.1 Download the installation package

In the official website to download the appropriate version of the application, it is downloaded here hbase-2.1.0 version.

wget http://mirror.bit.edu.cn/apache/hbase/2.1.0/hbase-2.1.0-bin.tar.gz

1.2 unzip and rename

Extract the downloaded installation package

tar -zxvf hbase-2.1.0-bin.tar.gz

Rename hbase-2.1.0

mv hbase-2.1.0-bin hbase-2.1.0

2 Environmental Parameters Configuration

Set Environment Variables 2.1 HBASE_HOME

Add the environment variable to HBase

vi ~/.base_profile

Add Content:

#set hbase
export HBASE_HOME=/Users/shirukai/apps/hbase-2.1.0
export PATH=$HBASE_HOME/bin:$PATH

2.2 modify the parameters HBase

Enter the configuration directory of HBase

cd $HBASE_HOME/conf

2.2.1 modify hbase-env.sh

The document is mainly a number of environmental parameters hbase started, this is mainly the following modifications:

# 导出JAVA_HOME
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home
# 不使用HBase管理ZK
export HBASE_MANAGES_ZK=false

2.2.2 modify hbase-site.xml

This file is hbase configuration file, main changes are:

 <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:2181</value>
  </property>

2.2.3 modify regionservers

Add all of regionserver the hostname to this file, because we are so only a single pseudo-distributed regionserver is localhost, without modification here

localhost

3 Start the test

Before you start HBase, we want to ensure that our hdfs, zookeeper out on state.

3.1 start HBase

sh $HBASE_HOME/bin/start-hbase.sh

3.2 Test

jps see whether the process started

jps

View web ui

Visit http: // localhost: 16010

Start hbase shell

hbase shell

View the version number

hbase(main):003:0> version
2.1.0, re1673bb0bbfea21d6e5dba73e013b09b8b49b89b, Tue Jul 10 17:26:48 CST 2018
Took 0.0004 seconds

View current status

hbase(main):004:0> status
1 active master, 0 backup masters, 1 servers, 0 dead, 3.0000 average load
Took 0.6481 seconds

Creating a table

hbase(main):005:0> create 'table1','name','age'
Created table table1
Took 0.8107 seconds                                                                                                                                                         
=> Hbase::Table - table1

View table describes

hbase(main):006:0> describe 'table1'
Table table1 is ENABLED                                                                                                                                                     
table1                                                                                                                                                                      
COLUMN FAMILIES DESCRIPTION                                                                                                                                                 
{NAME => 'age', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NEW_VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DATA_ON_WRITE => 'false', DATA_BLOC
K_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', CACHE_INDEX_ON_WRITE => 'false', IN_MEMORY => 'false', CACHE_BL
OOMS_ON_WRITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE => '65536'}                                            
{NAME => 'name', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NEW_VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DATA_ON_WRITE => 'false', DATA_BLO
CK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', CACHE_INDEX_ON_WRITE => 'false', IN_MEMORY => 'false', CACHE_B
LOOMS_ON_WRITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE => '65536'}                                           
2 row(s)
Took 0.1657 seconds 

Guess you like

Origin blog.csdn.net/shirukai/article/details/85212747