HBase をインストールする

HBase の standalone 環境を作ります。Hadoop なしです。

0. 事前準備

java 1.6.0_22

1. HBase のパッケージをダウンロードする

http://hbase.apache.org/ からファイルをダウンロード。

$ cd ~/opt
$ wget http://ftp.kddilabs.jp/infosystems/apache//hbase/hbase-0.20.6/hbase-0.20.6.tar.gz

2. インストールする

$ tar zxf hbase-0.20.6.tar.gz
$ ln -s hbase-0.20.6 hbase

3. PATH の設定をする

$ vi .bashrc
export HBASE_HOME=$HOME/opt/hbase
export PATH=$HBASE_HOME/bin:$PATH
$ . .bashrc

4. HBase の設定を変更する

$HBASE_HOME/conf/hbase-default.xml を変更する

  • hbase.rootdir を file:///home/hbase/opt/hbase/data に変更
  • hbase.tmp.dir を /home/hbase/opt/hbase/tmp に変更

5. 起動してみる

$ start-hbase.sh
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 01:e3:64:c4:75:cb:c8:f6:7d:83:6e:93:b0:41:81:ac.
Are you sure you want to continue connecting (yes/no)? yes
localhost: Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
hbase@localhost's password:
localhost: starting zookeeper, logging to /home/hbase/opt/hbase/logs/hbase-hbase-zookeeper-centos5.5.out
master running as process 28517. Stop it first.
$ stop-hbase.sh
stopping master............
hbase@localhost's password:
localhost: stopping zookeeper

おまけ パスワードを聞かれないようにする

1. ユーザーのパスワードを削除する
# passwd -d hbase
Removing password for user hbase.
passwd: Success
2. SSH ログイン用のキーを生成する
$ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
Generating public/private rsa key pair.
Created directory '/home/hbase/.ssh'.
Your identification has been saved in /home/hbase/.ssh/id_rsa.
Your public key has been saved in /home/hbase/.ssh/id_rsa.pub.
The key fingerprint is:
c2:53:87:58:29:70:e3:be:c2:75:dd:84:41:b5:67:2e hbase@centos5.5
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys
3. パスワードなしでログインができるかを確認する
$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 01:e3:64:c4:75:cb:c8:f6:7d:83:6e:93:b0:41:81:ac.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
Last login: Thu Oct 14 04:31:42 2010 from localhost.localdomain

これで起動や停止のときにパスワードを聞かれなくなる