Skip to content

chore(deploy): drop Docker DB orchestration, document the native tier - #113

Merged
ssavutu merged 1 commit into
mainfrom
chore/prune-docker-db-tier
Jul 30, 2026
Merged

chore(deploy): drop Docker DB orchestration, document the native tier#113
ssavutu merged 1 commit into
mainfrom
chore/prune-docker-db-tier

Conversation

@ssavutu

@ssavutu ssavutu commented Jul 30, 2026

Copy link
Copy Markdown
Member

The database tier now runs natively on its own hosts — DB1 (10.248.40.154, MariaDB 11.8 LTS) and THETRIANGLE-MAXSCALE (10.248.40.183, MaxScale 24.02), both apt installs on unprivileged LXC. The compose-based bring-up in this repo no longer describes anything that exists, and it pins MariaDB 11.7, which has been withdrawn from deb.mariadb.org (only LTS lines remain), so it cannot be executed even as a fallback.

Deleted

  • deploy/compose.mariadb-primary.yml, deploy/compose.mariadb-replica.yml, deploy/compose.mariadb-dev.yml
  • deploy/mariadb/primary-initdb/docker-entrypoint-initdb.d only; the repl and maxscale users were created by hand on DB1
  • deploy/mariadb/dev.cnf and deploy/cms.env.dryrun.example — the throwaway dry-run node and its volume were removed 2026-07-29

Nothing in CI, deploy/scripts/, or either README referenced any of them.

Kept and corrected

The .cnf files stay, because they are the deployed config — edit here, copy up, restart. Three things in them were wrong:

  • Both headers claimed they install as 50-triangle-*.cnf, contradicting the bind-address note in the same file. A 50- file cannot override Ubuntu's stock 50-server.cnf, which binds 127.0.0.1, so the node would be unreachable from MaxScale. Now 70-.
  • replica.cnf had no bind-address at all — DB2 would have come up on 127.0.0.1 and been invisible to both MaxScale and the primary. Added as a must-set line (commented, since DB2's address doesn't exist yet).
  • maxscale.cnf's header described compose-supplied env vars; it now documents the systemd drop-in and /etc/maxscale.secrets.d/backend.env.

Rewritten

setup-replica.sh now runs natively on the replica host instead of via docker compose exec, and fixes a bug that would have bitten at DB2 provisioning time: it dumped as REPL_USER, which holds only REPLICATION SLAVE and therefore cannot read tables — the dump step would have failed with "SELECT command denied". It now takes a separate DUMP_USER/DUMP_PASSWORD, and writes the dump via mktemp with mode 0600 and a cleanup trap, since it is a full plaintext copy of the database.

deploy/mariadb/README.md is rewritten for the native tier: host table, apt/GPG specifics (MaxScale needs its own key, rotated 2025-12-10), where secrets actually live, DB1's account grants, DB2 bring-up, and the operational traps — MaxScale sizing its query-classifier cache from the Proxmox host's RAM inside LXC (9.38 GiB on a 4 GB box), the lapsing DHCP leases on both hosts, DB1's open firewall, and DB1 currently being the only copy of the data.

Verification

deploy/scripts/deploy_scripts_test.sh passes. docker compose -f deploy/compose.cms.yml config validates (CI supplies the env vars). No code changes.

🤖 Generated with Claude Code

The database tier now runs natively on its own hosts (DB1 = MariaDB 11.8,
THETRIANGLE-MAXSCALE = MaxScale 24.02, both apt on unprivileged LXC), so the
compose-based bring-up in this repo no longer describes anything that exists.
Worse, it pins MariaDB 11.7, which has been withdrawn from deb.mariadb.org
(only LTS lines remain), so it cannot be executed even as a fallback.

Delete the dead orchestration: compose.mariadb-{primary,replica,dev}.yml,
mariadb/primary-initdb/ (docker-entrypoint-initdb.d only; the repl and maxscale
users were created by hand on DB1), mariadb/dev.cnf, and cms.env.dryrun.example
(the throwaway dry-run node and its volume were removed 2026-07-29). Nothing in
CI, deploy/scripts/, or the READMEs referenced them.

Keep the .cnf files — they ARE the deployed config — and correct them:

- Both headers claimed they install as 50-triangle-*.cnf, contradicting the
  bind-address note in the same file. A 50- file cannot override Ubuntu's stock
  50-server.cnf, which binds 127.0.0.1 and would leave the node unreachable.
- replica.cnf had no bind-address at all, so DB2 would have come up on
  127.0.0.1 and been invisible to MaxScale. Added as a must-set line.
- maxscale.cnf's header described compose-supplied env vars; it now documents
  the systemd drop-in and /etc/maxscale.secrets.d/backend.env.

Rewrite setup-replica.sh to run natively on the replica host, and fix the
privilege bug while there: it dumped as REPL_USER, which holds only
REPLICATION SLAVE and cannot read tables, so it would have failed at the dump
step when DB2 arrives. It now takes a separate DUMP_USER/DUMP_PASSWORD, and
writes the dump via mktemp with 0600 and a cleanup trap since it is a full
plaintext copy of the database.

deploy/mariadb/README.md is rewritten for the native tier: host table, apt and
GPG specifics, where secrets actually live, DB1's grants, DB2 bring-up, and the
operational traps (MaxScale mis-sizing its cache from the Proxmox host's RAM
inside LXC, the lapsing DHCP leases, the open firewall on DB1, DB1 currently
being the only copy of the data).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu
ssavutu force-pushed the chore/prune-docker-db-tier branch from 044eb97 to 0597177 Compare July 30, 2026 06:24
@ssavutu
ssavutu merged commit 8244e13 into main Jul 30, 2026
5 checks passed
@ssavutu
ssavutu deleted the chore/prune-docker-db-tier branch July 30, 2026 06:33
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.

1 participant