|
Rq is a third-party Python modules using rq can quickly and easily achieve Python queue operations, distributed architecture to achieve multi-state computer. Wherein R is Redis mean, Q is Queue initials, rq use Redis and Implementation of Distributed Queue, and were achieved Master Worker, by Redis storage tasks queue.
Ubuntu14.04 installation rq
Suppose you have Python installed and pip, this article to install rq by `pip
$ Sudo pip install rq
Install Redis
rq module uses redis save queue information, thereby ensuring that multiple machines simultaneously read from the same queue, that is, a plurality of `worker working at the same time, it also reached our goal. Redis installed in Ubuntu is simple, use the following command to the command to install Redis addition, it will also help you to kindly install redis-cli.
$ Sudo apt-get install redis-server
After the installation is complete, you can try to start at Reids, check whether the installation was successful.
$ Redis-server
The above command will use the default settings to start Redis service, if you see the following beautiful interface start the installation was successful.
But not finished volume, use the following command to see if we can see what
$ Netstat -an | grep 6379
Since Redis default port is 6379, the command to view the listening port 6379 ip, you can see Redis default binding is 127.0.0.1, you can see in this setting /etc/redis/redis.conf.
The default configuration Redis is bound 127.0.0.1, commented to bind 127.0.0.1. Then restart Redis.
$ Sudo /etc/init.d/redis-server restart
Executive netstat -an again | grep 6379
You can see the change, Redis already accepted redis cli with a LAN connected
Installation rq-dashboard
rq-dashboard is a rq monitor the status of implementation of the python library, which can display the current which Queue, Queue number for each Job, and how much Worker in working condition, also shows the failure of Job. You can use pip easily install Dashboard.
$ Sudo pip install rq-dashboard
After successful installation, use the following command to start rq-dashboard
$ Rq-dashboard -u "redus: //192.168.0.107: 6379"
After Redis -u parameter which is required to use the connection address, successfully started you can see the following information
It can be seen Rq dashboard version information, and operating address port, that is, we can access through a browser, the default port is 9181, IP address is the start rq-dashboard machines ip, computer in the same LAN access http: / /192.168.0.107:9181, which is 192.168.0.107 start rq-dashboard computer ip.
Rq-dashboard is a useful tool, work status graphically monitor rq, but the fly in the ointment, can not control the worker's job, but I believe it should be to support these functions very quickly. |
|
|
|