Install and use the Python rq module in Ubuntu 14.04

Source: Internet
Author: User
Tags redis cli install redis

Install and use the Python rq module in Ubuntu 14.04

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.

 

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.