Archive for the ‘hypertable’ Category

Hypertable Hadoop 파일 시스템에 설치 하기 – 2

July 21, 2008

Hypertable Hadoop 파일 시스템에 설치 하기 – 2

이번장에서는 hypertable을 hadoop을 이용하게 설정하고
클러스터 세팅을 할 예정이다
 

설치 환경: fedora 8 – 32 bit (amazon ec2), hadoop-0.17.1 x 4
  (총 4대의 서버로 구성된 소형 클러스터)

1. hadoop클러스터 구성
      4대의 amazon-ec2 컴퓨터로 소형 클러스터를 구성했다

2. HDFS(hadoop distributed file system)에 hypertable 디렉토리 생성
      HADOOP_HOME$ bin/hadoop dfs -mkdir /hypertable
      HADOOP_HOME$ bin/hadoop dfs -chmod 777 /hypertable

      잘 만들어졌나 확인해보자
      HADOOP_HOME$ bin/hadoop dfs -ls

3. 설정파일 변경하기

      HYPERTABLE_HOME$ 0.9.0.7/conf/hypertable.cfg

      만약 hadoop master설정이 hdfs://ip-10-251-91-180.ec2.internal:50001
      되어 있다면

      HdfsBroker.fs.default.name=hdfs://ip-10-251-91-180.ec2.internal:50001

      다음의 두개의 설정을 hypertable master서버가 있는쪽으로 바꿔준다 
     
      Hyperspace.Master.Host=ip-10-251-91-180.ec2.internal
      Hypertable.Master.Host=ip-10-251-91-180.ec2.internal

      만약 hadoop을 쓰지 않고 그냥 로컬 파일시스템을 쓰고 싶으면
      DfsBroker.Local.Root=fs/local <- 여기서 hypertable 루트 폴더를 설정

4. master server, hyperspace 작동

      HYPERTABLE_HOME$ bin/start-master.sh hadoop
      or bin/start-all-servers.sh hadoop

5. range server 작동

      HYPERTABLE_HOME$ conf/slaves 파일을 하나 만들고
      거기에 slaves 서버 이름들을 일일이 적어준다

      HYPERTABLE_HOME$ cat conf/slaves
      ip-10-251-71-150.ec2.internal
      ip-10-251-67-113.ec2.internal
      ip-10-251-42-245.ec2.internal
      ip-10-251-123-79.ec2.internal

      HYPERTABLE_HOME$ bin/slaves.sh ~/hypertable/0.9.0.7/bin/start-range-server.sh hadoop
      여기서 ~는 hypertable 경로..

      만약 여기서 ~/hypertable/0.9.0.7/bin/jrun: line 106: exec: java: not found
      이런 에러를 본다면 regionserver에 가서 jrun 스크립트를 수정해야 한다
      마지막 라인에 java를 실행하기 전에
      PATH=$PATH:*java bin folder path* <= 자바 bin폴더 path를 추가해준다

      서버 종료시에는 일단 로컬 서버는
      HYPERTABLE_HOME$ bin/stop-servers.sh (이전 버젼에서는 kill-servers.sh였는데 바뀌었다)
     
      이제 ~/hypertable/0.9.0.7/bin/hypertable 을 하면 HQL커맨드로 hypertable을
      시작할수 있다..
** 더 상세한 정보는 Hypertable wiki ==> http://code.google.com/p/hypertable/w/list
** 다음 포스트에서는 Hypertable on hadoop, Hbase on hadoop의 테스트 과정과 결과 비교를 올릴예정..
** hypertable on kfs, hypertable on hadoop 의 비교 결과도…

Hypertable Hadoop 파일 시스템에 설치 하기 – 1

July 3, 2008

Hypertable Hadoop 파일 시스템에 설치 하기 – 1

밑의 영문 문서는 어디어디서 퍼온 문서이고 이 한글문서는 설치 하면서

다음에 또 잊어 먹지 않기 위해서…

설치 환경: fedora 8 – 32 bit (amazon ec2), hadoop-0.17.0 x 4
(총 4대의 서버로 구성된 소형 클러스터)

