Hbaseを触ってみる
触れるまで。
javaバージョンの確認
$ java -version java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.4) (rhel-1.41.1.10.4.el6-x86_64) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
ソフトウェアをダウンロード
$ wget http://ftp.jaist.ac.jp/pub/apache/hbase/hbase-0.94.4/hbase-0.94.4.tar.gz $ tar xvfz hbase-0.94.4.tar.gz $ cd hbase-0.94.4
起動
$ bin/start-hbase.sh +======================================================================+ | Error: JAVA_HOME is not set and Java could not be found | +----------------------------------------------------------------------+ | Please download the latest Sun JDK from the Sun Java web site | | > http://java.sun.com/javase/downloads/ < | | | | HBase requires Java 1.6 or later. | | NOTE: This script will find Sun Java whether you install using the | | binary or the RPM based installer. | +======================================================================+
JAVA_HOMEを設定しろとのことなので、設定。ついでにPATHも通しておく。
$ vi .bash_profile PATH=$PATH:/usr/local/src/hbase-0.94.4/bin export JAVA_HOME=/usr/lib/jvm/jre-openjdk $ source .bash_profile
起動
$ start-hbase.sh starting master, logging to /usr/local/src/hbase-0.94.4/bin/../logs/hbase-root-master-localhost.localdomain.out
web画面は60010portにアクセス。FWを開放。
$ vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 60010 -j ACCEPT $ /etc/init.d/iptables restart
停止する時は
$ stop-hbase.sh
と実行する。