everydayminder

learn something everyday

Archive for the ‘Hadoop’ Category

The Hadoop Distributed File System : Architecture and Design 요약

leave a comment »

본 내용은 해당 링크내의 원본을 읽고, 키워드 등의 관점에서 축약하였음

원본 링크 :
http://hadoop.apache.org/core/docs/current/hdfs_design.html

원본 링크내 첨부파일 :jk1.pdf
본 내용은 해당 링크내의 원본을 읽고, 키워드 등의 관점에서 축약하였음

■ Introduction
    – HDFS is highly fault-tolerant and is designed to be deployed on low-cost hardware.
    – HDFS provided high throughtput access to application data and is suitable for applications that have large data sets.

■ Assumptions and Goals
   – Hadrware Failure : detection of faults and quick, automatic recovery
   – Streaming Data Access : It is designed more for batch processing rather than interactive use by users
   – Large Data Sets : It provides high aggregate data bandwidth and scale to hundreds of nodes in a single cluster.
   – Simple Coherency Model : write-once-read-many access model for files
   – “Moving Computation is Cheaper than Moving Data” : It is often better to migrate the computation closer to where the data is located rather than moving the data to where the application is running. HDFS provides interfaces for applications to move themselves closer to where the data is located.
   – Portability Across Heterogeneous Hardware and Software Platforms : HDFS is easily portable from one platform to another.

Written by everydayminder

July 29, 2008 at 06:37

Posted in Hadoop

HBase에서 HQL 사용하기

leave a comment »

HBase에서 HQL 사용하기
   (wiki.apache.org내용을 근거로)

설치된 HBase를 바탕으로, HQL을 수행하였다. (bin/hbase shell)

해당 정보의 참고 링크는 아래와 같다.
http://wiki.apache.org/hadoop/Hbase/HbaseShell?action=print

1. Create Table
    hql> create table movielog_table (
       –> year, length, inColor, studioName, vote, producer, actor);

2. Insert Data
   hql> insert into movielog_table (year:, length:, inColor:, studioName:,
        ‘vote:user name’, producer:, ‘actor:hero’)
      –> valules (‘1977’, ‘124’, ‘true’, ‘Fox’, ‘5’, ‘George Lucas’, ‘Mark Hamill’)
      –> where row = ‘Star Wars’;

  * 내가 해 본 시도)
    – column 명을 주지 않고, 곧바로 values들만 넣어봄 : 에러
    – where 부분에서 row key 를 지정하지 않음 : 당연히 에러!
   
  *  row key가 따로 명시되지만, 사실 일반 PK 필드와 동일함.
  *  사용시 where 이후에 기록을 꼭해줘야 함. (활용폭이 적음, 맵 구조인지라
      키를 중심으로 데이터를 처리함)
  *  관계형 DB에 비해 where 조건에 넣을 수 있는 실질적인 비교구문이 없음

3. Select Data
   hql> select count(studioName:FOX) from movielog_table;

4. Truncate
   hql> truncate table 테이블명

5. Drop Table
   hql> drop table 테이블명

* truncate나 drop table을 실행하기 전에 반드시 disable 테이블명을 해줘야 실행된다.

Written by everydayminder

July 25, 2008 at 09:00

Posted in Hadoop

HBase 설치/설정하기

leave a comment »

Michael 씨가 자세하게 설명했던 HDFS 설정과는 달리,
HBase 설정은 wiki.apache.org/hadoop/HBase에 나와있는 설명이 전부이다.
물론, 웹에서 많은 사람들의 노력의 흔적은 곳곳에 있긴 하지만, 역시 어렵다.
기본적인 수준의 설명이나, 링크의 소개, 해봤더니 잘 되더라는 소감이 대다수이니까.

1.  내 시스템 구성
   1) 앞서 설정한 HDFS(master, slave)  -> 2대
   2) HBase -> 1대

2. 미리 준비할 것
   1) hbase1과 master, slave 간 ssh가 미리 설정되어 있어야 함.
      (비밀번호 없이 SSH 인증하기 참조)
   2) hbase1, master, slave는 서로 reachable 해야 함.
     (hbase1는 master랑만 통신해도 될 줄 알았는데.. 아니었음) 

3. 환경 설정
   1) .bashrc에 HBASE_HOME을 설정
   2) /conf/hbase-env.sh에 JAVA_HOME 설정
   3) /conf/hbase-defaul.xml을 /conf/hbase-site.xml로 복사
   4) /conf/hbase-site.xml중, hbase,master 항목과 hbase.rootdir 항목 변경
      – hbase.master -> example.org:60000을 hbase1:60000 으로 설정  
      – hbase.rootdir -> hdfs://example.org:9000/hbase를  master:54310/hbase로
        설정
        (hbase가 뜨는 곳은 hbase1이고, hbase가 사용할 hdfs는 master로 시작됨)
   5) /conf/regionservers는 ${HADOOP_HOME}/conf/slaves와 동일하게 작성함
   6) Hbase가 HDFS를 제대로 쓰도록 하기 위해, hadoop-site.xml이 필요하므로,
      ${HBASE_HOME}/conf에 ${HADOOP_HOME}/conf/hadoop-site.xml을
      복사함.

4. 실행
   1) 띄우기 : ${HBASE_HOME}/bin/start-hbase.sh
      – 성공적으로 뜨면, 로그에 에러가 안 남음
      – jps 결과 : HMaster, HRegionServer가 추가됨
   2) 종료하기 : ${HBASE_HOME}/bin/stop-hbase.sh
      – jps 실행시, HMaster, HRegionServer가 사라짐