1. cmake 설치 (http://www.cmake.org/)
yum install cmake

2. berkeley db 4.6+설치
sudo yum install db4-devel

yum이 없는 경우 다른 리눅스의 경우

tar -xzvf ~/Downloads/db-4.7.25.tar.gz
cd db-4.7.25/build_unix/
../dist/configure –enable-cxx
(<– 이 옵션 빼먹으면 안된다..
빼먹으면 나중에 make할때 에러가 나는데..)
make
sudo make install
echo “/usr/local/BerkeleyDB.4.7/lib” | \
sudo tee /etc/ld.so.conf.d/BerkeleyDB.conf
sudo /sbin/ldconfig

Debian 계열..(Ubuntu…)
sudo apt-get install libdb4.6++-dev

3. Boost version 1.34.1+ 설치하기 (http://www.boost.org/)

apt-get 사용시
sudo apt-get install libboost-.*-dev

yum 사용시
sudo yum install boost-devel

4. log4cpp dev lib 설치하기 (http://log4cpp.sourceforge.net/)
요놈은 뭐 yum패키지가 없는 모양이다

그냥 다운 받아서

http://heanet.dl.sourceforge.net/sourceforge/log4cpp/log4cpp-1.0.tar.gz
tar -xzvf log4cpp-1.0.tar.gz
cd log4cpp-1.0/
./configure
make
make check
make install

머 다들 알겠지만 이거 할때 gcc-c++없으면 에러가 난다
참고로 초기화된 ec2 fedora는 cpp라이브러리가 없다
없을시애는
yum install gcc-c++

5. expat dev lib 설치 (http://sourceforge.net/projects/expat)

yum 사용시
yum install expat-devel

apt-get 사용시
apt-get install libexpat1-dev

6. readline dev lib 설치

yum 사용시
yum install readline-devel

apt-get 사용시
apt-get install libreadline5-dev

7. git 설치 (이놈은 소스 코드를 다운받기 위해)

yum install git

8. zlib 설치 (ec2기본 컴퓨터에는 이것 또한 없다,
대부분의 다른 문서에는 언급조차 안한다 당연히 있을줄 알고)

yum install zlib-devel

* ncurses dev lib 위의 라이브러리들을 설치 하면 자동적으로 설치 된다
여기까지 했다면 설치의 절반은 완료이다

** 이건 옵션인데 hypertable은 메모리 할당 라이브러리로 tcmalloc을 지원한다. 뭐 강추라니까 한번 써보긴한다
궁금하신분들은 아래의 링크를 따라서 성능비교라던지 정보를 보시길.. 설치 또한 간단하다 오픈 소스 프로젝트는
대부분 ./configure->make->make install ^^

tcmalloc (http://code.google.com/p/google-perftools/)

wget http://google-perftools.googlecode.com/files/google-perftools-0.98.tar.gz
tar -xzvf google-perftools-0.98.tar.gz
cd google-perftools-0.98
./configure
make
make install

9. 체크아웃 소스 코드

mkdir hypertable
cd hypertable
mkdir src
mkdir build
cd src
git clone git://scm.hypertable.org/pub/repos/hypertable.git

10. 라이브러리 복사

필자의 경우 yum을 쓰지 않은 라이브러리가 /usr/local/lib에 들어갔다 )tcmalloc, log,,,)
이놈들을 /usr/lib/에 복사
mv /usr/local/lib/* /usr/lib/

11. 빌드 설정

cd ../build/
cmake ../src/hypertable/

참 이거 할때 주의 해야 할점은 아무 옵션을 주지 않는다면 디폴트로 /opt/hypertable에 인스톨한다

cmake -DCMAKE_INSTALL_PREFIX=../ ../src/hypertable

요렇게 하면 바로 위 폴더 방금 전에 만들었던 hypertable 폴더에 이쁘게 설치 해준다 지금 설치 하는게
아니고 설정 파일을 바꿔준다는 말이다 이렇게 바꾸고 싶은 분들은

rm CMakeCache.txt ->요러케 cmake 캐쉬 파일을 지우고
cmake -DCMAKE_INSTALL_PREFIX=../ ../src/hypertable

또 한가지 아무 옵션을 안주면 기본으로 디버그 모드로 설정이 된다, 릴리즈 모드로 컴파일 원할시 이 옵션 추가
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ ../src/hypertable

마지막 한가지 ^^
ccmake ../src/hypertable

빌드 파라메터를 바꿀수 있다

라이브러리로 만들고 싶으면
cmake -DBUILD_SHARED_LIBS=ON ../src/hypertable

12. 빌드 하기

이제 마지막 단계만 남았다 하지만 hadoop을 쓰기위해서
고려해야 할점은 현재 설치 되어 있는 hadoop을 버젼과 hypertable이
쓰는 버젼이 맞아야 한다. 만약 다르다면 필자의 경우 hadoop 폴더에 있는
hadoop-내 버젼-core.jar을 ../src/hypertable/lib/에 복사한다
cp HADOOP_HOME/hadoop-0.17.0-core.jar ../src/hypertable/lib

그리고 cmake_install.cmake 파일을 열어 hadoop 라이브러리를 바꿔줘야 한다
vim cmake_install.cmake

FILE(INSTALL DESTINATION

“${CMAKE_INSTALL_PREFIX}/0.9.0.7/java/lib”
TYPE FILE COMPONENTS “Unspecified” FILES
“/usr/local/hypertable/src/hypertable/lib/hadoop-내 버젼-core.jar”)
<- 요 부분

hypertable이 쓰는 api가 hadoop버젼에 따라 다를수 있지만
버젼 차이가 크게 나지 않는 한은 대부분 돌아간다 ^^

make (or make -j<number_of_cpu_or_cores_plus_1> 빠른 컴파일을 위해서)
make install

컴파일시에 몇개의 warning이 보인다 그냥 무시하시길…. ^^
좀 시간이 걸린다…
다 끝나면 ~/hypertable/0.9.0.7 <- hypertable 버젼
** 만약 라이브러리로 컴파일 한다면 이게 필요할지도 모른다
echo $prefix/$version/lib’ | \
sudo tee /etc/ld.so.conf.d/hypertable
sudo /sbin/ldconfig
** hypertable 빌드는 이제 끝난 셈이고 간단한 세팅을 통해서 hadoop을
이용하는 hypertable을 만들어보자
** 소스 코드 문서를 빌드 하고 싶으면

1. 이 라이브러리들을 인스톨 하고
- doxygen (http://www.stack.nl/~dimitri/doxygen/)
- graphviz (http://www.graphviz.org/)

2. cmake 설정 다시 모르는 분들은 위에 10번 보시길, 그리고 make

cd ~/build/hypertable
make doc

문서트리는 ~/build/hypertable/doc에 생성될 것이다

Hypertable UpAndRunningWithHadoop

July 3, 2008

Step 1
Install and start Hadoop.

Step 2
Make sure you have extended attributes enabled on the partition that holds the root of the Hyperspace directory tree. This will be the same disk volume that holds the installation (e.g. ~/hypertable), unless you configured Hyperspace explicitly to point to somewhere else. This is not necessary on the mac, but is in general on Linux systems. To enable extended attributes on Linux, you need to add the user_xattr property to the relevant file systems in your /etc/fstab file. For example:

  /dev/hda3     /home     ext3     defaults,user_xattr     1 2You can then remount the affected partitions as follows:

  $ mount -o remount /home

Step 3
Create the directory /hypertable in HDFS and make it writeable by all.

$ hadoop fs -mkdir /hypertable $ hadoop fs -chmod 777 /hypertable

Step 4
Edit the config file conf/hypertable.cfg Change the following property to point to the Hadoop filesystem that got up and running in step 1 (assuming hdfs://motherlode000:9000):

HdfsBroker.fs.default.name=hdfs://motherlode001:9000Change the following two properties to point to the location of the Hypertable Master and Hyperspace (assuming motherlode001):

Hyperspace.Master.Host=motherlode001 Hypertable.Master.Host=motherlode001

Step 5
Start the Master and Hyperspace

ssh motherlode001 ~/hypertable/bin/start-master.sh hadoop

Step 6
Start the Range Servers. Add all of the names of the machines that will be running range servers to the file conf/slaves relative to the installation directory. Here’s what an example one looks like:

$ cat conf/slaves motherlode001 motherlode002 motherlode003 motherlode004 motherlode005 motherlode006 motherlode007 motherlode008This slaves file, along with the entire installation should be pushed out to all of the machines using something like rsync. Once you’ve done this, you can launch all of the range servers with the following command (assuming installation dir is ~/hypertable on all of the machines):

./bin/slaves.sh ~/hypertable/bin/start-range-server.sh hadoopNow you sould be able to run the ~/hypertable/bin/hypertable HQL command interpreter and start playing around.

Stopping the System
Execute the following commands to stop all of the servers:

ssh motherlode001 ~/hypertable/bin/kill-servers.sh ./bin/slaves.sh ~/hypertable/bin/kill-servers.sh

 

Hypertable build

July 3, 2008

=== CONTENTS ===
================

  * HOW TO BUILD
  * HOW TO RUN REGRESSION TESTS
  * HOW TO BUILD SOURCE CODE DOCUMENTATION TREE (Doxygen)

====================
=== HOW TO BUILD ===
====================

  1. Install CMake (http://www.cmake.org/)

  2. Install required libraries (you may already have them installed)
    – BerkeleyDB 4.6+
      Example (generic Linux):
      tar -xzvf ~/Downloads/db-4.7.25.tar.gz
      cd db-4.7.25/build_unix/
      ../dist/configure –enable-cxx
      make
      sudo make install
      echo “/usr/local/BerkeleyDB.4.7/lib” | \
          sudo tee /etc/ld.so.conf.d/BerkeleyDB.conf
      sudo /sbin/ldconfig

      Example (using apt-get, typical on Debian variants (Ubuntu etc.)):
      sudo apt-get install libdb4.6++-dev

      Example (using yum, typical on Redhat variants (CentOS, Fedora etc.)):
      sudo yum install db4-devel

      Note: if distribution has version older than 4.6+, try the generic way.

    – Boost version 1.34.1+ (http://www.boost.org/)
      Example (using apt-get)
      sudo apt-get libboost-.*-dev

      Example (using yum)
      sudo yum install boost-devel

      Note: if distribution has version older than 1.34.1+, try the generic way.

    – log4cpp dev lib(http://log4cpp.sourceforge.net/)

    – expat dev lib (http://sourceforge.net/projects/expat;
      yum: expat-devel; apt-get: libexpat1-dev)

    – readline dev lib (yum: readline-devel; apt-get: libreadline5-dev)

    – ncurses dev lib (usually auto installed by installing above)

    HIGHLY RECOMMENDED (but not required):
    – tcmalloc (http://code.google.com/p/google-perftools/)

  3. Checkout the source code.

    mkdir ~/src
    cd ~/src
    git clone git://scm.hypertable.org/pub/repos/hypertable.git

  4. Create an install directory if necessary

    mkdir ~/hypertable

  5. Create a build directory

    mkdir -p ~/build/hypertable

  6. Configure the build.

    cd ~/build/hypertable
    cmake ~/src/hypertable

    By default hypertable gets installed in /opt/hypertable, you can
    use:

    cmake -DCMAKE_INSTALL_PREFIX=$prefix ~/src/hypertable

    for your own install directory. Also by default the build is configured
    for Debug. To compile for performance/benchmark:

    cmake -DCMAKE_BUILD_TYPE=Release ~/src/Hypertable

    Note, one can also use:

    ccmake ~/src/hypertable

    to change build parameters interactively.

    To build shared libraries, e.g., for scripting language extensions:
    cmake -DBUILD_SHARED_LIBS=ON ~/src/hypertable

  7. Build the software.

    make (or make -j<number_of_cpu_or_cores_plus_1> for faster compile)
    make install

    Note, if it’s a shared library install, you might need to do:
    echo $prefix/$version/lib’ | \
        sudo tee /etc/ld.so.conf.d/hypertable
    sudo /sbin/ldconfig

    Or, you can use the usual LD_LIBRARY_PATH (most Unix like OS) and
    DYLD_LIBRARY_PATH (Mac OS X) to specify non-standard shared library
    directories.

===================================
=== HOW TO RUN REGRESSION TESTS ===
===================================

1. Make sure software is built and installed according to ‘HOW TO BUILD’

2. Restart servers and re-create test tables

   **********************************************************************
   *** WARNING: THIS STEP MUST BE PERFORMED PRIOR TO RUNNING THE TEST ***
   **********************************************************************

  version=0.9.0.7

  cd $prefix/$version
  bin/kill-servers.sh
  bin/start-all-servers.sh local

3. Run the regression tests

  cd ~/build/hypertable
  make test

=============================================================
=== HOW TO BUILD SOURCE CODE DOCUMENTATION TREE (Doxygen) ===
=============================================================

1. Install the following libraries:
  – doxygen (http://www.stack.nl/~dimitri/doxygen/)
  – graphviz (http://www.graphviz.org/)

2. If you have doxygen installed on your system, then CMake should detect this
   and add a ‘doc’ target to the make file.  Building the source code
   documentation tree is just a matter of running the following commands:

   cd ~/build/hypertable
   make doc

The documentation tree will get generated under ~/build/hypertable/doc. To view
the HTML docs, load the following file into a web browser:

  ~/build/hypertable/doc/html/index.html