官方网站:http://1978th.net/ 变更为:http://fallabs.com/
本文所说的TTServer就是 TokyoTyrant+TokyoCabinet 。Tokyo Tyrant 提供dbm数据库Tokyo Cabinet的网络接口 。它使用简单的基于TCP/IP的简单二进制协议进行通信。同时它拥有Memcached兼容协议并且可以用HTTP/1.1协议进行数据交换。所以实现了跨平台,跨语言 使用Tokyo Tyrant。采用热备份,更新日志记录,复制(replication)来实现高可用性和高可靠性。到目前为止,Tokyo Tyrant可以运行在Linux, FreeBSD, Mac OS X, Solaris
[安装环境]:VirtualBox4.0、Ubuntu10.10
安装时已经切换到root账户下,整个安装过程分三步:
- 安装依靠的库
- 安装Tokyo Cabinet
- 安装TokyoTyrant
详细步骤如下:
【一】安装依靠的库:
- apt-get install zlib1g-dev
- apt-get install libbz2-dev
apt-get install 的过程范例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# apt-get install libbz2-dev 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 下列【新】软件包将被安装: libbz2-dev 升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 210 个软件包未被升级。 需要下载 31.4kB 的软件包。 解压缩后会消耗掉 111kB 的额外空间。 获取:1 http://cn.archive.ubuntu.com/ubuntu/ maverick/main libbz2-dev i386 1.0.5-4ubuntu1 [31.4kB] 下载 31.4kB,耗时 0秒 (59.4kB/s) 选中了曾被取消选择的软件包 libbz2-dev。 (正在读取数据库 ... 系统当前共安装有 119036 个文件和目录。) 正在解压缩 libbz2-dev (从 .../libbz2-dev_1.0.5-4ubuntu1_i386.deb) ... 正在设置 libbz2-dev (1.0.5-4ubuntu1) ... |
【二】安装Tokyo Cabinet:
安装过程执行linux标准的三步:
1 2 3 4 5 6 |
#wget http://1978th.net/tokyocabinet/tokyocabinet-1.4.46.tar.gz #tar zxvf tokyocabinet-1.4.46.tar.gz #cd tokyocabinet-1.4.46/ #./configure #make #make install |
tips:如果是32位系统需要在 ./configure 增加参数 –enable-off64 ,表示启动64位偏移,否则数据库文件超过2G就会出问题 。
[操作详情:]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# wget http://1978th.net/tokyocabinet/tokyocabinet-1.4.46.tar.gz --2011-01-10 10:49:11-- http://1978th.net/tokyocabinet/tokyocabinet-1.4.46.tar.gz 正在解析主机 1978th.net... 182.48.59.139 正在连接 1978th.net|182.48.59.139|:80... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度: 1002423 (979K) [application/x-gzip] 正在保存至: “tokyocabinet-1.4.46.tar.gz” 100%[======================================>] 1,002,423 87.6K/s 花时 8.5s 2011-01-10 10:49:21 (116 KB/s) - 已保存 “tokyocabinet-1.4.46.tar.gz” [1002423/1002423]) root@michael-VirtualBox:/opt# tar zxvf tokyocabinet-1.4.46.tar.gz root@michael-VirtualBox:/opt# cd tokyocabinet-1.4.46/ root@michael-VirtualBox:/opt/tokyocabinet-1.4.46# ./configure #================================================================ # Configuring Tokyo Cabinet version 1.4.46. #================================================================ ......省略 #================================================================ # Ready to make. #================================================================ root@michael-VirtualBox:/opt/tokyocabinet-1.4.46# make ......省略 #================================================================ # Ready to install. #================================================================ root@michael-VirtualBox:/opt/tokyocabinet-1.4.46# make install mkdir -p /usr/local/include cp -Rf tcutil.h tchdb.h tcbdb.h tcfdb.h tctdb.h tcadb.h /usr/local/include ......省略 #================================================================ # Thanks for using Tokyo Cabinet. #================================================================ |
【三】安装tokyotyrant:
安装过程执行linux标准的三步
1 2 3 4 5 6 |
#wget http://1978th.net/tokyotyrant/tokyotyrant-1.1.41.tar.gz #tar zxvf tokyotyrant-1.1.41.tar.gz #cd tokyotyrant-1.1.41/ #./configure #make #make install |
[操作详情:]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
root@michael-VirtualBox:/opt# wget http://1978th.net/tokyotyrant/tokyotyrant-1.1.41.tar.gz --2011-01-10 11:00:18-- http://1978th.net/tokyotyrant/tokyotyrant-1.1.41.tar.gz 正在解析主机 1978th.net... 182.48.59.139 正在连接 1978th.net|182.48.59.139|:80... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度: 196196 (192K) [application/x-gzip] 正在保存至: “tokyotyrant-1.1.41.tar.gz” 100%[========================================================>] 196,196 167K/s 花时 1.1s 2011-01-10 11:00:20 (167 KB/s) - 已保存 “tokyotyrant-1.1.41.tar.gz” [196196/196196]) root@michael-VirtualBox:/opt# tar zxvf tokyotyrant-1.1.41.tar.gz root@michael-VirtualBox:/opt# cd tokyotyrant-1.1.41/ root@michael-VirtualBox:/opt/tokyotyrant-1.1.41# ./configure #================================================================ # Configuring Tokyo Tyrant version 1.1.41. #================================================================ ......省略 #================================================================ # Ready to make. #================================================================ root@michael-VirtualBox:/opt/tokyotyrant-1.1.41# make ......省略 #================================================================ # Ready to install. #================================================================ root@michael-VirtualBox:/opt/tokyotyrant-1.1.41# make install ......省略 #================================================================ # Thanks for using Tokyo Tyrant. #================================================================ root@michael-VirtualBox:/opt/tokyotyrant-1.1.41# |
操作完成后有下述一系列文件被安装到不同的目录下:
12345678910111213141516171819202122 /usr/local/include/ttutil.h/usr/local/include/tculog.h/usr/local/include/tcrdb.h/usr/local/lib/libtokyotyrant.a/usr/local/lib/libtokyotyrant.so.x.y.z/usr/local/lib/libtokyotyrant.so.x/usr/local/lib/libtokyotyrant.so/usr/local/lib/ttskelmock.so/usr/local/lib/ttskeldir.so/usr/local/lib/ttskelproxy.so/usr/local/lib/ttskelnull.so/usr/local/lib/pkgconfig/tokyotyrant.pc/usr/local/bin/ttserver/usr/local/bin/ttultest/usr/local/bin/ttulmgr/usr/local/bin/tcrtest/usr/local/bin/tcrmttest/usr/local/bin/tcrmgr/usr/local/sbin/ttservctl/usr/local/share/tokyotyrant/.../usr/local/man/man1/.../usr/local/man/man3/...
可以在终端输入下述命令测试服务启动,按Ctrl +C 终止服务 :
1 |
ttserver |
输入:ttserver 命令回车,输出信息如下:
12345678910111213141516 # ttserver2012-02-16T14:26:43+08:00 SYSTEM --------- logging started [5240] --------2012-02-16T14:26:43+08:00 SYSTEM server configuration: host=(any) port=19782012-02-16T14:26:43+08:00 SYSTEM maximum connection: 10485752012-02-16T14:26:43+08:00 SYSTEM opening the database: *2012-02-16T14:26:43+08:00 SYSTEM service started: 52402012-02-16T14:26:43+08:00 INFO timer thread 1 started2012-02-16T14:26:43+08:00 INFO worker thread 1 started2012-02-16T14:26:43+08:00 INFO worker thread 2 started2012-02-16T14:26:43+08:00 INFO worker thread 3 started2012-02-16T14:26:43+08:00 INFO worker thread 4 started2012-02-16T14:26:43+08:00 INFO worker thread 5 started2012-02-16T14:26:43+08:00 INFO worker thread 6 started2012-02-16T14:26:43+08:00 INFO worker thread 7 started2012-02-16T14:26:43+08:00 INFO worker thread 8 started2012-02-16T14:26:43+08:00 SYSTEM listening started
按Ctrl +C 停止服务后输出信息如下:
1234567891011121314 2012-02-16T14:28:43+08:00 INFO signal interruption2012-02-16T14:28:43+08:00 SYSTEM listening finished2012-02-16T14:28:43+08:00 SYSTEM closing the database2012-02-16T14:28:43+08:00 INFO worker thread 1 finished2012-02-16T14:28:43+08:00 INFO worker thread 2 finished2012-02-16T14:28:43+08:00 INFO worker thread 3 finished2012-02-16T14:28:43+08:00 INFO worker thread 4 finished2012-02-16T14:28:43+08:00 INFO worker thread 5 finished2012-02-16T14:28:43+08:00 INFO worker thread 6 finished2012-02-16T14:28:43+08:00 INFO worker thread 7 finished2012-02-16T14:28:43+08:00 INFO worker thread 8 finished2012-02-16T14:28:43+08:00 INFO timer thread 1 finished2012-02-16T14:28:43+08:00 SYSTEM service finished2012-02-16T14:28:43+08:00 SYSTEM --------- logging finished [5240] --------
到此TTServer在Ubuntu10.10上安装成功。
原创文章,转载请注明: 转载自micmiu – 软件开发+生活点滴[ http://www.micmiu.com/ ]
本文链接地址: http://www.micmiu.com/nosql/ttserver-ubuntu-install/
0 条评论。