db1213 needs to be upgraded
Impact: Read only for a few seconds on the services below:
Services running on m1:
- bacula
- cas (and cas staging)
- backups
- etherpad
- librenms
- pki
- rt
Switchover steps:
OLD MASTER: db1213
NEW MASTER: db1164
- Check configuration differences between new and old master pt-config-diff h=db1164.eqiad.wmnet,F=/root/.my.cnf h=db1213.eqiad.wmnet,F=/root/.my.cnf
- Enable notifications on db1164
- Silence alerts on all hosts: sudo cookbook sre.hosts.downtime --hours 1 -r "Primary switchover m1 T434043" 'A:db-section-m1'
- Topology changes: move everything under db1164
sudo db-switchover --timeout=1 --only-slave-move db1213.eqiad.wmnet db1164.eqiad.wmnet
- Disable puppet @db1213 and puppet @db1164 sudo cumin 'db1164* or db1213*' 'disable-puppet "primary switchover T434043"'
- Merge gerrit: https://gerrit.wikimedia.org/r/c/operations/puppet/+/1324209
- Run puppet on dbproxy1022 and dbproxy1024 and check the config
run-puppet-agent && cat /etc/haproxy/conf.d/db-master.cfg
- Start the failover
!log Failover m1 from db1213 to db1164 - T434043
root@cumin1001:~/wmfmariadbpy/wmfmariadbpy# sudo db-switchover --skip-slave-move db1213 db1164
- Reload haproxies
dbproxy1022: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio dbproxy1024: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
- kill connections on the old master (db1213)
pt-kill --print --kill --victims all --match-all F=/dev/null,S=/run/mysqld/mysqld.sock
- Restart puppet on old and new masters (for heartbeat):db1213 and db1164
sudo cumin 'db1164* or db1213*' 'run-puppet-agent -e "primary switchover T434043"'
- Check services affected (librenms, racktables, etherpad...)
- Clean orchestrator heartbeat to remove the old masters' one: sudo db-mysql db1164 heartbeat -e "delete from heartbeat where file like 'db1213%';"
- Merge backup ticket: https://gerrit.wikimedia.org/r/c/operations/puppet/+/1321468
- Update/resolve phabricator ticket about failover