ubuntu下安装ttserver V1.0
Author:gaojinbo
Time:2010-8-6
Tokyo Cabinet及Tokyo Tyrant 简介
TC(Tokyo Cabinet )是日本人平林幹雄开发的一款Key-Value 键值数据库,该数据库读写非常快,哈希模式写入100万条数据只需0.402秒,读取100万条数据只需0.334秒。
TT(Tokyo Tyrant )是由同一作者开发的Tokyo Cabinet 数据库网络接口。它拥有自己的协议,并支持Memcached兼容协议,也可以通过HTTP协议进行数据交换。哈希数据库读写速度大约在50000次/秒。
TC和TT目前运行在日本最大的SNS网站MIXI,在国内也有大量的生产环境应用。
ubuntu下安装ttserver
1.安装依赖包
apt-get install libzzip-dev libzip-dev zlib1g-dev libbz2-dev
2.首先编译安装tokyocabinet数据库
wget http://www.1978th.net/tokyocabinet/tokyocabinet-1.4.45.tar.gz
tar zxvf tokyocabinet-1.4.45.tar.gz
cd tokyocabinet-1.4.45/
./configure
make
make install
cd ../
3.然后编译安装tokyotyrant
wget http://www.1978th.net/tokyotyrant/tokyotyrant-1.1.40.tar.gz
tar zxvf tokyotyrant-1.1.40.tar.gz
cd tokyotyrant-1.1.40/
./configure
make
make install
4.修改启动参数
vi /usr/local/sbin/ttservctl
# configuration variables
prog="ttservctl"
cmd="ttserver"
basedir="/ttserver"
port="11211"
pidfile="$basedir/pid"
#logfile="$basedir/log"
#ulogdir="$basedir/ulog"
ulimsiz="1024m"
#sid=1
#mhost="remotehost1"
#mport="1978"
#rtsfile="$basedir/rts"
dbname="$basedir/database.tcb#lmemb=10240#nmemb=20480#bnum=20000000"
retval=0
5.添加到开机自动运行
vi /etc/rc.local
/usr/local/sbin/ttservctl start
netstat –antup
完成!
八月 17th, 2010 at 20:04
写哈希函数有多快啊
八月 18th, 2010 at 09:27
官方数据:
哈希数据库读写速度大约在50000次/秒
测试数据与硬件配置有关!
十一月 3rd, 2011 at 16:28
Read was interesting, stay in touch……
[...]please visit the sites we follow, including this one, as it represents our picks from the web[...]……