- Kill the replica
kubectl scale statefulset --replicas 0
- Follow the directions to lock db, mysqldump primary data, and fetch binlog coords from here
- Use
mysqldump --all-databases --source-data -h<host or ip> -u root -p > primary-data.sql
to dump data
- Use
- Create a file in
/opt/kubehostpaths/<replicadir>
containingALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
- Add
--init-file=/bitnami/mysql/rootpwd.sql
to the CLI options of the replica intanka/libs/mysql/hahostpath.libsonnet
- Copy
primary-data.sql
to/opt/kubehostpaths/<replicadir>
- TK apply, scale the statefulest back up, and import the
primary-data.sql
to the replica - Scale down replica statefulset
- Revert changes to
tanka/libs/mysql/hahostpath.libsonnet
and tk apply - Restart replication per step 6 here
https://www.digitalocean.com/community/tutorials/how-to-set-up-replication-in-mysql