前提条件
Hadoopはインストール済みとします。
Hadoop構築:http://qiita.com/ma2k8/items/0cd34987211f5fe9ec2c
Formula書き換え
Hadoopの2系を利用していますが、現在brewで入るのは1系用の0.94系なのでformulaを書き換え
※Hbaseのライブラリも0.96系を利用しているのでついでに合わせとく
- ソースファイルのハッシュ確認
$ wget http://ftp.meisei-u.ac.jp/mirror/apache/dist/hbase/hbase-0.96.1.1/hbase-0.96.1.1-hadoop2-bin.tar.gz
openssl sha1 hbase-0.96.1.1-hadoop2-bin.tar.gz
- ソースファイルのハッシュ確認
$ brew edit hbase
# 5,6行目を書き換え
+ url 'http://ftp.meisei-u.ac.jp/mirror/apache/dist/hbase/hbase-0.96.1.1/hbase-0.96.1.1-hadoop2-bin.tar.gz'
+ sha1 '330b1dcac3a43e18e1036ab90315246df95632ca'
インストール
$ brew install hbase
$ cd /usr/local/opt/hbase/libexec/conf/
設定
hbase-env.sh
export HBASE_CLASSPATH=/usr/local/opt/hadoop/libexec/etc/hadoop
hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
<description>The directory shared by region servers.
</description>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/opt/hbase/user_name/zookeeper</value>
</property>
</configuration>
※${user_name}は適宜書き換え
.zsh.rc
export HBASE_HOME=/usr/local/opt/hbase/libexec
起動
$ start-all.sh
$ start-hbase.sh
動作確認
$ hbase shell
> create "testtable", "testcolumn"
> describe "testtable"
> put "testtable", "testrow", "testcolumn:x","y"
> get "testtable", "testrow"
> scan "testtable"
> quit