Langkah-langkah Set Up HBase


Pada artikel "HBase:Hyper NoSQL Database" telah saya bahas dengan cukup detail tentang apa itu HBase mulai dari definisi, struktur data, arsitektur hingga keunggulan yang dimilikinya. Kali ini tiba saatnya untuk membahas step by step set up HBase untuk bisa memakai HBase dan merasakan performanya secara langsung.

1. Hal-hal yang harus disiapkan terlebih dahulu
              1) PC dengan OS Linux (kali ini kita pakai CentOS-6.2 64 Bit)
              2) Hadoop-1.0.4 (Silakan pilih salah satu mode Hadoop sbb)
                 - InstallHadoop Mode Pseudo Distributed
                 - Installhadoop Mode Fully Distributed
              3) Open JDK-1.7.0_09-icedtea 64 Bit

2. Set up mode Standalone
              1) Download HBase-0.94.5.tar.gz
              2) Extract HBase-0.94.5.tar.gz
              3) Set JAVA_HOME
                 - buka file hbase-0.94.5/conf/hbase-env.sh dan tambahkan baris berikut
                  export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64

              4) Biar lebih praktis, kita set saja binary directory hbase pada command-line path
                  export HBASE_HOME=/home/hadoop/hbase-0.94.5
                  export PATH=$PATH:$HBASE_HOME/bin
             5) Start HBase dengan command berikut:
                  $ start-hbase.sh
              6) Start HBase Shell dengan command berikut, kemudian kita coba membuat table dengan nama 'testTable' yang memiliki satu column family 'colFam1'
                  $ hbase shell


    HBase Shell; enter 'help<RETURN>' for list of supported commands.
 Type "exit<RETURN>" to leave the HBase Shell
 Version 0.94.5, r1443843, Fri Feb  8 05:51:25 UTC 2013
 hbase(main):001:0> create 'testTable', 'colFam1'
 0 row(s) in 2.0330 seconds

 hbase(main):002:0> list
    TABLE                                                                                                                                                  
 testTable                                                                                                                                                                                                     
 1 row(s) in 0.0320 seconds

 hbase(main):003:0> put 'testTable', 'row1', 'colFam1:col1', 'value1'
 0 row(s) in 0.1090 seconds

 hbase(main):004:0> put 'testTable', 'row2', 'colFam1:col2', 'value2'
 0 row(s) in 0.0080 seconds

 hbase(main):005:0> put 'testTable', 'row3', 'colFam1:col3', 'value3'
 0 row(s) in 0.0080 seconds

 hbase(main):006:0> scan 'testTable'
 ROW                                                  COLUMN+CELL                                                                                                                                               
 row1                                                column=colFam1:col1, timestamp=1361870571841, value=value1                                                                                               
 row2                                                column=colFam1:col2, timestamp=1361870618755, value=value2                                                                                               
 row3                                                column=colFam1:col3, timestamp=1361870639961, value=value3                                                                                               
 3 row(s) in 0.0500 seconds

 hbase(main):007:0> disable 'testTable'
 0 row(s) in 2.0920 seconds

 hbase(main):008:0> drop 'testTable'
 0 row(s) in 1.1430 seconds

 hbase(main):009:0> exit


             7) Shutdown HBase dengan command sbb:
                  $ stop-hbase.sh

3. Set up mode Fully Distributed
              Untuk meng-upgrade HBase dari mode Standalone ke mode Fully Distributed, silakan ikuti langkah-langkah sbb:
              1) Edit file hbase-0.94.5/conf/hbase-site.xml seperti contoh berikut:
<configuration>

<property>
        <name>hbase.rootdir</name>
        <value>hdfs://master:54310/hbase</value>
        <description>
        The directory shared by RegionServers.
        </description>
</property>
hbase.rootdir adalah root directory HBase pada HDFS yang akan digunakan oleh RegionServers untuk menyimpan regions (files).
<property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
        <description>
                        The mode the cluster will be in. Possible values are false: standalone and pseudo-distributed setups with managed Zookeeper true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
        </description>
</property>
<value>true</value> berarti HBase dijalankan dengan mode Fully Distributed.
<property>
        <name>hbase.zookeeper.quorum</name>
        <value>
                cssec164.nda.ac.jp,cssec149.nda.ac.jp,cssec154.nda.ac.jp
        </value>
        <description>
        Comma separated list of servers in the ZooKeeper Quorum. By default this is set to localhost for local and pseudo-distributed modes of operation. For a fully-distributed setup, this should be set to a full list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh, this is the list of servers which we will start/stop Zookeeper on.
        </description>
