Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed setex method call : argument position was wrong #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunny316
Copy link

Fixed setex method call : argument position was wrong

@malone6
Copy link

malone6 commented Mar 16, 2020

Fixed setex method call : argument position was wrong

I aslo find this problem. The script[redis_cluster.py] can works with your PR,but i can't use it within celery. I can't understand second step in readme.md, How should I use the configuration file(celeryconfig.py) in celery. can you help me?

@sunny316
Copy link
Author

sunny316 commented Mar 16, 2020

Fixed setex method call : argument position was wrong

I aslo find this problem. The script[redis_cluster.py] can works with your PR,but i can't use it within celery. I can't understand second step in readme.md, How should I use the configuration file(celeryconfig.py) in celery. can you help me?

@malone6
The second step is adding the two config settings to the celery object that you create i.e.

celtasks = Celery(app_name, broker=broker_url)
celtasks.conf["CELERY_RESULT_BACKEND"] = "celery_redis_cluster_backend.redis_cluster.RedisClusterBackend"
celtasks.conf["CELERY_REDIS_CLUSTER_SETTINGS"] = { 'startup_nodes': [ {"host": "localhost", "port": "6379"}, {"host": "localhost", "port": "6380"}, {"host": "localhost", "port": "6381"} ]}

@malone6
Copy link

malone6 commented Mar 16, 2020

Fixed setex method call : argument position was wrong

I aslo find this problem. The script[redis_cluster.py] can works with your PR,but i can't use it within celery. I can't understand second step in readme.md, How should I use the configuration file(celeryconfig.py) in celery. can you help me?

@malone6
The second step is adding the two config settings to the celery object that you create i.e.

celtasks = Celery(app_name, broker=broker_url)
celtasks.conf["CELERY_RESULT_BACKEND"] = "celery_redis_cluster_backend.redis_cluster.RedisClusterBackend"
celtasks.conf["CELERY_REDIS_CLUSTER_SETTINGS"] = { 'startup_nodes': [ {"host": "localhost", "port": "6379"}, {"host": "localhost", "port": "6380"}, {"host": "localhost", "port": "6381"} ]}

Thank you for your prompt reply.
celtasks = Celery(app_name, broker=broker_url)
In this line,broker url should be a SQS uri
like 'redis://localhost:6379/0' 'amqp://guest:guest@localhost:5672//'.

but I use one client of redis-cluster as the SQS, it was start errorredis.exceptions.ResponseError: MOVED 14663 172.50.0.4:6393when i config redis-single-url like broker='redis://192.168.2.137:6391/0'.
How should i solve this problem if i want ensure HA of celery tasks?

@sunny316
Copy link
Author

I dont think Celery supports Redis Cluster as its broker(It supports redis for sure). It does not support it for its backend for sure, thats the reason we have to use this package. Try with another broker which is supported by celery like RabbitMQ etc.

@malone6
Copy link

malone6 commented Mar 18, 2020

Oh, I see. I confused broker and backend before this. Thank you for your answers and suggestions. I will try something else and that looks like there is still a long way to use redis-cluster as celery-broker.

@robertofalk
Copy link

Oh, I see. I confused broker and backend before this.

@malone6 sorry my dummy question, but what's the difference? I assume (but I'm not sure) that backend is for background tasking and broker is really as a message broker, is it right?

I was looking for an implementation of celery with Redis cluster as message broker and I ended up here, but I guess again it's a dead end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants