Tuesday, November 30, 2010

Installing HBase on Windows using Cygwin


Installing HBase on Windows using Cygwin

Introduction

HBase is a distributed, column-oriented store, modeled after Google's BigTable. HBase is built on top of Hadoop for itsMapReduce and distributed file system implementation. All these projects are open-source and part of the Apache Software Foundation.
As being distributed, large scale platforms, the Hadoop and HBase projects mainly focus on *nix environments for production installations. However, being developed in Java, both projects are fully portable across platforms and, hence, also to the Windows operating system. For ease of development the projects rely on Cygwin to have a *nix-like environment on Windows to run the shell scripts.

Purpose

This document explains the intricacies of running HBase on Windows using Cygwin as an all-in-one single-node installation for testing and development. The HBase Overview and QuickStart guides on the other hand go a long way in explaning how to setup HBase in more complex deployment scenario's.

Installation

For running HBase on Windows, 3 technologies are required: Java, Cygwin and SSH. The following paragraphs detail the installation of each of the aforementioned technologies.

Java

Cygwin

  1. Make sure you have Administrator privileges on the target system.
  2. Choose and create you Root and Local Package directories. A good suggestion is to use C:\cygwin\root andC:\cygwin\setup folders.
  3. Download the setup.exe utility and save it to the Local Package directory.
  4. Run the setup.exe utility,
    1. Choose the Install from Internet option,
    2. Choose your Root and Local Package folders
    3. and select an appropriate mirror.
    4. Don't select any additional packages yet, as we only want to install Cygwin for now.
    5. Wait for download and install
    6. Finish the installation
  5. Optionally, you can now also add a shortcut to your Start menu pointing to the setup.exe utility in the Local Package folder.
  6. Add CYGWIN_HOME system-wide environment variable that points to your Root directory.
  7. Add %CYGWIN_HOME%\bin to the end of your PATH environment variable.
  8. Reboot the sytem after making changes to the environment variables otherwise the OS will not be able to find the Cygwin utilities.
  9. Test your installation by running your freshly created shortcuts or the Cygwin.bat command in the Root folder. You should end up in a terminal window that is running a Bash shell. Test the shell by issuing following commands:
    1. cd / should take you to thr Root directory in Cygwin;
    2. the LS commands that should list all files and folders in the current directory.
    3. Use the exit command to end the terminal.
  10. When needed, to uninstall Cygwin you can simply delete the Root and Local Package directory, and the shortcutsthat were created during installation.

SSH

HBase (and Hadoop) rely on SSH for interprocess/-node communication and launching remote commands. SSH will be provisioned on the target system via Cygwin, which supports running Cygwin programs as Windows services!
  1. Rerun the setup.exe utility.
    1. OpenSSH
    2. tcp_wrappers
    3. diffutils
    4. zlib
  2. Wait for the install to complete and finish the installation.

HBase

Download the latest release of HBase from the website. As the HBase distributable is just a zipped archive, installation is as simple as unpacking the archive so it ends up in its final installation directory. Notice that HBase has to be installed in Cygwin and a good directory suggestion is to use /usr/local/ (or [Root directory]\usr\local in Windows slang). You should end up with a /usr/local/hbase- installation in Cygwin.

Configuration

There are 3 parts left to configure: Java, SSH and HBase itself. Following paragraphs explain eacht topic in detail.

Java

One important thing to remember in shell scripting in general (i.e. *nix and Windows) is that managing, manipulating and assembling path names that contains spaces can be very hard, due to the need to escape and quote those characters and strings. So we try to stay away from spaces in path names. *nix environments can help us out here very easily by usingsymbolic links.
  1. Create a link in /usr/local to the Java home directory by using the following command and substituting the name of your chosen Java environment:
    LN -s /cygdrive/c/Program\ Files/Java/ /usr/local/
    
  2. Test your java installation by changing directories to your Java folder CD /usr/local/ and issueing the command ./bin/java -version. This should output your version of the chosen JRE.

