Skip to content
MostafaOjaghi edited this page Aug 29, 2019 · 19 revisions

NOTE: Hbase compatible version is 1.2.4

Install

Download the 1.2.4 version from Link
Extract And Move To /usr/local/hbase/

Configs

.bashrc

export HBASE_HOME=/usr/local/hbase
export PATH=$PATH:$HBASE_HOME/bin

Then source ~/.bashrc

hbase-env.sh

export JAVA_HOME="/usr/lib/jvm/jdk1.8.0_211"

Tell HBase whether it should manage it's own instance of Zookeeper or not.

export HBASE_MANAGES_ZK=false

hbase-site.xml

<configuration>
        <property>
                <name>hbase.zookeeper.quorum</name>
                <value>slave1,slave2,slave3</value>
        </property>
        <property>
                <name>hbase.rootdir</name>
                <value>hdfs://master:9000/hbase</value> // maybe localhost:9000 ?!
        </property>
        <property>
                <name>hbase.cluster.distributed</name>
                <value>true</value>
        </property>
</configuration>

regionservers

put ip's of all your slaves in this file

Grant Access For Hadoop User

chown -R hadoop:hadoop /usr/local/hbase/

Change SSH Default Port hbase-env.sh

export HBASE_SSH_OPTS="-p <num>"

Create Table With Compression & Encoding

create 's',{NAME=>'l',COMPRESSION=>'LZ4',DATA_BLOCK_ENCODING=>'FAST_DIFF'}

Monitoring

put jmx_exporter.jar and config.yaml in hbase bin directory and add the following command to the conf/hbase-env.sh

if [ `lsof -n -i:9060 | grep LISTEN | wc -l` == "0" ]; then
  HBASE_OPTS="$HBASE_OPTS -javaagent:/usr/local/hbase/bin/jmx_exporter.jar=9060:/usr/local/hbase/bin/config.yaml"
fi

Clone this wiki locally