手机版
你好,游客 登录 注册
背景:
阅读新闻

Httpsqs的安装以及安装过程错误的解决方法

[日期:2011-08-04] 来源:Linux社区  作者:ajun_studio [字体:大 中 小]

需求 :进行商品搜索的时候,要从索引中进行搜索,由于后台要更新商品和插入商品,当时考虑到了怎么来插入新的索引和更新索引的问题,通过讨论,大家决定用Httpsqs这个消息中间来通知插入新索引和删除索引最后合并索引,来做到商品信息的实时更新。

下面我来讲一下Httpsqs的安装过程 ,以及在安装过程遇到的问题。

准备工作:

你需要准备一个虚拟机这里我们采用VMware7.1,

Linux采用CentOS5.4 可以到http://vault.centos.org/5.4/isos/i386/CentOS-5.4-i386-bin-DVD.torrent这个网址进行下载。

安装 httpsqs

在安装httpsqs之前要安装

  1. libevent-2.0.12-stable.tar.gz和okyocabinet-1.4.47.tar.gz  
  1. ulimit -SHn 65535  
1、安装libevent-2.0.12-stable.tar.gz
  1. wget http://httpsqs.googlecode.com/files/libevent-2.0.12-stable.tar.gz##下载  
  2. tar zxvf libevent-2.0.12-stable.tar.gz##解压  
  3. cd libevent-2.0.12-stable/  
  4. ./configure --prefix=/usr/local/libevent-2.0.12-stable/  
  5. make  
  6. make install  
  7. cd ../  
安装tokyocabinet-1.4.47.tar.gz
  1. wget http://httpsqs.googlecode.com/files/tokyocabinet-1.4.47.tar.gz  
  2. tar zxvf tokyocabinet-1.4.47.tar.gz  
  3. cd tokyocabinet-1.4.47/  
  4. ./configure --prefix=/usr/local/tokyocabinet-1.4.47/  
  5. #注:在32位Linux操作系统上编译Tokyo cabinet,请使用./configure --enable-off64代替./configure,可以使数据库文件突破2GB的限制。  
  6. #./configure --enable-off64 --prefix=/usr/local/tokyocabinet-1.4.47/  
  7. make  
  8. make install  
  9. cd ../  
当执行第二步骤的会出错,是由于缺少bzip2-1.0.6.tar.gz

下面进行安装

  1. http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz安装开始;  
  2. wget  http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz  
  3. tar -xvzf bzip2-1.0.6.tar.gz  
  4. cd bzip2-1.0.6.  
  5. make  
  6.  make install  
在重复安装tokyocabinet-1.4.47.tar.gz还是失败,由于缺少zlib-1.2.5.tar.gz

下面进行安装

  1. http://www.winimage.com/zLibDll/zlib-1.2.5.tar.gz安装开始;  
  2. wget  http://www.winimage.com/zLibDll/zlib-1.2.5.tar.gz  
  3. tar -xvzf zlib-1.2.5.tar.gz  
  4. cd zlib-1.2.5.  
  5. ./configure  
  6. make  
  7. sudo make instal  
继续第2步骤 OK

3、安装httpsqs-1.7.tar.gz

  1. wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz  
  2. tar zxvf httpsqs-1.7.tar.gz  
  3. cd httpsqs-1.7/  
  4. make  
  5. make install  
  6. cd ../  
如果安装成功 执行httpsqs –h 会出现
  1. --------------------------------------------------------------------------------------------------  
  2. HTTP Simple Queue Service - httpsqs v1.7 (April 14, 2011)  
  3.   
  4.   
  5. Author: Zhang Yan (http://blog.s135.com), E-mail: net@s135.com  
  6. This is free software, and you are welcome to modify and redistribute it under the New BSD License  
  7.   
  8.   
  9. -l <ip_addr>  interface to listen on, default is 0.0.0.0  
  10. -p <num>      TCP port number to listen on (default: 1218)  
  11. -x <path>     database directory (example: /opt/httpsqs/data)  
  12. -t <second>   keep-alive timeout for an http request (default: 60)  
  13. -s <second>   the interval to sync updated contents to the disk (default: 5)  
  14. -c <num>      the maximum number of non-leaf nodes to be cached (default: 1024)  
  15. -m <size>     database memory cache size in MB (default: 100)  
  16. -i <file>     save PID in <file> (default: /tmp/httpsqs.pid)  
  17. -a <auth>     the auth password to access httpsqs (example: mypass123)  
  18. -d            run as a daemon  
  19. -h            print this help and exit  
  20.   
  21.   
  22. Use command "killall httpsqs", "pkill httpsqs" and "kill `cat /tmp/httpsqs.pid`" to stop httpsqs.  
  23. Please note that don't use the command "pkill -9 httpsqs" and "kill -9 PID of httpsqs"!  
  24.   
  25.   
  26. Please visit "http://code.google.com/p/httpsqs" for more help information.  
但是没有 出现的是:
  1. error while loading shared libraries: /usr/local/tokyocabinet-1.4.47/lib/libtokyocabinet.so.9: cannot restore segment prot after reloc: Permission denied  
在google一下,说是没有建立它的软连接:
  1. ln -s /usr/local/tokyocabinet-1.4.47/lib/libtokyocabinet.so.9 /usr/lib/libtokyocabinet.so.9  
可是做了,还是报错 继续google,解决办法为:
  1. vi /etc/sysconfig/selinux file  
  2. 修改SELINUX=disabled  
然后重启

再来一次

  1. httpsqs -h  
  2. --------------------------------------------------------------------------------------------------  
  3. HTTP Simple Queue Service - httpsqs v1.7 (April 14, 2011)  
  4.   
  5.   
  6. Author: Zhang Yan (http://blog.s135.com), E-mail: net@s135.com  
  7. This is free software, and you are welcome to modify and redistribute it under the New BSD License  
  8.   
  9.   
  10. -l <ip_addr>  interface to listen on, default is 0.0.0.0  
  11. -p <num>      TCP port number to listen on (default: 1218)  
  12. -x <path>     database directory (example: /opt/httpsqs/data)  
  13. -t <second>   keep-alive timeout for an http request (default: 60)  
  14. -s <second>   the interval to sync updated contents to the disk (default: 5)  
  15. -c <num>      the maximum number of non-leaf nodes to be cached (default: 1024)  
  16. -m <size>     database memory cache size in MB (default: 100)  
  17. -i <file>     save PID in <file> (default: /tmp/httpsqs.pid)  
  18. -a <auth>     the auth password to access httpsqs (example: mypass123)  
  19. -d            run as a daemon  
  20. -h            print this help and exit  
  21.   
  22.   
  23. Use command "killall httpsqs", "pkill httpsqs" and "kill `cat /tmp/httpsqs.pid`" to stop httpsqs.  
  24. Please note that don't use the command "pkill -9 httpsqs" and "kill -9 PID of httpsqs"!  
  25.   
  26.   
  27. Please visit "http://code.google.com/p/httpsqs" for more help information.  
安装成功!!linux
相关资讯       CentOS  Httpsqs 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款