SSH

Configuring SSH is quite elaborate, but primarily a question of launching it by default as a Windows service.
  1. On Windows Vista and above make sure you run the Cygwin shell with elevated privileges, by right-clicking on the shortcut an using Run as Administrator.
  2. First of all, we have to make sure the rights on some crucial files are correct. Use the commands underneath. You can verify all rights by using the LS -L command on the different files. Also, notice the auto-completion feature in the shell using  is extremely handy in these situations.
    1. chmod +r /etc/passwd to make the passwords file readable for all
    2. chmod u+w /etc/passwd to make the passwords file writable for the owner
    3. chmod +r /etc/group to make the groups file readable for all
    1. chmod u+w /etc/group to make the groups file writable for the owner
    1. chmod 755 /var to make the var folder writable to owner and readable and executable to all
  3. Edit the /etc/hosts.allow file using your favorite editor (why not VI in the shell!) and make sure the following two lines are in there before the PARANOID line:
    1. ALL : localhost 127.0.0.1/32 : allow
    2. ALL : [::1]/128 : allow
  4. Next we have to configure SSH by using the script ssh-host-config
    1. If this script asks to overwrite an existing /etc/ssh_config, answer yes.
    2. If this script asks to overwrite an existing /etc/sshd_config, answer yes.
    3. If this script asks to use privilege separation, answer yes.
    4. If this script asks to install sshd as a service, answer yes. Make sure you started your shell as Adminstrator!
    5. If this script asks for the CYGWIN value, just  as the default is ntsec.
    6. If this script asks to create the sshd account, answer yes.
    7. If this script asks to use a different user name as service account, answer no as the default will suffice.
    8. If this script asks to create the cyg_server account, answer yes. Enter a password for the account.
  5. Start the SSH service using net start sshd or cygrunsrv --start sshd. Notice that cygrunsrv is the utility that make the process run as a Windows service. Confirm that you see a message stating that the CYGWIN sshd service was started succesfully.
  6. Harmonize Windows and Cygwin user account by using the commands:
    1. mkpasswd -cl > /etc/passwd
    2. mkgroup --local > /etc/group
  7. Test the installation of SSH:
    1. Open a new Cygwin terminal
    2. Use the command whoami to verify your userID
    3. Issue an ssh localhost to connect to the system itself
      1. Answer yes when presented with the server's fingerprint
      2. Issue your password when prompted
      3. test a few commands in the remote session
      4. The exit command should take you back to your first shell in Cygwin
    4. Exit should terminate the Cygwin shell.

HBase

HBase config[installation directory]
  1. HBase uses the ./conf/hbase-env.sh 
    1. export JAVA_HOME=/usr/local/
    2. export HBASE_IDENT_STRING=$HOSTNAME as this most likely does not inlcude spaces.
  2. HBase uses the ./conf/hbase-default.xml file for configuration. S
    1. hbase.rootdir must read e.g. file:///C:/cygwin/root/tmp/hbase/data
    2. hbase.tmp.dir must read C:/cygwin/root/tmp/hbase/tmp
    3. hbase.zookeeper.quorum must read 127.0.0.1 because for some reason localhost doesn't seem to resolve properly on Cygwin.
  3. Make sure the configured hbase.rootdir and hbase.tmp.dir directories exist and have the proper rights set up e.g. by issuing a chmod 777 on them.

Testing

