mirror of
https://github.com/acme-dns/acme-dns.git
synced 2026-04-27 04:45:48 +03:00
[GH-ISSUE #262] HA Configuration #135
Labels
No labels
Documentation
Documentation
bug
enhancement
feature request
feature request
help wanted
pull-request
question
security
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/acme-dns#135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jwomackgsa on GitHub (May 5, 2021).
Original GitHub issue: https://github.com/acme-dns/acme-dns/issues/262
Has anyone run acme-dns in a highly available config using the postgres DB? Before I go testing myself, I was just wondering if anyone had multiple instances of acme-dns running against the same PG db without issues?
@laingsc commented on GitHub (Sep 8, 2021):
Yup, just did this and seems to work just fine.
@JonathanATyler commented on GitHub (Sep 16, 2021):
Same here. Running two instances using a postgresql cluster backend with reverse proxy in front for http load-balancing.
Authenticate/Update using one domain (acme.example.com) and serve dns records using acme-dns.example.com.
NS records point to the each server. Works great!
Note that I removed the A record from the example config as I'm using a separate name pointing at the WebProxy for that. The WebProxy requires authentication for registration requests. Had to tweak the python script for certbot a little but it wasn't too bad.
@ZPascal commented on GitHub (Dec 1, 2021):
@JonathanATyler Unfortunately, when creating my HA setup, I have the problem that each instance acts individually and the initial acme record is set in all instances individually and it comes to an error when reading the data. Could you please share your configuration?
@p3l1 commented on GitHub (Dec 7, 2021):
@ZPascal I can support your observations. The acme-dns service seems to load all txt records in the database when it is first started, but does not add new ones, which were added by another instance while the first instance is still running.
After the first instance is restarted, both instances are serving the same records again.
@JonathanATyler any chance of sharing your configuration with us?
@JonathanATyler commented on GitHub (Dec 7, 2021):
Hi @ZPascal, @p3l1
Sorry for the delay. Below is my config, I have not experienced that issue myself thus far, but I haven't thoroughly tested it either as I haven't had any issue with getting my certs. I'm not sure exactly which version I'm using either, probably whatever was available in Sept.
As a side note, I'm actually thinking of setting up a few more instances, just to do the http/api side behind my DMZ (where it's safer), with DNS only on DMZ side. So that might give me some more insight with regards to the issues you're seeing, given that the DNS side won't actually be updating records directly. I will also have a look at postgresql logs to see if queries are actually going through, when I have time.
@p3l1 commented on GitHub (Dec 13, 2021):
@JonathanATyler Are you using TLS in production? When using two different acme-dns Server the automatic certificate creation is not working correctly, because the challenge may be answered by the wrong server in my current setup.
Any ideas on how to solve this issue?
I am using the following DNS Configuration:
@JonathanATyler commented on GitHub (Dec 13, 2021):
@p3l1 I too had trouble getting auto-cert to work in that regard. This is all in a HomeLab at the moment, so I don't really worry about https internally. I use a reverse proxy to handle TLS of the web traffic, and forward http to the ACME-DNS servers on port 8080 (no TLS). Theoretically you can try to request a cert through the proxy for acme,acme01,acme02 and push it to the ACME-DNS servers - to the path set in config (below). I may revisit this when I have time to see if I can do all this without a proxy as it would remove the need for additional auth tweaking needed when requesting certs, but that won't be for a while.
All that said, I'm not really actively using this anymore anyway as all my domains are hosted at Linode and I use their ACME-DNS API for most of my requests now so I don't have to manually update DNS records on parent domains.
@p3l1 commented on GitHub (Dec 16, 2021):
@JonathanATyler Alright, i am going to ditch the second instance for now. Due to the fact the system is not affecting the acme-dns clients directly, there shouldn't be problem when the service is offline for a few hours. As long as the database is stored savely and a recovery can be made quickly.
I will pick up on the idea to get a certificate by using the reverse proxy though.
Thanks for your support :)
@ZPascal commented on GitHub (Jan 3, 2022):
Hi @p3l1 , I've successfully set up a HA based setup of the ACME DNS server. I created a graphic, to describe my corresponding setup.
Basic setup:
ACME Configuration:
Apache load balancer Configuration:
I hope that helps and solves your problem. Feel free to contact me, if you need further details.
@JonathanATyler commented on GitHub (Jan 4, 2022):
@ZPascal nice setup, glad you were able to sort it out, and thanks for sharing it :)
When you say "Shared glusterfs storage folder between the ACME DNS instances to share the certs" is that just for the Self-Signed cert, or acme-dns data. If it's for acme-dns data (so they are all in sync when requesting certs) what path are you "glustering"?
Cheers!
@ZPascal commented on GitHub (Jan 4, 2022):
Hi @JonathanATyler Thx :)
What do mean with acme-dns data, the configuration file? I shared the complete
/home/acme-dnsfolder as glusterfs volume and the configuration of the acme instances is outside the folder.@JonathanATyler commented on GitHub (Jan 4, 2022):
@ZPascal
In a previous message it was said "The acme-dns service seems to load all txt records in the database when it is first started, but does not add new ones, which were added by another instance while the first instance is still running".
If the data is being stored on local disk first I wondered if your setup accounted for that by using glusterfs. Though it's more likely being stored in memory first and flushed to DB, but not read back from it unless restarted.
Have you found that to still be the case? Or were you able to get all of them to resolve the same data across the cluster?
@p3l1 commented on GitHub (Jan 5, 2022):
@ZPascal What kind of ACME Client are you using for Basic Authentification?
Does acme.sh have support for it?
@ZPascal commented on GitHub (Jan 5, 2022):
@p3l1 I've used the python implementation and modified it. I've opened a gist to share my modifications. I think you mean the acme.sh script? With some modifications, it should be possible to include the functionality inside the script.
@JonathanATyler I will check and test that, and I'll post an answer in few days.
@p3l1 commented on GitHub (Jan 6, 2022):
@ZPascal This is great! Thanks for sharing your implementation with us 😄
@p3l1 commented on GitHub (Jan 7, 2022):
I am planning to add Basic Authentification to the official certbot-dns-acmedns plugin, so it can be used directly inside nginx-proxy-manager, which already has the current version of the acme-dns plugin implemented.
https://github.com/pan-net-security/certbot-dns-acmedns/issues/2
@ZPascal commented on GitHub (Feb 7, 2022):
@JonathanATyler Sorry for the late reply. I could not see any problems with resolving the entries. In my test case, I created 3 TXT entries in parallel and these were written to the database and the ACME client could continue without issues. If you have further questions, feel free to contact me!
@JonathanATyler commented on GitHub (Feb 7, 2022):
@ZPascal No worries, that was my experience as well. Thanks for confirming.