公式サイト
Kyoto Cabinet: a straightforward implementation of DBM
Kyoto Tycoon: a handy cache/storage server
Kyoto cabinetをインストール
# wget http://fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.70.tar.gz
# apt-get install g++
zlibはインストールされているので無視する。
configure & make
# tar -zxvf kyotocabinet-1.2.70.tar.gz
# cd kyotocabinet-1.2.70
# ./configure
# make
# make install
インストールされているかテスト。下記が表示されれば問題なし。
# kchashmgr
kchashmgr: the command line utility of the file hash database of Kyoto Cabinetusage:
kchashmgr create [-otr] [-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] path
kchashmgr inform [-onl|-otl|-onr] [-st] path
kchashmgr set [-onl|-otl|-onr] [-add|-rep|-app|-inci|-incd] [-sx] path key value
kchashmgr remove [-onl|-otl|-onr] [-sx] path key
kchashmgr get [-onl|-otl|-onr] [-rm] [-sx] [-px] [-pz] path key
kchashmgr list [-onl|-otl|-onr] [-max num] [-rm] [-sx] [-pv] [-px] path [key]
kchashmgr clear [-onl|-otl|-onr] path
kchashmgr import [-onl|-otl|-onr] [-sx] path [file]
kchashmgr copy [-onl|-otl|-onr] path file
kchashmgr dump [-onl|-otl|-onr] path [file]
kchashmgr load [-otr] [-onl|-otl|-onr] path [file]
kchashmgr defrag [-onl|-otl|-onr] path
kchashmgr setbulk [-onl|-otl|-onr] [-sx] path key value ...
kchashmgr removebulk [-onl|-otl|-onr] [-sx] path key ...
kchashmgr getbulk [-onl|-otl|-onr] [-sx] [-px] path key ...
kchashmgr check [-onl|-otl|-onr] path
Kyoto Tycoonのインストール
普通にダウンロードして、configure & make.
# wget http://fallabs.com/kyototycoon/pkg/kyototycoon-0.9.51.tar.gz
# tar -zxvf kyototycoon-0.9.51.tar.gz# cd kyototycoon-0.9.51
# ./configure
# make
# make install
動作確認を行う。
下記のコマンドを入力する。
# ktserver
2011-10-31T16:44:07.113262+09:00: [SYSTEM]: ================ [START]: pid=19714
2011-10-31T16:44:07.113385+09:00: [SYSTEM]: opening a database: path=:
2011-10-31T16:44:07.113544+09:00: [SYSTEM]: starting the server: expr=:1978
2011-10-31T16:44:07.113607+09:00: [SYSTEM]: server socket opened: expr=:1978 timeout=30.0
2011-10-31T16:44:07.113627+09:00: [SYSTEM]: listening server socket started: fd=3
別でターミナルを立ち上げて、下のようになればOK。
$ ktremotemgr set japan tokyo
$ ktremotemgr set korea seoul
$ ktremotemgr set china beijing$ ktremotemgr get japan
tokyo
$ ktremotemgr get korea
seoul
$ ktremotemgr get china
beijing
以上でインストールはOK。課題としてはレプリケーションなど。