</property>
Cantumkan komputer-komputer yang akan digunakan sebagai ZooKeeper. Jumlahnya harus ganjil.
<property>
         <name>hbase.zookeeper.property.dataDir</name>
         <value>/home/hadoop/zookeeper</value>                         <description>
          Property from ZooKeeper's config zoo.cfg. The directory where the snapshot is stored.
         </description>
</property>
Siapkan satu directory untuk menyimpan snapshot ZooKeeper.
<property>
         <name>hbase.master.info.bindAddress</name>
         <value>10.35.2.85</value>
         <description>
         The bind address for the HBase Master web UI
         </description>
</property>
Cantumkan IP address komputer yang berperan sebagai HMaster.
</configuration>


              2) Edit file hbase-0.94.5/conf/regionservers
              Cantumkan IP address atau hostname dari komputer-komputer yang berperan sebagai region server. Dalam hal ini kita bisa menggunakan komputer yang menjadi datanode pada HDFS. Contohnya:
              slave1
              slave2
              3)Setting pada ZooKeeper
              HBase bergantung pada cluster ZooKeeper yang telah di-set up sebelumnya. Secara default, HBase akan me-manage sendiri cluster ZooKeeper yang akan digunakannya tanpa harus kita sendiri yang menyiapkannya. Dengan demikian, cluster ZooKeeper akan menjadi bagian dari proses start dan shutdown HBase. Setiap kali HBase di-start atau di-shutdown, secara otomatis ZooKeeper juga akan di-start atau dimatikan
              4) Setting HDFS client.
              Setting file HDFS (hadoop-1.0.4/conf/hdfs-site.xml) harus bisa diakses dari configuration directory HBase (hbase-0.94.5/conf). Salah satu caranya adalah dengan menggunakan symlinks. Buat file bernama hdfs-site.xml pada configuration directory HBase, dan kemudian symlinks-kan file tersebute ke setting file HDFS. Contohnya sbb:
Anggap saja setting file HDFS adalah : /home/hadoop/hadoop-1.0.4/conf/hdfs-site.xml
Command symlinks-nya adalah:
              $ ln -s /home/hadoop/hadoop-1.0.4/conf/hdfs-site.xml ./hdfs-site.xml
Jalankan command diatas dari configuration directory HBase.
              5) Berikut adalah port number yang digunakan secara default oleh HBase. Pastikan setting firewall pada linux telah mengijinkan akses pada port-port tsb.
             
① 2181                :ZooKeeper client port.
② 2888                :ZooKeeper peers port.
③ 3888                :ZooKeeper leader election port.
④ 60000               :HBase Master port.
⑤ 60010               :HBase Master web UI port.
⑥ 60020               :HBase RegionServer port.
⑦ 60030               :HBase RegionServer web UI port.
⑧ 8080                :HBase REST server port.

              6) Start HBase
                $ start-hbase.sh
                Jika HBase berjalan normal, maka HMaster akan bisa diakses melalui web browser dengan menunjuk IP address dan port number-nya:
                       http://10.35.2.85:60010/master-status



Gambar 1. Tampilan status HMaster pada web browser.

Demikian penjelasan singkat tentang set up HBase baik mode Standalone maupun mode Fully Distributed. Selamat mencoba! 

Comments

Revathi said…
Thanks for sharing such informative guide on .Net technology. This post gives me detailed information about the .net technology. keep it up!!
android training in chennai

android online training in chennai

android training in bangalore

android training in hyderabad

android Training in coimbatore

android training

android online training

An amazing, simple-to-utilize video proofreader for Windows. With the Movavi Video Editor Crack, you can unfasten portions of video clasps!! Movavi Video Editor Crack Download For Pc

Popular posts from this blog

Apa itu Big Data : Menyimak Kembali Definisi Big Data, Jenis Teknologi Big Data, dan Manfaat Pemberdayaan Big Data

Tutorial Python: Cara Mudah Web Scraping menggunakan Beautiful Soup

Apache Spark: Perangkat Lunak Analisis Terpadu untuk Big Data

MapReduce: Besar dan Powerful, tapi Tidak Ribet

HBase: Hyper NoSQL Database

Validitas Rapid Test Covid 19 : Accuracy vs F1-Score, Pilih yang Mana?

Aplikasi iPhone : RETaS Read English Tanpa Kamus!

Big Data dan Rahasia Kejayaan Google

HDFS: Berawal dari Google untuk Big Data

Cara Sederhana Install Hadoop 2 mode Standalone pada Windows 7 dan Windows 10