My dev environment
Ubuntu 14.04 LTS, HBase 1.2.1, Java 8, Hadoop 2.2.0
Prerequisites:
Java. How to install: http://dmitrypukhov.pro/install-java8-on-ubuntu/
Hadoop. How to install: http://dmitrypukhov.pro/install-hadoop-on-ubuntu/
Installation steps
- Download HBase. At the time of writing this article it is 1.2.1 version: http://apache-mirror.rbc.ru/pub/apache/hbase/1.2.1/
- Extract downloaded archive to installation folder /opt/hbase/
- Edit /opt/hbase/conf/hbase-site.xml
1234567891011121314<configuration><property><name>hbase.rootdir</name><value>file:/tmp/hbase/data</value></property><property><name>hbase.zookeeper.property.dataDir</name><value>/tmp/hbase/zookeeper</value></property><property><name>zookeeper.znode.parent</name><value>/hbase</value></property></configuration> - If hdfs is stopped, start it /opt/hadoop/sbin/start-dfs.sh
- Start hbase /opt/hbase/bin/start-hbase.sh
Use HBase shell
Start it by /opt/hbase/bin/hbase shell
Run your commands
1 2 3 4 5 6 7 8 9 |
create 'person', {NAME=>'name'}, {NAME=>'addr'} put 'person', '1', 'name:firstName', 'John' put 'person', '1', 'name:lastName', 'Smith' put 'person', '1', 'addr:planet', 'Earth' put 'person', '1', 'addr:continent', 'Australia' list describe 'person' scan 'person' get 'person', '1', {COLUMNS => ['name']} get 'person', '1', {COLUMNS => ['addr:planet']} |
Pingback: Work with HBase from Spark shell | Dmitry Pukhov