Showing posts with label Hbase. Show all posts
Showing posts with label Hbase. Show all posts

Friday, April 3, 2015

Hbase - How to install Hbase

@ Download
$ wget http://ftp.riken.jp/net/apache/hbase/stable/hbase-1.0.0-bin.tar.gz

@ uncompress on the [/usr/local/src]
$ tar xvf ./hbase-1.0.0-bin.tar.gz
$ mv ./hbase-1.0.0 ../hbase
$ chown -R hadoop.hadoop ./hbase/
$ cd ./hbase/conf

@ Set configuration
$ vim ./hbase-env.sh
export JAVA_HOME=/usr/local/java
export HBASE_MANAGES_ZK=false

@ Set environment variables 
$ vim ./.bash_profile
export HBASE_HOME=/usr/local/hbase
export PATH=$HBASE_HOME/bin:$PATH

@Make a public key (on hadoop user)
$ ssh-keygen -t rsa

@Copy a public key into authorized_keys in other server (on hadoop user)

@ Make a folder hbase( on Name Server)
$ cd /usr/local/hadoop/bin
$ ./hadoop fs -mkdir /hbase

@ If there are 3 server on the zookeeper.
$ vim ./hbase-site.xml
# Execute start-hbase.sh on the master Hbase <----
# You have to execute the zookeeper first

@Check URL
http://192.168.11.23:60010/master-status?filter=handler

Wednesday, January 29, 2014

Link - Hbase on Java

@ It is a very good site to Hbase on Java.
http://www.ne.jp/asahi/hishidama/home/tech/apache/hbase/Scan.html

@ How to make schema design.
http://wiki.gurubee.net/display/DEVSTUDY/NoSQL+HBase

@ Material for Hbase
http://www.google.co.kr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0CD4QFjAC&url=http%3A%2F%2Fwww.biworld.co.kr%2Ffiles%2Fmc%2Fboard%2F0%2F416%2Fhadoop%25EA%25B8%25B0%25EB%25B0%2598_%25EB%25B9%2585%25EB%258D%25B0%25EC%259D%25B4%25ED%2584%25B0_%25EA%25B8%25B0%25EC%2588%25A0%25EC%258B%25A4%25EB%25AC%25B4%25EA%25B3%25BC%25EC%25A0%2595_hbase_ver2.0.ppt&ei=kIoNU8bnGMG-lQX0u4CgAg&usg=AFQjCNEXEfN-TQpTzI2wxmfC2DgqXLqoLw&sig2=NAfU6N1ktkXy7sB9GIj2Kw&bvm=bv.61965928,d.aGc&cad=rjt

Monday, January 6, 2014

Hbase - If you don't know a ROW name.

@Just  Execute this.
hbase(main):007:0>  scan 't1', {LIMIT => 5}
@Add Filter on the raw name.
hbase(main):007:0> scan 't1', {FILTER => "PrefixFilter('aaaa')", LIMIT => 5}

Wednesday, August 14, 2013

Hbase - Testing to MapReduce

@If you are facing the following error, you should change version 2.1 on the common.io.
------------------------------------------------------------------------
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.isSymlink(Ljava/io/File;)Z
        at org.apache.hadoop.fs.FileUtil.getDU(FileUtil.java:456)
        at org.apache.hadoop.filecache.TrackerDistributedCacheManager.downloadCacheObject(TrackerDistributedCacheManager.java:463)
        at org.apache.hadoop.filecache.TrackerDistributedCacheManager.localizePublicCacheObject(TrackerDistributedCacheManager.java:475)
        at org.apache.hadoop.filecache.TrackerDistributedCacheManager.getLocalCache(TrackerDistributedCacheManager.java:191)
        at org.apache.hadoop.filecache.TaskDistributedCacheManager.setupCache(TaskDistributedCacheManager.java:182)
        at org.apache.hadoop.mapred.LocalJobRunner$Job.<init>(LocalJobRunner.java:124)
        at org.apache.hadoop.mapred.LocalJobRunner.submitJob(LocalJobRunner.java:437)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:983)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:912)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149)
        at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:912)
        at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
        at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
        at jp.ameba.hadoop.main.FreqCounter1.main(FreqCounter1.java:92)

Monday, August 12, 2013

Link - Hadoop, Hbase, Zookeeper

@All information about Hadoop
https://www.ibm.com/developerworks/data/library/techarticle/dm-1209hadoopbigdata/

http://www.ne.jp/asahi/hishidama/home/tech/apache/hbase/Filter.html#h_class

@Good install process
http://knight76.tistory.com/entry/hbase-Hbase-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-Fully-Distributed-mode

@Hbase and Zookeeper
http://blog.naver.com/PostView.nhn?blogId=albertx&logNo=100187419333
http://promaster.tistory.com/82

@Hbase
http://engineering.vcnc.co.kr/2013/04/hbase-configuration/

@Hadoop - Good Install Information
http://blog.beany.co.kr/archives/1373#hdfs-sitexml
http://crazia.tistory.com/entry/%ED%95%98%EB%91%A1-%ED%95%98%EB%91%A1Hadoop-%EC%B4%88-%EA%B0%84%EB%8B%A8-%EC%84%A4%EC%B9%98-%EC%99%84%EC%A0%84-%EB%B6%84%EC%82%B0-Full-Distributed-%EB%B0%A9%EC%8B%9D

Hbase - anything else on the Scan

// Hbase
BinaryComparator comparator = new BinaryComparator(Bytes.toBytes("key"));
Filter filter = new RowFilter(CompareOp.EQUAL, comparator);
// Mysql
[select * from aTable where ROW='key']

// Hbase
byte[] prefix = Bytes.toBytes("key");
Filter filter = new PrefixFilter(prefix);
// Mysql
[select * from aTable where ROW like'key%']

// Hbase
byte[] stop = Bytes.toBytes("key");
Filter filter = new InclusiveStopFilter(stop);
// Mysql
[select * from aTable where ROW<='key']

Hbase - Page limit


@For a paging like [Select * from aTable limit 10]

// HbaseDao.java
    public ResultScanner resultScanner(String tableName, int intPages) throws Exception {

        // Get a object from Pool
        HTableInterface hTable =  htablePool.getTable(tableName);

        long pageSize = intPages;
        Filter filter = new PageFilter(pageSize);
        Scan s =new Scan();
        s.setFilter(filter);

        ResultScanner rs = hTable.getScanner(s);

        return rs;
    }

Tuesday, July 23, 2013

Hbase - Important thing


# When you execute a client App on Tomcat,  If you faced the following the error,
→Will not attempt to authenticate using SASL (unknown error)
# You add host's name in the hosts file. this is sample.
17x.2x.xxx.xx1   master01
17x.2x.xxx.xx2   slave02
17x.2x.xxx.xx3   slave03
17x.2x.xxx.xx4   slave04
# A client App(Hbase) on Tomcat is related with all of hbase server host name.

Thursday, July 18, 2013

Hbase - Connection Pool


-------------------------------------------------------------------------
# You need to set ips in the hosts file.
    <hbase>
        <master>server1:6000</master>
        <zookeeper>
            <quorum>server1</quorum>
            <property>
                <clientPort>2181</clientPort>
            </property>
        </zookeeper>
    </hbase>