Switch DNS aggregator to PostgreSQL

MariaDB+Galera was terribly unstable, with the cluster failing to
start or dying randomly, and generally seemed incredibly unsuitable
for an HA solution. This commit switches the DNS aggregator SQL
backend to PostgreSQL, implemented via Patroni HA.

It also manages the Patroni state, forcing the primary instance to
follow the PVC coordinator, such that the active DNS Aggregator
instance is always able to communicate read+write with the local
system.

This required some logic changes to how the DNS Aggregator worked,
specifically ensuring that database changes aren't attempted while
the instance isn't actively running - to be honest this was a bug
anyways that had just never been noticed.

Closes #34
This commit is contained in:
2019-05-20 22:40:07 -04:00
parent 73443ecbaf
commit 595cf1782c
5 changed files with 171 additions and 97 deletions

View File

@ -61,17 +61,17 @@ pvc:
coordinator:
# dns: DNS aggregator subsystem
dns:
# database: MySQL Galera database configuration
# database: Patroni PostgreSQL database configuration
database:
# host: MySQL hostname, invariably 'localhost'
# host: PostgreSQL hostname, invariably 'localhost'
host: localhost
# port: MySQL port, invariably 'localhost'
port: 3306
# name: MySQL database name, invariably 'pvcdns'
# port: PostgreSQL port, invariably 'localhost'
port: 5432
# name: PostgreSQL database name, invariably 'pvcdns'
name: pvcdns
# user: MySQL username, invariable 'pvcdns'
# user: PostgreSQL username, invariable 'pvcdns'
user: pvcdns
# pass: MySQL user password, randomly generated
# pass: PostgreSQL user password, randomly generated
pass: pvcdns
# system: Local PVC instance configuration
system: