HBase on Ubuntu VM

HBase – Standalone Mode

wget http://mirrors.advancedhosters.com/apache/hbase/0.98.17/hbase-0.98.17-hadoop2-bin.tar.gz
tar -zxvf hbase-0.98.17-hadoop2-bin.tar.gz
mv hbase-0.98.17-hadoop2/ hbase/
sudo mv hbase/ /usr/local/hbase

hbase-env.sh

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export HBASE_OPTS=”-XX:+UseConcMarkSweepGC”
export HBASE_REGIONSERVERS=${HBASE_HOME}/conf/regionservers
export HBASE_MANAGES_ZK=true

 

hbase-site.xml

<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://127.0.0.1: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>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/gudiseva/hbase/zookeeper</value>
</property>
</configuration>

regionservers

localhost

Starting HBase Server

$ cd /usr/local/hbase/bin/
$ ./start-hbase.sh
$ hadoop fs -ls /hbase

 

Starting HBase Shell

$ hbase shell

hbase(main) > list
hbase(main) > create ’emp’, ‘personal_data’, ‘professional_data’

hbase(main) > put ’emp’,’1′,’personal_data:name’,’raju’
hbase(main) > put ’emp’,’1′,’personal_data:city’,’hyderabad’
hbase(main) > put ’emp’,’1′,’professional_data:designation’,’manager’
hbase(main) > put ’emp’,’1′,’professional_data:salary’,’50000′
hbase(main) > put ’emp’,’row1′,’personal_data:city’,’Delhi’
hbase(main) > scan ’emp’
hbase(main) > put ’emp’,’1′,’personal_data:city’,’Delhi’
hbase(main) > get ’emp’, ‘1’
hbase(main) > delete ’emp’, ‘row1’, ‘personal_data:city’
hbase(main) > count ’emp’
hbase(main) > truncate ’emp’
hbase(main) > disable ’emp’
hbase(main) > drop ’emp’

References:

http://www.bogotobogo.com/Hadoop/BigData_hadoop_HBase_Pseudo_Distributed.php
http://www.tutorialspoint.com/hbase/hbase_installation.htm
http://stackoverflow.com/questions/22663484/get-error-cant-get-master-address-from-zookeeper-znode-data-null-when-us [Very Important]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s