Commit Graph
15 Commits
Author SHA1 Message Date
wan f691e38e93 015: remote access - ocrt_dev db over TLS+SCRAM via PgBouncer
- role ocrt_dev (LOGIN, random password in /var/lib/sysmig/secrets,
  not superuser - DB ownership suffices for schema migrations)
- database ocrt_dev owner ocrt_dev
- pgbouncer: listen 0.0.0.0, self-signed CA+cert (SAN=hostname/IPs),
  client_tls_sslmode=require, userlist synced from pg_authid (SCRAM
  pass-through; pg_hba unchanged)
- two pool aliases: ocrt_dev (transaction) and ocrt_dev_migrate
  (session, for advisory-lock-based migration tools)
- 013 status: listen_addr expectation flips once 015 is applied
- GCP firewall tcp:6432 remains a manual step (gcloud cmd in header)
2026-08-31 22:34:32 +09:00
wan c639b5397f 013: make config dir/ini readable so non-root status works
/etc/pgbouncer was 750 postgres:postgres, so "sysmig status" as the
login user false-DRIFTed on the -f check. Dir 755 + ini 644; userlist
(future SCRAM verifiers) stays 640 postgres.
2026-08-31 22:26:17 +09:00
wan ff3f6732e9 010: fix verification - compare pg_settings raw values, not SHOW output
SHOW() pretty-renders units (60s -> '1min'), which broke the post-up
check after a successful apply. Compare pg_settings.setting (base-unit
raw values) instead - rendering-proof.
2026-08-31 22:24:38 +09:00
wan 08c585d048 013: PgBouncer transaction pooling on localhost:6432
Serverless clients -> many short connections, few TPS. pool_mode=
transaction, max_client_conn=300, default_pool_size=20 (+reserve 5)
matching max_connections=30. max_prepared_statements=200 for ORM
prepared statements. localhost-only until remote-access migration
(roadmap 015). README table + notes updated.
2026-08-31 22:21:53 +09:00
wan 04068a49e3 012: cap parallelism and disable jit for shared 2 vCPU
max_parallel_workers_per_gather=1, max_parallel_workers=2, jit=off.
All reloadable - no restart.
2026-08-31 22:21:53 +09:00
wan ba1b6a4393 011: observability - pg_stat_statements, slow-log, io timing
preload pg_stat_statements (+extension in iwanhae/postgres DBs),
log_min_duration_statement=500ms, track_io_timing=on.
2026-08-31 22:21:53 +09:00
wan e7cfa261c8 010: memory & stability tuning for 1GB e2-micro
max_connections 100->30, effective_cache_size 768MB, statement_timeout
30s, idle_in_transaction_session_timeout 60s, temp_file_limit 2GB via
conf.d drop-in; restart only when max_connections changes.
2026-08-31 22:21:53 +09:00
wan 84d6f9724c status: fix false DRIFT for non-root invocations
- runner: export sbin-inclusive PATH (util-linux tools live in /usr/sbin)
- 001: read /proc/swaps instead of swapon(8)
- 005: resolve /dev/disk/by-uuid symlink instead of findfs(8); report ?
  (exit 2) when the UUID cannot be resolved
2026-08-31 16:48:06 +09:00
wan 5d1f641c61 add per-migration status case (read-only drift check), integrate into sysmig status
status convention: print one line, exit 0 OK / 1 DRIFT / 2 unknown (e.g.
needs root). sysmig status now shows [applied ✓/✗/?] per migration and
exits 1 on drift. DB checks fall back to peer auth when non-root.
2026-08-31 16:46:21 +09:00
wan 4c21cccae3 008: personal database iwanhae owned by admin role 2026-08-31 16:31:53 +09:00
wan 29e87149eb 007: iwanhae OS user as PostgreSQL superuser via peer auth 2026-08-31 16:28:40 +09:00
wan 78c8e79726 006: PostgreSQL 18 from official PGDG repo instead of Debian's PG 17
Per https://www.postgresql.org/download/linux/debian/ (manual configuration):
GPG key + deb822 sources (codename-pgdg) + postgresql-18. Skip-check now
requires an 18 cluster. Down also removes the PGDG repo.
2026-08-31 16:22:10 +09:00
wan f7a387e821 006: fix disk check - findmnt -T (containing fs), not exact mountpoint 2026-08-31 16:13:30 +09:00
wan 873d254009 005/006: mount /dev/sdb at /var/lib/postgresql + install PostgreSQL 17 on it 2026-08-31 16:11:37 +09:00
wan f69cb99b3f sysmig: migration runner + initial 4 migrations (swap, daemon trims)
- up/down/status interface, history in /var/lib/sysmig/applied
- 001 swap 2GB + swappiness=10, 002-004 trim unneeded daemons (~56MB)
- google-osconfig-agent intentionally kept
- all messages/comments in ASCII English (console font safety)
2026-08-31 15:49:01 +09:00