`

CentOS5.8 64位平台上,HTTPSQS 编译安装

阅读更多
引用自:http://blog.s135.com/httpsqs/

1、ulimit -SHn 65535
或者永久加入profile文件:
# echo "ulimit -SHn 65535" >> /etc/profile
# source /etc/profile

2、从 http://libevent.org/ 处下载最新版本的libevent
目前是:https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable/
./configure --prefix=/usr/local/libevent-2.0-stable/
make
make install
cd ../

3、从 http://fallabs.com 处下载最新版本的tokyocabinet
目前是:http://fallabs.com/tokyocabinet/tokyocabinet-1.4.48.tar.gz

tar zxvf tokyocabinet-1.4.48.tar.gz
cd tokyocabinet-1.4.48/
./configure --prefix=/usr/local/tokyocabinet-1.4/
#注:在32位Linux操作系统上编译Tokyo cabinet,请使用./configure --enable-off64代替./configure,可以使数据库文件突破2GB的限制。
#./configure --enable-off64 --prefix=/usr/local/tokyocabinet-1.4/
make
make install
cd ../

如果遇到报告bzlib.h找不到的错误,则执行:
yum install bzip* make*

4、下载最新的httpsqs
wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz
tar zxvf httpsqs-1.7.tar.gz
cd httpsqs-1.7/
#注:必须修改Makefile文件,将其中的路径改为上述各程序的安装路径
make
make install
cd ../

报告错误: 错误:‘struct evhttp_request’ 没有名为 ‘uri_elems’ 的成员
主要是libevent-2.0.21.stable升级了所致,需要参考httpsqs1.6修改出错处的源代码

第491行:
    put_times = "2nd lap";
修改成:
    put_times = "2st lap";
否则httpsqs4j这个客户端解析会出错。


-l <ip_addr> 监听的IP地址,默认值为 0.0.0.0
-p <num> 监听的TCP端口(默认值:1218)
-x <path> 数据库目录,目录不存在会自动创建(例如:/opt/httpsqs/data)
-t <second> HTTP请求的超时时间(默认值:3)
-s <second> 同步内存缓冲区内容到磁盘的间隔秒数(默认值:5)
-c <num> 内存中缓存的最大非叶子节点数(默认值:1024)
-m <size> 数据库内存缓存大小,单位:MB(默认值:100)
-i <file> 保存进程PID到文件中(默认值:/tmp/httpsqs.pid)
-a <auth> 访问HTTPSQS的验证密码(例如:mypass123)
-d 以守护进程运行
-h 显示这个帮助

启动:
httpsqs -d -p 1218 -x /opt/httpsqs/queue

停止:
kill `cat /tmp/httpsqs.pid`

其他参考页面:
1、http://www.cnblogs.com/zhizhesky/articles/2156911.html

安装Tokyotrant参考:
1、http://blog.csdn.net/pwlazy/article/details/5313405
2、http://jasonyu.cn/post/32/
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics