MySQL主從切換流程圖
+-----------------+ +-----------------+ | 主數(shù)據(jù)庫服務(wù)器 | | 從數(shù)據(jù)庫服務(wù)器 | +-----------------+ +-----------------+ | | 查看主庫狀態(tài) | | | +---------------+ | | SHOW MASTER STATUS | | +---------------+ | | | 獲取二進制文件名和位置 | | | V V +-----------------+ +-----------------+ | 停止寫操作 (FLUSH TABLES WITH READ LOCK) | | 停止IO線程 (STOP SLAVE) | +-----------------+ +-----------------+ | | V V +-----------------+ +-----------------+ | 復(fù)制二進制文件及日志記錄 | | 執(zhí)行切換命令 (CHANGE MASTER) | +-----------------+ +-----------------+ | | V V +-----------------+ +-----------------+ | 切換讀取操作 (UNLOCK TABLES) | | 啟動IO線程 (START SLAVE) | +-----------------+ +-----------------+ | | 完成主從切換 | | | V V +-----------------+ +-----------------+ | 主數(shù)據(jù)庫服務(wù)器 | | 從數(shù)據(jù)庫服務(wù)器 | +-----------------+ +-----------------+
上一篇mysql主從升級步驟
下一篇mysql商城