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

Update Sentinel docs #1283

Merged
merged 5 commits into from
Feb 8, 2022
Merged

Update Sentinel docs #1283

merged 5 commits into from
Feb 8, 2022

Conversation

jmcgill298
Copy link
Contributor

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).

@@ -138,7 +139,8 @@ CACHEOPS_SENTINEL = {
"db": 0,
"locations": [
("mysentinel.redis.example.com", 26379),
Copy link
Contributor

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"
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Member

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...

@glennmatthews glennmatthews changed the base branch from main to develop January 21, 2022 19:22
Copy link
Contributor

@glennmatthews glennmatthews left a 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!

@glennmatthews
Copy link
Contributor

@lampwins @nniehoff Do you have any further questions/suggestions before I go ahead and merge this? Thanks!

@nniehoff
Copy link
Contributor

nniehoff commented Feb 2, 2022

@lampwins @nniehoff Do you have any further questions/suggestions before I go ahead and merge this? Thanks!

LGTM

@bryanculver bryanculver merged commit b31d583 into nautobot:develop Feb 8, 2022
bryanculver added a commit that referenced this pull request Feb 8, 2022
@jmcgill298 jmcgill298 deleted the patch-1 branch March 14, 2023 21:41
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

6 participants