【问题标题】:MySQL replication Master-SlaveMySQL复制主从
【发布时间】:2012-10-16 12:34:15
【问题描述】:

我即将对我的typo3 数据库进行 MySQL 复制。有两台服务器。你猜对了,一个是Master,一个是Slave。

大师my.cnf:
[mysql]
server-id = 1
log-bin
expire_logs_days = 21
max_binlog_size = 500M
binlog-ignore-db=mysql

从my.cnf:
[mysql]
server-id = 2
binlog-ignore-db = mysql
replicate-ignore-db = mysql
auto-increment-offset = 1
expire_logs_days = 21
max_binlog_size = 500M

Master 上的用户:repl@slaveip REPLICATION SLAVE, REPLICATION CLIENT
从站用户:repl@masterip 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 向我展示的内容。

我有什么解决方案可以强制 Slave 用 Masters 数据覆盖它上面的一切

- 蒂莫

【问题讨论】:

    标签: mysql database replication database-replication master-slave


    【解决方案1】:

    slave-skip-errors = 1062 会跳过错误,但我认为这不是一个好的解决方案

    更新:显然 Typo3 在 sys_log 表上犯了一些错误。

    【讨论】:

      猜你喜欢
      • 2014-07-07
      • 2012-09-14
      • 1970-01-01
      • 2012-08-25
      • 2011-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-09
      相关资源
      最近更新 更多