在CenOS6.4中使用HTTPSQS搭建佇列服務器

來源:互聯網
上載者:User

一、安裝過程
   1、下載libevent-2.0.12-stable,並編譯安裝

wget http://httpsqs.googlecode.com/files/libevent-2.0.12-stable.tar.gztar zxvf libevent-2.0.12-stable.tar.gzcd libevent-2.0.12-stable/./configure --prefix=/usr/local/libevent-2.0.12-stable/makemake install

   2、下載tokyocabinet-1.4.47.tar.gz,並編譯安裝

wget http://httpsqs.googlecode.com/files/tokyocabinet-1.4.47.tar.gztar zxvf tokyocabinet-1.4.47.tar.gzcd tokyocabinet-1.4.47/./configure --prefix=/usr/local/tokyocabinet-1.4.47/#註:在32位Linux作業系統上編譯Tokyo cabinet,請使用./configure --enable-off64代替./configure,可以使資料庫檔案突破2GB的限制。#./configure --enable-off64 --prefix=/usr/local/tokyocabinet-1.4.47/makemake install

   3、下載httpsqs-1.7.tar.gz,並編譯安裝

wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gztar zxvf httpsqs-1.7.tar.gzcd httpsqs-1.7/makemake install

二、安裝過程中出現的相關問題

   1、編譯httpsqs時候出現event.h檔案,解決方案:

yum install libevent libevent-devel

三、啟動httsqs服務,並加入到/etc/rc.local中:

vim /etc/rc.local

   添加如下內容:

httpsqs -d -p 1218 -x /opt/httpsqs/data

四、測試(查看是否安裝成功)
   在瀏覽器中執行如下操作:
   http://localhost:1218/?name=test&opt=put&data=測試        --向隊列中添加一條資料
   http://localhost:1218/?name=test&opt=status                --查看隊列的狀態
   http://localhost:1218/?name=test&opt=get                --從隊列中擷取一條資料

本文出自 “decode love” 部落格,謝絕轉載!

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.