Move PostgreSQL to VMs and access via Zerotier #282
No reviewers
Labels
No Label
service
accounts
service
discourse
service
drone-ci
service
email
service
garage
service
gitea
service
ipfs
service
mastodon
service
postgres
service
remotestorage
service
wiki
service
xmpp
bug
design
dev environment
docs
duplicate
enhancement
feature
good first issue
idea
invalid
kredits-1
kredits-2
kredits-3
on hold
ops
question
release
major
release
minor
release
patch
security
ui/ux
wontfix
No Milestone
No project
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kosmos/chef#282
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/postgres_vms"
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?
Update Jan 24:
@greg and I have finished the migration of our PostgreSQL cluster from the host systems of Andromeda, Centaurus, and Draco, to new VMs on Centaurus and Draco.
Instead of the previous encfs setup, we now use standard full-disk encryption (LUKS/LVM) for the VMs to encrypt data at rest. So the decryption password has to be provided during the booting of the VM now.
The new setup also uses our Zerotier private network exclusively for database connections, and thus no public connections or TLS anymore.
In order to make both this migration seamless, as well make the switching of the primary node to a hot standby node much easier and quicker in the future as well, we have changed all database clients to use a custom
/etc/hosts
entry (pg.kosmos.local
).Then we created a script to run all the steps for switching the primary at once, both triggering the promotion of a standby node to primary, as well as stopping the old one, and updating the hosts entries without full Chef runs. This way, all clients will immediately re-connect to the new primary after promotion, which worked exactly as intended when we did it for this migration.
refs #280
@greg I was thinking about the most simple, low-tech, and stable solution for updating the postgres master address, and my last idea was:
/etc/hosts
entry on all postgres client VMsThis way, we don't need our own DNS server at all, and there's no extra connection or caching to think about. WDYT?
Yeah that seems like a good solution for now!
WIP: Move PostgreSQL to VMs and access via Zerotierto Move PostgreSQL to VMs and access via ZerotierI had a look, and it looks good to me, but I know absolutely zero about the ruby code, let alone the infrastructure. So take my approval for a grain of salt :)
EDIT: Also, I couldn't add my name to the reviewrs list
If you leave a comment using the review function on the changed-files tab (green button on the right), then you'll be added to the list, and also kredited by @galfert's new script.
LGTM!