Install and use the Pythonrq module in Ubuntu14.04

Source: Internet
Author: User
Tags redis cli install redis
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

rqYesPythonA third-party module, usingrqConvenient and quick implementationPythonTo realize the distributed architecture of multi-state computers. WhereRYesRedisMeaning,QYesQueueFirst letter,rqUseRedisAndQueueDistributedMasterAndWorker, ThroughRedisStorage task queue.

Ubuntu14.04 install rq

Assume that you have installedPythonAndpip, This article passes`pipTo installrq

$sudo pip install rq 
Install Redis

rqModule usageredisStores queue information, so that multiple machines can read the same queue at the same time, that is, multiple`workerAt the same time, this achieves our goal. InUbuntuInstallRedisIt is relatively simple. Just use the following command. In addition to the installationRedisIn addition, it will help you installredis-cli.

$sudo apt-get install redis-server

After the installation is complete, try to start it.ReidsTo check whether the installation is successful.

$ redis-server

The above command will start with the default settingsRedisService. 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:

BecauseRedisThe default port is 6379. You can view the ip address of the port 6379 listener.RedisBy default127.0.0.1, You can/etc/redis/redis.conf.

RedisBound 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,RedisYou can acceptredis cliConnected

Install rq-dashboard

rq-dashboardIs a monitoringrqExecution statuspythonLibrary, which can display the currentQueue, EachQueueHow manyJobAnd how manyWorkerIn the working status, it also shows the failedJob. AvailablepipEasy 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-uParameters are requiredRedisConnection address. The following information is displayed after the connection is started successfully.

We can see thatRq dashboardThe version information and the running address port, that is, we can access it through a browser. The default port is9181,IPThe address is startrq-dashboardMachineip, Access from a computer on the same LANhttp://192.168.0.107:9181, Where192.168.0.107Yes startrq-dashboardPCip.

Rq-dashboardIt is a useful tool for graphical monitoring.rqIs not controlledworkerBut I believe these functions will be supported soon.

rqUse

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.