Rq is a third-party module of Python. Using rq, You can conveniently and quickly implement Python queue operations and implement the distributed architecture of multi-state computers. Here, R indicates Redis, and Q is the first letter of Queue. rq uses Redis and Queue for distributed implementation, implements Master and Worker respectively, and stores task queues through Redis. Ubuntu14.04 install rq assuming Python and pip have been installed, this article uses 'pip to install rq $ sudopip
rq
YesPython
A third-party module, usingrq
Convenient and quick implementationPython
To realize the distributed architecture of multi-state computers. WhereRYesRedis
Meaning,QYesQueue
First letter,rq
UseRedis
AndQueue
DistributedMaster
AndWorker
, ThroughRedis
Storage task queue.
Ubuntu14.04 install rq
Assume that you have installedPython
Andpip
, This article passes`pip
To installrq
$sudo pip install rq
Install
Redis
rq
Module usageredis
Stores queue information, so that multiple machines can read the same queue at the same time, that is, multiple`worker
At the same time, this achieves our goal. InUbuntu
InstallRedis
It is relatively simple. Just use the following command. In addition to the installationRedis
In addition, it will help you installredis-cli
.
$sudo apt-get install redis-server
After the installation is complete, try to start it.Reids
To check whether the installation is successful.
$ redis-server
The above command will start with the default settingsRedis
Service. If you see the following beautiful startup interface, the installation is successful.
However, the amount is not enough. Run the following command to see what we can see.
$ netstat -an | grep 6379
Result:
BecauseRedis
The default port is 6379. You can view the ip address of the port 6379 listener.Redis
By default127.0.0.1
, You can/etc/redis/redis.conf
.
Redis
Bound to the default configuration127.0.0.1
, Comment outBind 127.0.0.1You can. Then restartRedis
.
$ sudo /etc/init.d/redis-server restart
Execute againnetstat -an | grep 6379
As you can see,Redis
You can acceptredis cli
Connected
Install
rq-dashboard
rq-dashboard
Is a monitoringrq
Execution statuspython
Library, which can display the currentQueue
, EachQueue
How manyJob
And how manyWorker
In the working status, it also shows the failedJob
. Availablepip
Easy installationDashboard
.
$sudo pip install rq-dashboard
After the installation is successful, run the following command to startrq-dashboard
$rq-dashboard -u "redus://192.168.0.107:6379"
Where-u
Parameters are requiredRedis
Connection address. The following information is displayed after the connection is started successfully.
We can see thatRq dashboard
The version information and the running address port, that is, we can access it through a browser. The default port is9181,IP
The address is startrq-dashboard
Machineip
, Access from a computer on the same LANhttp://192.168.0.107:9181
, Where192.168.0.107
Yes startrq-dashboard
PCip
.
Rq-dashboard
It is a useful tool for graphical monitoring.rq
Is not controlledworker
But I believe these functions will be supported soon.
rq
Use
Refer to official documentation
You may also like the following article about Python:
Python: Find the file http://www.linuxidc.com/Linux/2015-08/121283.htm that meets the conditions under the specified directory
Python2.7.7 source code analysis http://www.linuxidc.com/Linux/2015-08/121168.htm
Run Python code http://www.linuxidc.com/Linux/2015-05/117357.htm directly without the need for an operating system
Install Python3.4 http://www.linuxidc.com/Linux/2015-01/111870.htm on CentOS source code
Python core programming version 2. (Wesley J. Chun). [High Definition PDF Chinese edition] http://www.linuxidc.com/Linux/2013-06/85425.htm
(Zhou Wei, Zong Jie). [hd PDF scan version + book with video + code] http://www.linuxidc.com/Linux/2013-11/92693.htm
Python script to get Linux information http://www.linuxidc.com/Linux/2013-08/88531.htm
Build a desktop algorithm transaction research environment http://www.linuxidc.com/Linux/2013-11/92534.htm with Python in Ubuntu
Brief history of Python development http://www.linuxidc.com/Linux/2014-09/107206.htm
Python details: Click here
Python: Click here
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-08/122441.htm