1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-16 18:34:05 +00:00

Fixed mariadb replica bootstrap

This commit is contained in:
2026-05-13 18:15:16 -04:00
parent c1b01f0dac
commit aae0fe3002

View File

@@ -77,9 +77,11 @@ spec:
| grep -Ev '^(information_schema|performance_schema|mysql|sys)$' \ | grep -Ev '^(information_schema|performance_schema|mysql|sys)$' \
| tr '\n' ' ') | tr '\n' ' ')
echo "Dumping databases: ${DBS}" echo "Dumping databases: ${DBS}"
{
echo "SET SESSION sql_log_bin=0;"
mysqldump --protocol=TCP -h "$MASTER_HOST" -uroot -p"$MARIADB_ROOT_PASSWORD" \ mysqldump --protocol=TCP -h "$MASTER_HOST" -uroot -p"$MARIADB_ROOT_PASSWORD" \
--single-transaction --master-data=2 --gtid --databases $DBS \ --single-transaction --master-data=2 --gtid --databases $DBS
> /docker-entrypoint-initdb.d/dump.sql } > /docker-entrypoint-initdb.d/dump.sql
echo "Bootstrap dump complete" echo "Bootstrap dump complete"
volumeMounts: volumeMounts:
- name: wrestlingdev-mariadb-persistent-storage - name: wrestlingdev-mariadb-persistent-storage
@@ -296,6 +298,8 @@ data:
# Replication (replica) # Replication (replica)
# Must be unique and different from the master's server_id # Must be unique and different from the master's server_id
server_id=2 server_id=2
# Keep replica-local binlogged writes in a separate GTID domain from the master
gtid_domain_id=2
# Enable binary logging on the replica (required for log_slave_updates) # Enable binary logging on the replica (required for log_slave_updates)
log_bin=mysql-bin log_bin=mysql-bin
# ROW format is safest: records exact row changes rather than SQL statements # ROW format is safest: records exact row changes rather than SQL statements