The day before yesterday to customers to do a database server adjustment, the previous one host abandoned, one from the library to promote the main, and then new to join other slave, here to record the operation steps:
First, the old master library is turned on for read-only so that later steps are rolled back: Flush tables with read lock
Second, 110.10.1.102 upgrade to the main library, pause synchronization, reset to primary, clean up the relay information, restart the database
stop slave, reset master, MV Master.info relay.log/tmp
Modify the configuration file my.cnf join expire_logs_days=15 and innodb_file_per_table
Third, open the new main library read-only: Flush tables with read lock
Export logical Backup: Mysqldump-u root-p--single-transaction-r--flush-logs--master-data=1-databases db1 DB2 db3> database1204. Sql
Iv. Show Master status, import data to a new library and change master
V. Finally view all status information from the library, show slave status, and unlock the tables of the main library
As a reminder, the mysql5.5 version no longer supports parameters such as Masterhost in/ETC/MY.CNF and must be connected to MySQL to perform change master
This article is from the "Linux breakout" blog, so be sure to keep this source http://lpw2013.blog.51cto.com/3188934/1586747
MySQL Database Server tuning