* 문제점
   – 내가 실험한 결과, start-hbase.sh 가 정상 작동하지 않는다. HMaster는
     뜨지만,  HRegionServer가 정상적으로 뜨지 않아서 쓸 수 없는 상태가 됨.
   – path가 너무 길거나 복잡하면 에러가 생기는 듯 한데, shell을 고쳐서 직접
     실행시키면 뜨기는 한다. 당분간은 이렇게라도 실행시켜봐야할 듯.
   – 정상적으로 동작하면, jps에도 뜨지만, start-base/stop-base 수행시간도 짧다.
     오작동시, 시간이 길어지며 최악의 경우, kill도 감수해야 한다. (vulnerablity)

Written by everydayminder

July 25, 2008 at 00:31

Posted in Hadoop

HDFS 설정하기

leave a comment »

기본적으로는,

아래 posting과 같이 Michael G. Noll씨가 설명한 바와 같이 따라하면,

하나의 machine에 single cluster를 이상없이 설치할 수 있다.

Michael이 권고하기를,
여러 개로 multi cluster를 구축하기에 앞서, 단일 cluster로 정상 작동하는지
확인 후, 여러 개를 붙여가는 방법이 보다 효과적이라고 한다.

두 개의 cluster를 master-slave로 구성하고자 한다면,
앞서 마친 단일 cluster 2개 중 하나를 master로 다른 하나를 slave로
설정한다.

1. master와 slave의 conf/hadoop-site.xml에서 localhost 부분을 master로 바꿔준다.
2. master의 conf/masters 파일에 master를 넣는다. (slave에서는 안해줘도 됨)
3. master의 conf/slaves에 master, slave를 넣는다. (slave에서는 안해줘도 됨)
4. 앞서 single cluster 설정시에 사용했던 file system directory를 지워준다.
   (… /dir/dfs)
5. master에서 namenode를 포맷한다. (bin/hadoop/ namenode -format)
6. master에서 bin/start-dfs.sh를 실행시켜 프로세스의 정상 가동 여부를 확인한다.
   1) master에서 뜨는 process :  Namenode, DataNode, SecondaryNamenode
   2) slave에서 뜨는 process : DataNode
7. master 및 slave에서 각각 로그내 이상유무를 확인한다. (ERROR 유무)
8. master에서 MapReduce 를 실행 시킨다.(bin/start-mapred.sh)
9. jps로 프로세스를 확인한다.
  1) master에 추가되는 process : TaskTracker, JobTracker
  2) slave에 추가되는 process : TaskTracker
10. master 및 slave에서 각각 로그내 이상유무를 확인한다. (ERROR 유무)

정상적으로 동작한다면, start-all.sh stop-all.sh 을 실행시킴으로써
dfs 및 mapreducer를 일괄적으로 시작/종료시킬 수 있다.

요약하면, master/slave의 dfs가 정상적으로 연동되고 있다면 외형적으로는
다음 두 조건을 만족시켜야 한다.

1. master 및 slave에서 각각 떠야할 프로세스들이 jps로 확인된다.
2. master 및 slave의 각 로그파일에 에러가 없다.사용자 삽입 이미지
(출처 : http://hadoop.apache.org/core/docs/current/hdfs_design.html)

Written by everydayminder

July 25, 2008 at 00:21

Posted in Hadoop

Hadoop Installation on Ubuntu Linux 7.10

leave a comment »

Related articles by Michael G. Noll
———————————-
1. Running Hadoop On Ubuntu Linux (Single Node Cluster)
http://wiki.apache.org/hadoop/Running_Hadoop_On_Ubuntu_Linux_%28Single-Node_Cluster%29

2. Running Hadoop On Ubuntu Linux (Multi Node Cluster)
http://www.michael-noll.com/wiki/Running_Hadoop_On_Ubuntu_Linux_%28Multi-Node_Cluster%29

[Comments]
1. I created a VMWare Team project file and added two instances of existing virtual machines.
2. Each VMWare instance has a single node cluster.

* IP alias name should be defined before loop back alias name (localhost) in ‘/etc/hosts’ file.

Written by everydayminder

July 17, 2008 at 06:05

Posted in Hadoop

HBase Installation (Standalone mode/local file system)

leave a comment »

Requirements
————-
– Java 1.5.x, preferably from Sun.
– Hadoop 0.16.x. This version of HBase will only run on Hadoop 0.16.x..
– ssh must be installed and sshd must be running to use Hadoop’s scripts
   to manage remote Hadoop daemons.
– HBase currently is a file handle hog. The usual default of 1024 on *nix systems
   is insufficient if you are loading any significant amount of data into regionservers.
  See the FAQ: Why do I see “java.io.IOException…(Too many open files)” in my logs?  for how to up the limit.


[C] Installation of HBase
————————–
(1) Java 1.5.x
    – installed java 1.6.x
    – Not sure whether 1.6.x will work
(2) Unzipped the Hadoop archive file (ver 1.3) at ~/hbase
(3) ssh & sshd configuration (execution)
    – sudo apt-get install openssh-server
    – sudo /etc/init.d/ssh start (stop)
(4) edit the limit number of file handlers
    – checked /etc/security/limits.conf but there is no option to edit for this


[C] HBase Configuration
————————
(1) ${HBASE_HOME} : the real location of hbase (/home/luran/hbase)
(2) modify JAVA_HOME information on ${HBASE_HOME}/conf/hbase-env.sh
(3) start HBase by ${HBASE_HOME}/bin/start_hbase.sh
(4) stop HBase by ${HBASE_HOME}/bin/stop-hbase.sh

Written by everydayminder

July 15, 2008 at 08:48

Posted in Hadoop