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

notify systemd when consul daemon is really started #552

Merged
merged 1 commit into from
Jan 15, 2021

Conversation

ymartin-ovh
Copy link
Contributor

@ymartin-ovh ymartin-ovh commented Oct 7, 2020

Have the following issue on my environment:

puppet runs:

# Notice: /Stage[main]/Consul::Run_service/Service[consul]: Triggered 'refresh' from 1 event
# Warning: Cannot retrieve ACL token list: Failed to open TCP connection to localhost:8500 (Address family not supported by protocol - socket(2) for "localhost" port 8500)

I suspect that systemd returns to fast and assume that daemon is ready but it is not the case.
Since consul can notify systemd, I change type from simple (default when type is absent) to notify.

External links:
https://www.hashicorp.com/resources/systemd-the-good-parts

@solarkennedy
Copy link
Contributor

You are right, and it is set like this in an "upstream" version of this unit file:
https://learn.hashicorp.com/tutorials/consul/deployment-guide#configure-systemd

That's cool!

@ymartin-ovh
Copy link
Contributor Author

ymartin-ovh commented Oct 8, 2020

Thanks for the link. It seems, we need to keep type=exec for standalone deployment.
Don't know if consul::config_hash['retry_join'] > 1 is sufficient to select the right server type.

Regards

@solarkennedy solarkennedy merged commit e01ec49 into voxpupuli:master Jan 15, 2021
@chrisboulton
Copy link
Contributor

I was about to go implement support for Type=notify in this same module before I came across this change and realised we were just using an out of date version.

Our environment relies on auto-discovery support in Consul, which means our configuration for retry_join only has one entry:

  "retry_join": [
    "provider=gce tag_value=.. zone_pattern=.."
  ],

I'm wondering if it makes sense to submit a PR that changes this to Type=notify always, and what the downside of that change would be? (alternatively maybe we move this into a configurable param and remove the determining logic?)

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