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

Django and Django Q on different server with Redis as broker #237

Closed
wishbooks opened this issue Apr 15, 2017 · 3 comments
Closed

Django and Django Q on different server with Redis as broker #237

wishbooks opened this issue Apr 15, 2017 · 3 comments

Comments

@wishbooks
Copy link

wishbooks commented Apr 15, 2017

I am trying to separate Django and django-q as my async tasks are heavy.

Can anyone please suggest me how can I achieve that?

I tried using remote broker, but it doesn't working

django : 1.7
django-q : 0.7.18
Mysql 5.6 - on django server

@Eagllus
Copy link
Collaborator

Eagllus commented Apr 18, 2017

I never tried this with different servers but I would assume you setup your application on both servers (django and django-q) and make sure both of them can access the Redis queue.

Server 1 (your app server) will receive the requests and queue them in Redis
Server 2 (your background worker server) will read the queue from Redis and processes the queue.

How did you try using remote broker?
https://django-q.readthedocs.io/en/latest/configure.html#redis

# redis defaults
Q_CLUSTER = {
    'redis': {
        'host': 'localhost',
        'port': 6379,
        ...
    }
}

Setting up Redis on something else then localhost (like an ip) should make it available for other servers, if your network settings allow it.

@wishbooks
Copy link
Author

Thank you!!

It's working now. I checked and found that SECRET_KEY was different even if project name was same. It is resolved now.

@Eagllus
Copy link
Collaborator

Eagllus commented Apr 19, 2017

Good to hear, and your always welcome 😄

@Eagllus Eagllus closed this as completed Feb 6, 2018
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

No branches or pull requests

2 participants