tokyo tyrant 安装日志

tokyo tyrant是一个可持久化的缓存服务器,类似memcachedb,tokyo tyrant本身是个缓存服务器,但需要tokyo cabinet作为存储引擎,
就像memcachedb中的memcache需要berkeley db一样

1)安装存储引擎tokyo cabinet
[bash]
wget http://1978th.net/tokyocabinet/tokyocabinet-1.4.47.tar.gz
tar xzvf tokyocabinet-1.4.47.tar.gz
cd tokyocabinet-1.4.47
./configure –prefix=/path/to/tokyocabinet-1.4.47
make
sudo make install
[/bash]

2)如果需要使用像队列等扩展,则要安装lua
[bash]
wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
tar zxf lua-5.1.4.tar.gz
cd lua-5.1.4
make linux
make install
[/bash]
如果出现类似如下错误:
In file included from lua.h:16,
from lua.c:15:
luaconf.h:275:31: error: readline/readline.h: No such file or directory
luaconf.h:276:30: error: readline/history.h: No such file or directory
lua.c: In function ‘pushline’:
lua.c:182: warning: implicit declaration of function ‘readline’
lua.c:182: warning: assignment makes pointer from integer without a cast
lua.c: In function ‘loadline’:
lua.c:210: warning: implicit declaration of function ‘add_history’
make[2]: *** [lua.o] Error 1
make[2]: Leaving directory `/root/tool/lua-5.1.4/src’
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/root/tool/lua-5.1.4/src’
make: *** [linux] Error 2

则表示readline-devel没装, 执行yum -y install readline-devel安装,或者从源码安装:
[bash]
wget ftp://ftp.cwru.edu/pub/bash/readline-6.1.tar.gz
tar -zxvf readline-6.1.tar.gz
cd ~~ ./configure && make && make install
ldconfig
[/bash]

3)安装toyko tyrant
[bash]
wget http://1978th.net/tokyotyrant/tokyotyrant-1.1.41.tar.gz
tar xzvf tokyotyrant-1.1.41.tar.gz
cd tokyotyrant-1.1.41
./configure –prefix=/usr/local/tokyotyrant-1.1.41 –with-tc=/usr/local/tokyocabinet-1.4.47 –enable-lua
[/bash]

4) 测试
4.1)演示非持久性
4.1.1)启动服务:
bin/ttserver

4.1.2)使用客户端
另起一个终端
存放: bin/tcrmgr put localhost one first
获取: bin/tcrmgr get localhost one
得到结果 first

4.2.3)测试持久
重启ttserver,再次获取bin/tcrmgr get localhost one
没有结果

4.2)演示持久性
3.2.1)启动服务
bin/ttserver /tmp/x.tch

4.2.2)使用客户端
另起一个终端
存放: bin/tcrmgr put localhost one first
获取: bin/tcrmgr get localhost one

4.2.3)测试持久
重启ttserver
再次获取:
bin/tcrmgr get localhost one

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注


*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>