-
Notifications
You must be signed in to change notification settings - Fork 264
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
Update Sentinel docs #1283
Update Sentinel docs #1283
Conversation
Release v1.2.2
Release v1.2.3
Release v1.2.4
@@ -138,7 +139,8 @@ CACHEOPS_SENTINEL = { | |||
"db": 0, | |||
"locations": [ | |||
("mysentinel.redis.example.com", 26379), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is possible to use a DNS entry here that resolves to the 3 sentinel servers as well
f"sentinel://:{redis_password}@othersentinel.redis.example.com:26379", | ||
f"sentinel://:{redis_password}@mysentinel.redis.example.com:26379;" | ||
f"sentinel://:{redis_password}@othersentinel.redis.example.com:26379;" | ||
f"sentinel://:{redis_password}@thirdsentinel.redis.example.com:26379" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should note that the final entry should not end with a semicolon. When it is present, Celery tries to append a localhost entry to the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, although I see just an empty string.
nautobot@ip-10-0-11-123:~$ nautobot-server celery inspect stats
-> celery@ip-10-0-11-123: OK
{
"broker": {
"alternates": [
"sentinel://10.0.10.179:26379",
"sentinel://10.0.10.158:26379",
"sentinel://10.0.11.143:26379",
""
],
Now that I know how to inspect this, I will test things out and update accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the docs, I did retry using a list and removing the trailing delimiter, but this did not work (as experienced previously).
https://docs.celeryproject.org/en/stable/userguide/configuration.html#broker-url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah in some cases (not sure of the specifics) the empty string is interpreted as localhost. This threw me for a loop recently. Not sure on the list, seems like their docs are off...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me. Thanks!
Update Sentinel docs to have 3 hosts (minimum per Redis docs), and change
CELERY_BROKER_URL
to a multiline string instead of a Tuple (tuple is invalid, and raises an exception when job completes).