Install hbase on ubuntu

Keywords: HBase Zookeeper Hadoop xml

hbase introduction

HBase is a distributed, column-oriented open source database. The technology originates from Fay Chang's Google paper Bigtable: A Distributed Storage System for Structured Data. Just as Bigtable takes advantage of the distributed data storage provided by the Google File System, HBase provides Bigtable-like capabilities on top of Hadoop. HBase is a subproject of Apache's Hadoop project. Unlike general relational databases, HBase is a database suitable for unstructured data storage. Another difference is that HBase is column-based rather than row-based.
Baidu Encyclopedia

Introduction of hbase installation process

1. Download hbase

hbase download address: hbase download address
Unzip the hbase compressed package into the / opt directory and display the following information:

hadoop@hzwy23:/opt/hbase-1.3.0$ pwd
/opt/hbase-1.3.0
hadoop@hzwy23:/opt/hbase-1.3.0$ ls
bin  CHANGES.txt  conf  docs  hbase-webapps  LEGAL  lib  LICENSE.txt  logs  NOTICE.txt  README.txt  zookeeper.out

2. Download zookeeper

Download address: zookeeper official download address
Unzip the downloaded compressed package into the / opt directory.

hadoop@hzwy23:/opt/zookeeper-3.4.9$ ls
bin          conf        docs             lib          README_packaging.txt  src                      zookeeper-3.4.9.jar.md5
build.xml    contrib     ivysettings.xml  LICENSE.txt  README.txt            zookeeper-3.4.9.jar      zookeeper-3.4.9.jar.sha1
CHANGES.txt  dist-maven  ivy.xml          NOTICE.txt   recipes               zookeeper-3.4.9.jar.asc
hadoop@hzwy23:/opt/zookeeper-3.4.9$ pwd
/opt/zookeeper-3.4.9

Modify the user environment variable ~/. profile file and add the following information at the end of the file:

export ZOOKEEPER_HOME=/opt/zookeeper-3.4.9
export PATH=$PATH:$ZOOKEEPER_HOME/bin
export HBASE_HOME=/opt/hbase-1.3.0
export PATH=$PATH:$HBASE_HOME/bin

Next, source the configuration file for the environment variable to take effect:

source ~/.profile

3. Modify the hbase configuration file

Modify $HBASE_HOME/conf/hdfs-site.xml and modify the contents of the configuration as follows:

<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://localhost:9000/hbase</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
</configuration>

4. Start zookeeper and hbase services

Start zookeeper first.

cd $ZOOKEEPER_HOME/bin
./zkServer.sh start
jps

If the QuorumPeerMain process is found in the jvm process, zookeeper starts successfully.

5. Start the hbase service

cd $HBASE_HOME/bin
./start-hbase.sh
jps

If there is an HMaster in the jvm, the HRegionServer process indicates that hbase started successfully.

5. Verify hbase

Enter the hbase interface through the shell.

hbase shell

Create a people table with the field name, age, gender.

hbase(main):001:0> create 'people','name','age','gender';

Adding data to tables

hbase(main):028:0> put 'people','huang','age','gender:man'

Query the data in the people table

hbase(main):029:0> get 'people','huang','age'
COLUMN                                CELL                                                                                                      
 age:                                 timestamp=1487258719121, value=gender:man                                                                 
 age:24                               timestamp=1487258624676, value=man                                                                        
1 row(s) in 0.0140 seconds

Detailed hbase operation manual, please refer to the official documents.

Posted by expert_21 on Fri, 29 Mar 2019 11:27:29 -0700