<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    少年阿賓

    那些青春的歲月

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks
    我這里使用的是Centos6.4的環境下面測試的:
    ulimit -SHn 65535
    安裝:libevent-2.0.12-stable.tar.gz

    wget http://httpsqs.googlecode.com/files/libevent-2.0.12-stable.tar.gz
    tar zxvf libevent-2.0.12-stable.tar.gz
    cd libevent-2.0.12-stable/
    ./configure --prefix=/usr/local/libevent-2.0.12-stable/
    make
    make install
    cd ../

    安裝:tokyocabinet-1.4.47.tar.gz
    wget http://httpsqs.googlecode.com/files/tokyocabinet-1.4.47.tar.gz
    tar zxvf tokyocabinet-1.4.47.tar.gz
    cd tokyocabinet-1.4.47/
    ./configure --prefix=/usr/local/tokyocabinet-1.4.47/
    #Note: In the 32-bit Linux operating system, compiler Tokyo cabinet, please use the ./configure --enable-off64 instead of ./configure to breakthrough the filesize limit of 2GB.
    #./configure --enable-off64 --prefix=/usr/local/tokyocabinet-1.4.47/
    make
    make install
    cd ../

    ##執行上面這個tokyocabinet-1.4.47.tar.gz軟件包安裝的時候,對于32bit的機器,需要使用
    #./configure --enable-off64 --prefix=/usr/local/tokyocabinet-1.4.47/
    這個命令,此外我安裝的過程中,出現了這個錯誤提示,提示tokyocabinet-1.4.47.tar.gz安裝不成功,解決辦法是,安裝需要的軟件包就可以了.

    錯誤提示一:
    configure: error: zlib.h is required
    解決方法是:  # yum install zlib-devel
    錯誤提示二:
    configure: error: bzlib.h is required
    解決方法是:  # yum install bzip2-devel

    下面進入到了正式環節,上面裝的兩個都是為了httpsqs的安裝做的前提準備:
    安裝:httpsqs-1.7.tar.gz
    wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz
    tar zxvf httpsqs-1.7.tar.gz
    cd httpsqs-1.7/
    make
    make install
    cd ../

    至此安裝已經結束:

    [root@xoyo ~]# httpsqs -h
    -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 顯示這個幫助


    [root@localhost ~]# ulimit -SHn 65535
    [root@localhost ~]# httpsqs -d -p 1218 -x /data0/queue -a mypass123
    [root@localhost ~]# ps -aux | grep httpsqs
    Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
    root 14378 0.0 0.0 396420 500 pts/0 S 10:44 0:00 [httpsqs: master process] /usr/bin/httpsqs -d -p 1218 -x /data0/queue -a mypass123
    root 14379 0.0 0.0 406664 716 pts/0 Sl 10:44 0:00 [httpsqs: worker process] /usr/bin/httpsqs -d -p 1218 -x /data0/queue -a mypass123
    root 14382 0.0 0.0 4356 756 pts/0 S+ 10:44 0:00 grep httpsqs
    1、put a queue
    [root@localhost ~]# curl "http://192.168.59.129:1218/?name=your_queue_name&opt=put&data=url_encoded_text_message&auth=mypass123"
    HTTPSQS_PUT_OK

    [root@localhost ~]#
    如果入隊列成功,返回:
    HTTPSQS_PUT_OK

      如果入隊列失敗,返回:
    HTTPSQS_PUT_ERROR

      如果隊列已滿,返回:
    HTTPSQS_PUT_END
    2、get a queue
    http://192.168.59.129:1218/?name=your_queue_name&opt=get&auth=mypass123
    url_encoded_text_message
    3、查看隊列狀態:
    http://192.168.59.129:1218/?name=your_queue_name&opt=status&auth=mypass123
    HTTP Simple Queue Service v1.7
    ------------------------------
    Queue Name: your_queue_name
    Maximum number of queues: 1000000
    Put position of queue (1st lap): 5
    Get position of queue (1st lap): 0
    Number of unread queue: 5
    4、使用json格式查看隊列內容

    http://192.168.59.129:1218/?name=your_queue_name&opt=status_json&auth=mypass123
    {"name":"your_queue_name","maxqueue":1000000,"putpos":5,"putlap":1,"getpos":1,"getlap":1,"unread":4}


    參考文檔:http://blog.s135.com/httpsqs/7/1/
    http://code.google.com/p/httpsqs/

    posted on 2014-03-01 15:26 abin 閱讀(1127) 評論(0)  編輯  收藏 所屬分類: httpsqs

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲精华液一二三产区| 免费人成激情视频| 亚洲精品私拍国产福利在线| 久青草国产免费观看| 亚洲片一区二区三区| 国产乱妇高清无乱码免费| 国产亚洲大尺度无码无码专线| 91av免费在线视频| 国产日韩亚洲大尺度高清| 国内精品免费在线观看| 亚洲视频一区在线观看| 黄色网址免费观看| 亚洲日韩国产欧美一区二区三区 | 亚洲丝袜美腿视频| 91精品啪在线观看国产线免费| 666精品国产精品亚洲| 99久久久国产精品免费无卡顿| 亚洲无mate20pro麻豆| 国产成人高清精品免费软件| 特a级免费高清黄色片| 亚洲精品无码专区久久久| 无码日韩精品一区二区免费暖暖| 亚洲第一成年网站大全亚洲| 24小时免费直播在线观看| jizzjizz亚洲日本少妇| 国产亚洲精品久久久久秋霞| 久久99精品视免费看| 亚洲永久在线观看| 精品亚洲成α人无码成α在线观看| 成人片黄网站色大片免费观看APP| 久久亚洲国产精品成人AV秋霞| 成人一a毛片免费视频| fc2成年免费共享视频网站| 久久亚洲精品国产精品| 妞干网免费视频观看| 久久久久久噜噜精品免费直播 | 亚洲无码黄色网址| 91精品视频在线免费观看| 亚洲AV永久无码精品一福利 | 亚洲精品无码专区在线播放| 国产啪亚洲国产精品无码|