db1176 needs to be reimaged
Databases on m5:
labsdbaccounts mailman3 mailman3web striker test_labsdbaccounts toolhub
Impact: Writes will be disabled for around 1 minute.
Failover process
OLD MASTER: db1176
NEW MASTER: db1119
- Check configuration differences between new and old master
$ pt-config-diff h=db1119.eqiad.wmnet,F=/root/.my.cnf h=db1176.eqiad.wmnet,F=/root/.my.cnf
- Silence alerts on all hosts: sudo cookbook sre.hosts.downtime --minutes 60 -r "m5 master switch T352505" 'A:db-section-m5'
- Topology changes: move everything under db1119
db-switchover --timeout=15 --only-slave-move db1176.eqiad.wmnet db1119.eqiad.wmnet
- Disable puppet db1119 and db1176 sudo cumin 'db1119* or db1176*' 'disable-puppet "primary switchover T352505"'
- Merge gerrit: https://gerrit.wikimedia.org/r/c/operations/puppet/+/979489
- Run puppet on dbproxy1027 and dbproxy1021 and check the config
run-puppet-agent && cat /etc/haproxy/conf.d/db-master.cfg
- Start the failover: !log Failover m5 from db1176 to db1119 - T332155
- DB switchover
root@cumin1001:~/wmfmariadbpy/wmfmariadbpy# db-switchover --skip-slave-move db1176 db1119
- Reload haproxies (dbproxy1021 is the active one)
dbproxy1017: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio dbproxy1021: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
- kill connections on the old master (db1176)
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):db1119 and db1176 sudo cumin 'db1119* or db1176*' 'run-puppet-agent -e "primary switchover T352505"'
- Check affected services
- Clean orchestrator heartbeat to remove the old masters' one, otherwise Orchestrator will show lag: delete from heartbeat where server_id= 171966607;