我即將爲我的typo3數據庫做一個MySQL複製。有兩臺服務器。你猜對了,一個是主,一個是奴隸。MySQL複製主從
大師的my.cnf:
[mysql]
server-id = 1
log-bin
expire_logs_days = 21
max_binlog_size = 500M
binlog-ignore-db=mysql
從my.cnf文件:[email protected] REPLICATION SLAVE, REPLICATION CLIENT
用戶奴隸:
[mysql]
server-id = 2
binlog-ignore-db = mysql
replicate-ignore-db = mysql
auto-increment-offset = 1
expire_logs_days = 21
max_binlog_size = 500M
上的主用戶[email protected] REPLICATION SLAVE, REPLICATION CLIENT
到目前爲止一切正常,即使我在Master上改變了一些東西,但是如果我在Master上刪除了同樣的東西,Slave也會以這個錯誤結束或消息:
Last_SQL_Error: Error 'Duplicate entry '65021' for key 'PRIMARY'' on query. Default database: 'typo3'. Query: 'INSERT INTO sys_log (userid,type,action,error,details_nr,details,IP,tstamp,workspace) VALUES ('0','5','0','2','0','Core: Exception handler (WEB): Uncaught TYPO3 Exception: Reason: Segment "404" was not a keyword for a postVarSet as expected on page with id=0.<br />\n<br />\nAdditionally, http://www.21cdocs.de/404/ was not found while trying to retrieve the error document. | RuntimeException thrown in file /mnt/platte02/www/typo3/typo3_src-4.5.19/typo3/sysext/cms/tslib/class.tslib_fe.php in line 1542','masterip','1351240603','0')'
這是show slave status\G
表明了我。
任何解決方案如何強制奴隸覆蓋一切它與碩士數據?
- 蒂莫