Installing Libevent[Root @localhost httpsqs]# wget http://httpsqs.googlecode.com/files/libevent-2.0.12-stable.tar.gz [Root @localhost httpsqs]# tar-zxf libevent-2.0.12-stable.tar.gz [root @localhost httpsqs]# cd libevent-2.0.12-stable [root @localhost li bevent-2.0.12-stable]#./configure--prefix=/usr/local/libevent-2.0.12-stable/[Root @localhost libevent-2.0.12-stable]# make [e-mail protected] libevent-2.0.12-stable]# make install [[email protected] libevent-2.0.12-stable]# CD.
Installing Tokyocabinet[Email protected] httpsqs]# wget http://httpsqs.googlecode.com/files/tokyocabinet-1.4.47.tar.gz [email protected] httpsqs]# tar-zxf tokyocabinet-1.4.47.tar.gz [[email protected] httpsqs]# CD tokyocabinet-1.4.47 # Note: To compile the Tokyo cabinet on a 32-bit Linux operating system, use the./configure--enable-off64 instead./configure, you can make the database file exceed the 2GB limit. #./configure--enable-off64--prefix=/usr/local/tokyocabinet-1.4.47/[[email protected] tokyocabinet-1.4.47]#. Configure--prefix=/usr/local/tokyocabinet-1.4.47/[[email protected] tokyocabinet-1.4.47]# make [email protected] tokyocabinet-1.4.47]# make install [[email protected] libevent-2.0.12-stable]# CD.
Installing HTTPSQS[Email protected] httpsqs]# wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz [[email protected] httpsqs]# TAR-ZXF httpsqs-1.7.tar.gz [[email protected] httpsqs]# CD httpsqs-1.7 [[email protected] httpsqs-1.7]# make [email pro Tected] httpsqs-1.7]# make install
[Email protected] httpsqs-1.7]#httpsqs-h--------------------------------------------------------------------------------------------------HTTP Simple Queue Service-httpsqs v1.7 (April 14, 2011)
-L Listening IP address, default value is 0.0.0.0-p listening TCP port (default: 1218)-x database directory, directory does not exist automatically created (for example:/opt/httpsqs/data)-T HTTP request timeout (default: 3)-S The number of seconds between synchronizing memory buffer contents to disk (default: 5)-C maximum number of non-leaf nodes in-memory cache (default: 1024x768)-m database memory cache size in MB (default: £)-I save process PID to file (default value:/tmp/httpsqs.pi d)-a access to the HTTPSQS authentication password (for example: mypass123)-D to the daemon run-H displays this help
UseKillall HttpsqsKill the HTTPSQS process in bulk. Close Httpsqs. Do not use pkill-9 Httpsqs or kill-9 PID of HTTPSQS. Otherwise, data that has not been saved to disk in memory will be lost
More Information view: HTTP://CODE.GOOGLE.COM/P/HTTPSQS
--------------------------------------------------------------------------------------------------
Start: [[email protected] httpsqs-1.7]# ulimit-shn 65535 [[email protected] httpsqs-1.7]# httpsqs-d-P 1218-x/usr/local/h ttpsqs/
[Email protected] httpsqs-1.7]# Netstat-atln | grep 1218 TCP 0 0 0.0.0.0:1218 0.0.0.0:* LISTEN
Test:
Queue Test-----------------------------accessed in the browser: http://yourid:1218/?name=sunyu&opt=put&data=testcontent&auth= Mypass123
If the in queue succeeds, return: HTTPSQS_PUT_OK
If the in queue fails, return: Httpsqs_put_error
If the queue is full, return: Httpsqs_put_end
Starting with Httpsqs version 1.2, a line of "pos:xxx" is added to the HTTP header header returned to the client, outputting the read location point of the current queue. Can be found in the response returned by Firebug or chorm: Cache-control:no-cache connection:keep-alive content-length:14 content-type:text/ Plain Date:sat, Dec 14:00:27 GMT pos:5
out of the team Test-----------------------------The above instance is the put value in the queue. is to pass the message to the queue. Here's the test for the team: Http://yourid:1218/?name=sunyu&opt=get&auth=mypass123 returns the result of the previous put in.
Queue Status-----------------------------http://yourid:1218/?name=sunyu&opt=status&auth=mypass123
HTTP Simple queue Service v1.7------------------------------Queue Name:sunyu Maximum number of queues:1000000 Put posi tion of the queue (1st lap): 1 Get position of the queue (1st lap): 1 Number of unread queue:0
View status in JSON format: http://yourid:1218/?name=sunyu&opt=status_json&auth=mypass123
View the contents of a specified queue location point-----------------------------http://yourid:1218/?charset=utf-8&sunyu&opt=view&pos=1&auth= Mypass123
POS >=1 and <= 1000000000
Returns the contents of the specified queue location point.
Resets the specified queue-----------------------------http://yourid:1218/?name=sunyu&opt=reset&auth=mypass123
If the reset succeeds, return:
Httpsqs_reset_ok
If the reset fails, return:
Httpsqs_reset_error
change the maximum number of queues for a specified queue:-----------------------------Default Maximum Queue Length (1 million): 1000000
Http://yourid:1218/?name=sunyu&opt=maxqueue&num=1000000000&auth=mypass123 "
Num >=10 and <= 1000000000
If the maximum number of queues is changed successfully, the return: HTTPSQS_MAXQUEUE_OK
The maximum number of queues to change must be greater than the current queue write point. In addition, when the queue write point is less than the queue read point (that is, the put is in the second ring of the ring, and get is in the first lap of the ring), the operation is canceled and then returned to the client with the following information: Httpsqs_maxqueue_cancel
Modify the interval between the time the memory buffer content is refreshed and the disk without stopping the service:-----------------------------support this feature from the HTTPSQS 1.3 release.
The default interval time: 5 seconds or the value of the Httpsqs-s parameter setting.
Http://yourid:1218/?name=sunyu&opt=synctime&num=10&auth=mypass123 "
Num >=1 and <= 1000000000
If the modification interval succeeds, the return: HTTPSQS_SYNCTIME_OK
If num is not between 1 and 1000000000, this operation will be canceled and then returned to the client with the following information: Httpsqs_synctime_cancel
password check failed:-----------------------------support this feature from the HTTPSQS 1.5 release.
If the password check fails (/?auth=xxx), the following information is returned: httpsqs_auth_failed
Global Error:-----------------------------If a global error occurs (that is, an instruction, parameter error, and so on), the following information is returned: Httpsqs_error
Linux--Message Queuing HTTPSQS installation