This should conclude the installation and configuration of HBase on Windows using Cygwin. So it's time to test it.
  1. Start a Cygwin terminal, if you haven't already.
  2. Change directory to HBase installation using CD /usr/local/hbase-, preferably using auto-completion.
  3. Start HBase using the command ./bin/start-hbase.sh
    1. When prompted to accept the SSH fingerprint, answer yes.
    2. When prompted, provide your password. Maybe multiple times.
    3. When the command completes, the HBase server should have started.
    4. However, to be absolutely certain, check the logs in the ./logs directory for any exceptions.
  4. Next we start the HBase shell using the command ./bin/hbase shell
  5. We run some simple test commands
    1. Create a simple table using command create 'test', 'data'
    2. Verify the table exists using the command list
    3. Insert data into the table using e.g.
      put 'test', 'row1', 'data:1', 'value1'
      put 'test', 'row2', 'data:2', 'value2'
      put 'test', 'row3', 'data:3', 'value3'
    4. List all rows in the table using the command scan 'test' that should list all the rows previously inserted. Notice how 3 new columns where added without changing the schema!
    5. Finally we get rid of the table by issuing disable 'test' followed by drop 'test' and verified by listwhich should give an empty listing.
  6. Leave the shell by exit
  7. To stop the HBase server issue the ./bin/stop-hbase.sh command. And wait for it to complete!!! Killing the process might corrupt your data on disk.
  8. In case of problems,
    1. verify the HBase logs in the ./logs directory.
    2. Try to fix the problem
    3. Get help on the forums or IRC (#hbase@freenode.net). People are very active and keen to help out!
    4. Stopr, restart and retest the server.

Conclusion

Now your HBase server is running, start coding and build that next killer app on this particular, but scalable datastore!

기억

정신분열증 : 두 개의 기억이 공존하는 상태이자 한 주체에서 다른 주체로 넘어가기 위한 단계이다.
기억의 총체가 주체의 본질이다.

기억을 어떻게 구성하는가에 따라 그사람의 삶이 달라진다.

Sunday, November 28, 2010

가장 큰 상실

죽음은 삶의 가장 큰 상실이 아니다.
가장 큰 살싱은 우리가 살아 았는 동안 우리 안에서 어떤 것이 죽어 버리는 것이다.

살아가는 데는 두 가지 방법이 있다. 하나는 기적이 존재하지 않는 다고 생각하며 사는 것이고, 다른 하나는 모든 것이 기적이라고 생각하며 사는 것이다. 별에 이를 수 없다는 것은 불행이 아니다. 불행한 것은 이를 수 있는 별을 갖고 있지 않다는 것이다.

우리가 알고 있는 아름다운 사람들이란 실패를 알고, 고통을 겪고, 상실을 경험하며, 깊은 구덩이에 빠져 길을 찾아 헤맨 이들이다.

Monday, November 8, 2010

최고의인생이란 안락함과 쾌락을 추구하는 것이다

쾌락은 대상이 있지만 행복은 대상이 없다.

쾌락은 일단 충족이 되면 그 효과가 반감이 된다. 무엇인가 원하고 그를 얻어 쾌락을 얻었다면 똑 같은 쾌락을 위해서는 전보다 더 많은 강도의 쾌락이 필요하다...

안락함은 무엇인가에 익숙해 졌을때 느껴지는 것이다. 하지만 안락함이 지속된다면 위험할 수 있으며, 경험적으로 만족스럽지 않을 확율이 높다는 점이다.  높은 수준의 안락을 유지하다 어느 순간 평범한 수준의 안락으로 낮아질 경우 사람은 불편을 느낄 수 밖어 없을 것이다.


Wednesday, November 3, 2010

팔당대교 이야기 - 박찬일

승용차가강물에 추락하면
상수원이 오염됩니다
그러니 서행하시기 바랍니다.

나는 차를 돌려 그 자리로 가
난간을 들이받고
강물에 추락하였습니다.
기름을 흘리고
상수원을 만방 더럽혔습니다.

밤이었습니다.
.

Tuesday, November 2, 2010

지금까지 모든 것은 허상이다

지금까지 모든 것은 허상이다  - 조송
http://navercast.naver.com/art/illust/3907

Autumn Leaves



Nat King Cole - Autumn Leaves 









Autumn Leaves 


The falling leaves Drift by the window 
The autumn leaves Of red and gold 
떨어지는 나뭇잎들이 창문곁으로 스쳐지나가네요. 
적색과 황금색의 찬란한 빛깔로 물든 나뭇잎들이에요.
I see your lips The summer kisses 
The sunburned hands I used to hold 
여름날 입맞춤했던 당신의 입술과 
내가 잡아주던 햇볕에 그을린 손이 생각납니다.
Since you went away The days grow long 
And soon I'll hear Old winter's song 
당신이 떠나버린 후 하루가 길게만 느껴지네요. 
곧 난 예전에 듣던 겨울날의 노래를 들을 수 있겠지요.
But I miss you most of all My darling 
When autumn leaves Start to fall 
하지만 가을 나뭇잎이 떨어지기 시작할때면, 
난 무엇보다도 당신이 그리워집니다.사랑하는 그대여..
Since you went away, the days grow long 
And soon I'll hear old winter's song. 
당신이 떠나버린 후 하루가 길게만 느껴지네요. 
곧 난 예전에 듣던 겨울날의 노래를 들을 수 있을거에요
But I miss you most of all my darling, 
When autumn leaves start to fall. 
하지만 가을 나뭇잎이 떨어지기 시작할때면, 
난 무엇보다도 당신이 그리워집니다.사랑하는 그대여..
I miss you most of all My darling 
When autumn leaves Start to fall   
가을 나뭇잎이 떨어지기 시작할때면, 
난 무엇보다도 당신이 그리워집니다.사랑하는 그대여..

Dialog

공동체란 공통의 언어(말로써의 언어가 아닌 사용례로서의 언어)를 사용하는 집단이다.
동일한 언어 규칙을 사용하기에 그들간의 대화란 서로가 말하는 것에대한 확인에 불과한다.

반면 공동체간의 대화란 서로 다른 규칙을 사용하기에 서로의 차이와 공통점을 찾아가야 하는 어려움이 있고 여기서 바로 진정한 의미의 "대화"가 존재한다.

많은 대화가  진행되면 종국에는 서로 같은 언어 규칙을 공유하게 되고 본래적 의미의 대화는 사라지게 된다.

Monday, November 1, 2010

가트너 2011년 10대 전략기술 분석

http://www.ciobiz.co.kr/news/articleView.html?idxno=3946




· [가트너심포지엄2010⑭]모바일·소셜, 기업 컴퓨팅 판도 바꾼다
· [가트너심포지엄2010⑬]신기술 등장으로 글로벌 M&A 전쟁 촉발
· [에디터@가트너2010]전략기술 톱10의 함의
· [가트너심포지엄2010⑳]CIO BIZ+ 참관단 매일 토론회 가져
· [가트너심포지엄2010⑮]마크 베니오프 세일즈포스닷컴 CEO 기조연설
· [가트너심포지엄2010⑯]데이터 폭발에 대처하는 10가지 전략
· [가트너심포지엄2010⑰]클라우드 시대의 ‘쿨 벤더’는 어디?
· [가트너심포지엄2010⑱]SW 라이선스 갈등을 피하는 법
· [가트너심포지엄2010⑲]영국 일간지 ‘가디언’의 소셜컴퓨팅 원칙
· [가트너심포지엄2010①]올랜도서 17일 개막
· [가트너심포지엄2010②]2011년 전략기술 톱10은?
· [가트너심포지엄2010③]스마트패드, ‘애플’만 보지 말라
· [가트너심포지엄2010④]자원기반 IT 가고 성과기반 IT 온다
· [에디터@가트너2010]CIO의 차세대 먹거리
· [가트너심포지엄2010⑩]수익창출형 CIO 뜬다
· [가트너심포지엄2010⑪]고성과 CIO의 7가지 리더십
· [가트너심포지엄2010⑨]전환기 CIO, 새 기회를 잡아라
· [가트너심포지엄2010⑤]퍼블릭 vs 프라이빗 ‘클라우드 균형’ 맞춰라
· [가트너심포지엄2010⑥]서버 가상화 이제야 확산
· [가트너심포지엄2010⑦]IT인프라 운영 위한 10가지 조언
· [가트너심포지엄2010⑫]행사 이모저모①