Table of Contents

,

Mysql promote slave to master

1. On master: stop the application using the mysql DB

2. On slaves:

STOP SLAVE IO_THREAD;
SHOW PROCESSLIST; –> has to show message "Has read all relay log"

3. On slave which will be the new master:

STOP SLAVE;
RESET MASTER;

/var/log/mysql/ should be empty

4. Reconfigure stunnels if any.

5. On slaves:

STOP SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=3308;
START SLAVE;

6. Start your app on new master.

Tested on

See also

References