1
realpg 2015-08-20 16:03:09 +08:00 via Android
啥错误你都不说。
|
3
realpg 2015-08-20 16:04:45 +08:00 via Android
抱歉,手机刷不出图来,发帖完事回来才看到图
|
5
tb4649120073rs 2015-08-20 18:28:08 +08:00 1
数据脏了 主库更新了某条记录 但在从库中不存在该条记录
|
6
Nixus OP @tb4649120073rs 是的,这个问题,我居然幻想用重新配置主从同步来解决,我把从库所有数据清空,然后在主库上加锁,把主库拷了一份到从库,配置完成后,一切正常,但是十几分钟后,这个问题又重新出现了……
根据我过去两天多次尝试的观察,出问题的,是 mysql-bin.000060 ,开始怀疑是否硬盘出现了坏道,毕竟硬盘已经跑了近一年 Linux 上的硬盘检测什么的,真的不懂,我是 PHPer ,但是服务器也是要搞的 |
7
coolwind 2015-08-21 09:11:13 +08:00 1
Master 执行看看 mysql-bin.000060 的 4951916 是什么内容,想想这条命令对应的 data 在 slave 上为何不见了
SHOW BINLOG EVENTS IN 'mysql-bin.000060' FROM 4951916 LIMIT 10; |
8
Nixus OP @coolwind
| mysql-bin.000060 | 4951916 | Update_rows | 1 | 4952598 | table_id: 2753 flags: STMT_END_F | | mysql-bin.000060 | 4952598 | Query | 1 | 4952672 | COMMIT | | mysql-bin.000060 | 4952672 | Query | 1 | 4952809 | use `kjrs_crm2`; DELETE FROM `kjrs_crm2`.`crm_sessions_data` WHERE expiry < 1439993091 | | mysql-bin.000060 | 4952809 | Query | 1 | 4952941 | use `kjrs_crm2`; DELETE FROM `kjrs_crm2`.`crm_sessions` WHERE expiry < 1439993094 | | mysql-bin.000060 | 4952941 | Query | 1 | 4953014 | BEGIN | | mysql-bin.000060 | 4953014 | Table_map | 1 | 4953118 | table_id: 2765 (kjrs_crm2.crm_ordersyn_goods ) | | mysql-bin.000060 | 4953118 | Delete_rows | 1 | 4953268 | table_id: 2765 flags: STMT_END_F | | mysql-bin.000060 | 4953268 | Query | 1 | 4953342 | COMMIT | | mysql-bin.000060 | 4953342 | Intvar | 1 | 4953370 | INSERT_ID=1709586 | | mysql-bin.000060 | 4953370 | Query | 1 | 4953648 | use `kjrs_crm2`; INSERT INTO `kjrs_crm2`.`crm_ordersyn_record`(admin_id, sql_content, table_name, operate_time )VALUES (497, 'DELETE FROM `kjrs_crm2`.`crm_ordersyn_goods` WHERE rec_id=479315 LIMIT 1', 'ordersyn_info', 1440023697 ) | +------------------+---------+-------------+-----------+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ sql 没问题,但是事务那块就不怎么明白了,只有 table_id,flags,这些事什么意思呢? table_id 是 mysql 中,这个 table 的 id ? |
9
zjqzxc 2015-08-21 11:23:18 +08:00 1
smartctl 看看硬盘 smart 有木有报告, mysql 的问题实在帮不了。
|
10
julyclyde 2015-08-21 15:25:58 +08:00 1
master 上
show global variables like 'binlog%'; slave 上 show global variables like 'replicate_%'; 结果给一下,我怀疑你的配置略过了一些 sql 没执行,导致主从不一致 |
12
Nixus OP @julyclyde
master 上的结果: mysql> show global variables like 'binlog%'; +-----------------------------------------+-------+ | Variable_name | Value | +-----------------------------------------+-------+ | binlog_cache_size | 32768 | | binlog_direct_non_transactional_updates | OFF | | binlog_format | MIXED | +-----------------------------------------+-------+ 3 rows in set (0.00 sec ) slave 上的结果: mysql> show global variables like 'replicate_%'; Empty set (0.00 sec ) |
13
julyclyde 2015-08-23 21:41:27 +08:00 1
看起来设置方面没啥问题。那我也不清楚了
建议检查一下磁盘是否正常工作吧 |