k8s-manifests/ops/110-native-mysql
2026-07-23 14:57:22 +08:00
..
99-mes-prd-replica-13.cnf deploy: add native mysql replicas for 110 2026-07-23 13:36:48 +08:00
99-mes-prd-replica-64.cnf deploy: add native mysql replicas for 110 2026-07-23 13:36:48 +08:00
99-mes-prd-replica-73.cnf deploy: add native mysql replicas for 110 2026-07-23 13:36:48 +08:00
apply-replica-config.sh fix: load host mysql overrides after package defaults 2026-07-23 13:44:45 +08:00
clone-replica.sh fix: wait for mysql after clone restart 2026-07-23 14:57:22 +08:00
install-replica.sh fix: allow native mysql beside isolated container 2026-07-23 14:45:27 +08:00
README.md deploy: add native mysql clone helper for 110 2026-07-23 14:55:54 +08:00

110 native MySQL replicas

This directory tracks the host-level MySQL replica configuration for the 10.10.11.110 production cluster. MySQL runs under systemd on the worker hosts; it is not deployed as a container.

Topology

Role Host MySQL port Server ID
Existing source 192.168.110.208 3316 10
Reader 1 192.168.110.73 3306 11073
Reader 2 192.168.110.13 3306 11013
Backup replica 192.168.110.64 3306 11064

ProxySQL is deployed separately as two Kubernetes replicas, following the same pattern as the 10.10.11.10 cluster. The existing source remains the only writer until all replicas pass validation and a separate cutover is approved.

Deployment order

  1. Install and seed .73, then verify GTID replication and read-only mode.
  2. Install .13 and clone it from .73, then configure its own GTID channel.
  3. Install .64 only after confirming sufficient disk headroom; keep it out of the ProxySQL reader pool as the backup replica.
  4. Deploy ProxySQL canary and validate routing before changing application traffic.

The source is MySQL 8.0.32 while Ubuntu 24.04 installs MySQL 8.0.46. Seed the first replica with one online, consistent logical export, then use the clone plugin only between the 8.0.46 replicas.

Never stop, reset, reinitialize, or change read-only state on the existing source as part of this procedure. Credentials and generated SQL must remain outside Git.

Installation

Run on the target host from a checked-out, pushed revision:

sudo ./install-replica.sh ./99-mes-prd-replica-73.cnf

After seeding and configuring replication, require all of the following:

SELECT @@server_id, @@read_only, @@super_read_only, @@gtid_mode;
SELECT CHANNEL_NAME, SERVICE_STATE, LAST_ERROR_NUMBER, LAST_ERROR_MESSAGE
FROM performance_schema.replication_connection_status;
SELECT CHANNEL_NAME, SERVICE_STATE
FROM performance_schema.replication_applier_status;

Both replication service states must be ON, both read-only values must be 1, and the connection error number must be 0 before ProxySQL can use the host.

Clone the second and backup replicas from the first MySQL 8.0.46 replica with a temporary, root-readable secret file that is never committed:

sudo ./clone-replica.sh 192.168.110.73 /path/to/clone-secret

The donor account must be limited to BACKUP_ADMIN. Remove that account and all temporary secret files after both clones have completed and replication has been verified.