鎴戣繖閲屼嬌鐢ㄧ殑鏄疌entos6.4鐨勭幆澧冧笅闈㈡祴璇曠殑錛?br />ulimit -SHn 65535
瀹夎錛歭ibevent-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 ../
瀹夎錛歵okyocabinet-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鐨勬満鍣紝闇瑕佷嬌鐢?br />#./configure --enable-off64 --prefix=/usr/local/tokyocabinet-1.4.47/
榪欎釜鍛戒護(hù)錛屾澶栨垜瀹夎鐨勮繃紼嬩腑錛屽嚭鐜頒簡(jiǎn)榪欎釜閿欒鎻愮ず錛屾彁紺簍okyocabinet-1.4.47.tar.gz瀹夎涓嶆垚鍔燂紝瑙e喅鍔炴硶鏄紝瀹夎闇瑕佺殑杞歡鍖呭氨鍙互浜?
閿欒鎻愮ず涓錛?br />configure: error: zlib.h is required
瑙e喅鏂規(guī)硶鏄細(xì) # yum install zlib-devel
閿欒鎻愮ず浜岋細(xì)
configure: error: bzlib.h is required
瑙e喅鏂規(guī)硶鏄細(xì) # yum install bzip2-devel
涓嬮潰榪涘叆鍒頒簡(jiǎn)姝e紡鐜妭錛屼笂闈㈣鐨勪袱涓兘鏄負(fù)浜?jiǎn)httpsqs鐨勫畨瑁呭仛鐨勫墠鎻愬噯澶囷細(xì)
瀹夎錛歨ttpsqs-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 ../
鑷蟲瀹夎宸茬粡緇撴潫錛?br />
[root@xoyo ~]# httpsqs -h
-l <ip_addr> 鐩戝惉鐨処P鍦板潃錛岄粯璁ゅ間負(fù) 0.0.0.0
-p <num> 鐩戝惉鐨凾CP绔彛錛堥粯璁ゅ鹼細(xì)1218錛?/span>
-x <path> 鏁版嵁搴撶洰褰曪紝鐩綍涓嶅瓨鍦ㄤ細(xì)鑷姩鍒涘緩錛堜緥濡傦細(xì)/opt/httpsqs/data錛?/span>
-t <second> HTTP璇鋒眰鐨勮秴鏃舵椂闂達(dá)紙榛樿鍊鹼細(xì)3錛?/span>
-s <second> 鍚屾鍐呭瓨緙撳啿鍖哄唴瀹瑰埌紓佺洏鐨勯棿闅旂鏁幫紙榛樿鍊鹼細(xì)5錛?/span>
-c <num> 鍐呭瓨涓紦瀛樼殑鏈澶ч潪鍙跺瓙鑺傜偣鏁幫紙榛樿鍊鹼細(xì)1024錛?/span>
-m <size> 鏁版嵁搴撳唴瀛樼紦瀛樺ぇ灝忥紝鍗曚綅錛歁B錛堥粯璁ゅ鹼細(xì)100錛?/span>
-i <file> 淇濆瓨榪涚▼PID鍒版枃浠朵腑錛堥粯璁ゅ鹼細(xì)/tmp/httpsqs.pid錛?/span>
-a <auth> 璁塊棶HTTPSQS鐨勯獙璇佸瘑鐮侊紙渚嬪錛歮ypass123錛?/span>
-d 浠ュ畧鎶よ繘紼嬭繍琛?/span>
-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銆乸ut 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 ~]#
濡傛灉鍏ラ槦鍒楁垚鍔燂紝榪斿洖錛?/span>
HTTPSQS_PUT_OK
銆銆濡傛灉鍏ラ槦鍒楀け璐ワ紝榪斿洖錛?/span>
HTTPSQS_PUT_ERROR
銆銆濡傛灉闃熷垪宸叉弧錛岃繑鍥烇細(xì)
HTTPSQS_PUT_END
2銆乬et a queue
http://192.168.59.129:1218/?name=your_queue_name&opt=get&auth=mypass123
3銆佹煡鐪嬮槦鍒楃姸鎬侊細(xì)
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銆佷嬌鐢╦son鏍煎紡鏌ョ湅闃熷垪鍐呭
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}
鍙傝冩枃妗o細(xì)http://blog.s135.com/httpsqs/7/1/
http://code.google.com/p/httpsqs/