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

chore(celery): add option for master_name that goes here #287

Merged
merged 2 commits into from
Sep 23, 2023

Conversation

kashalls
Copy link
Contributor

Adds an option for celery transport options to allow sentinel options with redis
Solves #285.

@kashalls
Copy link
Contributor Author

kashalls commented Sep 22, 2023

Sorry about the no information being posted, needed a bit to type this up.
I'm unfamiliar with Python so I'm doing my best here.

According to the celery backends and brokers documentation, when connecting to a Redis Sentinel Cluster you need to bind app.conf.broker_transport_options with { 'master_name': "cluster1" } with cluster1 being the name of the cluster.

So in the case of using shynet inside of a kubernetes cluster using bitnami's redis chart (see my use case here), you would need to pass your env with this:

BROKER_TRANSPORT_OPTIONS: "{'master_name':'redis-master'}"
CELERY_BROKER_URL: "sentinel://redis-node-0.redis-headless.default.svc.cluster.local:26379/6;sentinel://redis-node-1.redis-headless.default.svc.cluster.local:26379/6;sentinel://redis-node-2.redis-headless.default.svc.cluster.local:26379/6"

AFAIK, this should be all that is needed to make this work after talking with @ZandercraftGames who avidly uses shynet itself.

@milesmcc milesmcc self-requested a review September 23, 2023 02:55
@milesmcc milesmcc merged commit b4c2ebc into milesmcc:master Sep 23, 2023
1 check passed
@milesmcc
Copy link
Owner

Thanks!

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.

None yet

2 participants