简体   繁体   English

如何在unix套接字上将Python RQ worker连接到Redis服务器?

[英]How do you connect Python RQ worker to a redis server on a unix socket?

I'm trying to connect a RQ worker to a Redis server on a Unix domain socket. 我正在尝试将RQ工作者连接到Unix域套接字上的Redis服务器。

I've tried the following 我尝试了以下

$ rq worker --url '/path/to/redis.sock'
Error 111 connecting to None:6379. Connection refused.

$ rq worker --url 'redis:///path/to/redis.sock'
Error 111 connecting to None:6379. Connection refused.

$ rq worker --url 'redis+socket:///path/to/redis.sock'
Error 111 connecting to None:6379. Connection refused.

There is mention of a --socket flag in a verion of the change log https://github.com/rq/rq/blob/995492878df5f6b7a32614a6050af0f3a4033e2c/CHANGES.md but that doesn't seem to work. 在更改日志的一部分中提到了--socket标志https://github.com/rq/rq/blob/995492878df5f6b7a32614a6050af0f3a4033e2c/CHANGES.md但这似乎不起作用。

$ rq worker --socket --url '/path/to/redis.sock'
Error: no such option: --socket

The correct URL syntax for connecting to a Redis server on a unix socket from RQ is unix:///path/to/redis.sock 从RQ连接到unix套接字上的Redis服务器的正确URL语法是unix:///path/to/redis.sock

$ rq worker --url unix:///path/to/redis.sock
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM